f407vet6 & f407zet6

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
Post Reply
User avatar
Zingg_JM
Posts: 40
Joined: Tue Jan 17, 2017 10:46 am

Re: f407vet6 & f407zet6

Post by Zingg_JM » Sun Jun 04, 2017 5:32 pm

It seem the 14k are counted for even twice. Strange!

Code: Select all

#define GxGDE035A3_WIDTH 800
#define GxGDE035A3_HEIGHT (480 - 51)
#define GxGDE035A3_BUFFER_SIZE GxGDE035A3_WIDTH * GxGDE035A3_HEIGHT / 4 // 2bits per pixel

Arduino: 1.8.2 (Windows 10), Board: "STM32 Discovery F407"

c:/users/zinggj/appdata/local/arduino15/packages/stm32/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: C:\Users\ZinggJ\AppData\Local\Temp\arduino_build_825677/DESTM32-L_V4.ino.elf section `.bss' will not fit in region `ram'

c:/users/zinggj/appdata/local/arduino15/packages/stm32/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: region `ram' overflowed by 248 bytes

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board STM32 Discovery F407.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

#define GxGDE035A3_WIDTH 800
#define GxGDE035A3_HEIGHT (480 - 52)
#define GxGDE035A3_BUFFER_SIZE GxGDE035A3_WIDTH * GxGDE035A3_HEIGHT / 4 // 2bits per pixel

Arduino: 1.8.2 (Windows 10), Board: "STM32 Discovery F407"

c:/users/zinggj/appdata/local/arduino15/packages/stm32/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: C:\Users\ZinggJ\AppData\Local\Temp\arduino_build_825677/DESTM32-L_V4.ino.elf section `.bss' will not fit in region `ram'

c:/users/zinggj/appdata/local/arduino15/packages/stm32/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: region `ram' overflowed by 48 bytes

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board STM32 Discovery F407.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

#define GxGDE035A3_WIDTH 800
#define GxGDE035A3_HEIGHT (480 - 53)
#define GxGDE035A3_BUFFER_SIZE GxGDE035A3_WIDTH * GxGDE035A3_HEIGHT / 4 // 2bits per pixel

Sketch uses 846208 bytes (80%) of program storage space. Maximum is 1048576 bytes.
Global variables use 114536 bytes of dynamic memory.
STM32 ST-LINK CLI v2.1.0
STM32 ST-LINK Command Line Interface

ST-LINK SN : 52FF6E065077575227540187
ST-LINK Firmware version : V2J27S6
Connected via SWD.
SWD Frequency = 1800K.
Connection mode : Normal.
Device ID:0x413 
Device flash Size : 512 Kbytes
Device family :STM32F40xx/F41xx

Loading file...
Flash Programming:
  File : C:\Users\ZinggJ\AppData\Local\Temp\arduino_build_825677\DESTM32-L_V4.ino.bin
  Address : 0x08000000
Flash memory programming...
±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 0%
 0%ÛÛÛÛÛÛÛ 15%ÛÛÛÛÛÛÛÛ 30%ÛÛÛÛÛÛÛ 45%ÛÛÛÛÛÛÛÛ 60%ÛÛÛÛÛÛÛ 75%ÛÛÛÛÛÛÛÛ 90%ÛÛÛÛÛ 100%
Flash memory programmed in 22s and 641ms.
Programming Complete.

MCU Reset.

Application started.

I like clickable and valid links that point to relevant information

User avatar
Pito
Posts: 1593
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: f407vet6 & f407zet6

Post by Pito » Sun Jun 04, 2017 5:45 pm

You may compress data in your b/w video buffer.. :)
You may use an 8pin SPI external sram/fram/mram (up to 512kB/chip)..
Or you may add a 256kx16 sram provided you use a zet6 board.. Browse this forum..
Pukao Hats Cleaning Services Ltd.

User avatar
Zingg_JM
Posts: 40
Joined: Tue Jan 17, 2017 10:46 am

Re: f407vet6 & f407zet6

Post by Zingg_JM » Sun Jun 04, 2017 6:35 pm

Pito wrote:You may compress data in your b/w video buffer.. :)
You may use an 8pin SPI external sram/fram/mram (up to 512kB/chip)..
Or you may add a 256kx16 sram provided you use a zet6 board.. Browse this forum..
Thank you, there are many options. But this does not answer my questions.

And the overhead of 28k should be explained somehow.
I like clickable and valid links that point to relevant information

ag123
Posts: 770
Joined: Thu Jul 21, 2016 4:24 pm

Re: f407vet6 & f407zet6

Post by ag123 » Sun Jun 04, 2017 7:21 pm

if you are using a ZET6 then FSMC & external SRAM may well be a feasible approach, trying imagine adding perhaps 32 megs SRAM
http://www.mouser.com/Semiconductors/Me ... w8Z1z0vhtu
but of course this is just mbits, but i'd guess if 1 is determined, you may well find it and 1024x768 'full color' screen buffer may not longer be simply a pipe dream

to go with lower costs SDRAM may be a good alternative with FSMC
http://www.ebay.com/sch/i.html?_from=R4 ... m&_sacat=0

the biggest pipe dream is actually to do 1920x1680 HDMI full HD video and interface directly with HDMI, this my guess would remain a pipe dream for some time
:lol:

stevestrong
Posts: 1748
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: f407vet6 & f407zet6

Post by stevestrong » Sun Jun 04, 2017 7:49 pm

Check this post too: viewtopic.php?f=19&t=1713

User avatar
Zingg_JM
Posts: 40
Joined: Tue Jan 17, 2017 10:46 am

Re: f407vet6 & f407zet6

Post by Zingg_JM » Sun Jun 04, 2017 8:52 pm

Is there any chance I can get an answer to the 2 questions I posted:

How can the internal 64k RAM in addition to the internal 128k RAM of these processors be used by an Arduino program?

Why are 28k of the internal 128k RAM not available for an Arduino program (on these processors) ?

Jean-Marc Zingg
I like clickable and valid links that point to relevant information

stevestrong
Posts: 1748
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: f407vet6 & f407zet6

Post by stevestrong » Sun Jun 04, 2017 9:08 pm

Which core do you use?
Arduino_Stm32duino
or
Arduino_core_Stm32
?

As you only posted parts of your variables, we cannot know anything about the rest of them.
Meaning a part of the the 28k is used by system variables (USB serial massively uses Ram), the rest is used by other variables of your program.

User avatar
Zingg_JM
Posts: 40
Joined: Tue Jan 17, 2017 10:46 am

Re: f407vet6 & f407zet6

Post by Zingg_JM » Mon Jun 05, 2017 4:04 am

stevestrong wrote:Which core do you use?
Arduino_Stm32duino
or
Arduino_core_Stm32
?

As you only posted parts of your variables, we cannot know anything about the rest of them.
Meaning a part of the the 28k is used by system variables (USB serial massively uses Ram), the rest is used by other variables of your program.
I use "Board STM32 Discovery F407" from recently downloaded https://github.com/rogerclarkmelbourne/Arduino_STM32

here comes the compilable code extract that shows the issue:

Code: Select all

// STM32F407_RAM_issue.ino

#define GxGDE035A3_WIDTH 800
#define GxGDE035A3_HEIGHT (480 - 52)
#define GxGDE035A3_BUFFER_SIZE GxGDE035A3_WIDTH * GxGDE035A3_HEIGHT / 4 // 2bits per pixel

enum EPD_Model
{
  ESL35,
  ESL43,
  ESL60,
  ESL80
};
// note: 13504 bytes RAM used by system (empty program) on STM32F407
uint8_t _buffer[GxGDE035A3_BUFFER_SIZE]; // 96K
EPD_Model epaper_model;
uint8_t row_buffer[256]; // max epaper_width/4
uint8_t wave_begin_table[256][30];
uint8_t wave_end_table[256][30];


void setup()
{
  _buffer[0] = 0;
  row_buffer[0] = 0;
  wave_begin_table[0][0] = 0;
  wave_end_table[0][0] = 0;
}

void loop()
{
}

Code: Select all

Arduino: 1.8.2 (Windows 10), Board: "STM32 Discovery F407"

c:/users/zinggj/appdata/local/arduino15/packages/stm32/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: C:\Users\ZinggJ\AppData\Local\Temp\arduino_build_91724/STM32F407_RAM_issue.ino.elf section `.bss' will not fit in region `ram'

c:/users/zinggj/appdata/local/arduino15/packages/stm32/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: region `ram' overflowed by 32 bytes

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board STM32 Discovery F407.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
If you change line 4 from

Code: Select all

#define GxGDE035A3_HEIGHT (480 - 52)
to

Code: Select all

#define GxGDE035A3_HEIGHT (480 - 53)
you get
Sketch uses 15168 bytes (1%) of program storage space. Maximum is 1048576 bytes.
Global variables use 114520 bytes of dynamic memory.
What are the missing 128k - 114520 bytes used for ?

Jean-Marc Zingg
I like clickable and valid links that point to relevant information

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: f407vet6 & f407zet6

Post by danieleff » Mon Jun 05, 2017 4:19 am

In the linker the ram is set to 112K https://github.com/rogerclarkmelbourne/ ... jtag.ld#L8
I think it should be 128K. (There is a 112K region directly followed by a 16K region)

To use the extra 64K:
1. jtag.ld: below the ram line, put `ccmram (rw): ORIGIN = 0x10000000, LENGTH = 64K`
2. common.inc: below .bss section, put

Code: Select all

.ccmram (NOLOAD):
      {
        . = ALIGN(8);
        *(.ccmram .ccmram.*)
      } > ccmram
3. And in your code, use as
`uint8_t __attribute__((section(".ccmram"))) data_in_extra_ram[14*1024];
4. you need to zero out these variables yourself

I do not think it is possible to automatically spread out variables between the different not continuous regions.

User avatar
Zingg_JM
Posts: 40
Joined: Tue Jan 17, 2017 10:46 am

Re: f407vet6 & f407zet6

Post by Zingg_JM » Mon Jun 05, 2017 4:28 am

The demo board contains a chip "IS62WV51216", the pdf I downloaded says 512K x 15, so I will use this when I receive the 1024x768.

The demo code I converted from Keil5 to Arduino IDE STM32 even had a function Init_RAM, but this was empty.

So I will need to learn how to initialize FSMC to use that SRAM, as long as I use the demo board.

Is there a library example for FSMC RAM? or a post describing FSMC initialization?

(please post a link to the most relevant post, not the whole lengthy topic, thanks).

I still would like to know why not the full 128k can be used; can I avoid USB code?

Jean-Marc Zingg
I like clickable and valid links that point to relevant information

Post Reply