cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7-discovery, STemWin, lack of RAM

baev_al
Associate II
Posted on February 11, 2016 at 15:25

Hi.

I try to test emWin example – MEMDEV_AttitudeIndicator.c. To be able to run it 1024 * 700 bytes of memory are required. I took HelloWorld StemWin example as a starting point. When I try to increase the necessary memory in GUIConf.c file from 1024*150 to 1024*700 the error occurred:

unable to allocate space for sections/blocks with a total estimated minimum size of 0xafb74 bytes (max align 0x8) in <[0x20000000-0x2004ffff]> (total uncommitted space 0x50000).

So necessary RAM is bigger than what we have.

But we also have external RAM. Is it possible to include it somehow? Or is there any other solution?

Thanks.

5 REPLIES 5
Posted on February 11, 2016 at 17:27

You'd probably want to get the SDRAM up and running via your SystemInit() code, make sure the memory is described in your linker script or scatter file, and then either place your heap in that section, or your large static allocations.

These wouldn't be materially different in concept to the discussions about the F429I and F469I DISCO boards.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
marcopiovesan9
Associate II
Posted on February 16, 2016 at 15:29

Hi Clive,

can you kindly link the discussions about this argument.

Thank you a lot

Marco

Posted on February 16, 2016 at 22:00

I'd just have to trawl through Google..

Which IDE or tool chain are you using, might help pulling most specific threads.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 18, 2016 at 23:14

Hi,

if you are out of internal SRAM space - two options:

a) If your data, e.g. a background image for LCD, a huge look-up table ... has const data (just read, no need to modify) - you can put it into FLASH (ROM). This is done automatically by adding ''const'' to the C-code array definition.

b) You can also use external SDRAM. Just enable it via the SystemConfig function. BTW: if you use the LCD it should be already enabled, the frame buffer for LCD is on SDRAM.

So, you should have a huge amount of SDRAM.

Just: the linker does not know your SDRAM (sure, not available at boot time, no way to let load code via debugger there). You have to manage and organize the data and access to SDRAM yourself. Best is to use the macros which define base address and size of SDRAM and use a pointer to SDRAM.

BTW: if you have a data array in image (code) and you want to have it on SDRAM - you had to memcpy() during runtime to SDRAM: SDRAM is not loaded by debugger and only available after your system init was executed.

Other option is: QSPI (I use it already): you can enable QSPI flash device and map it (as NOR). It would become readable as any other memory, but not write-able: you had to flush the QSPI with your data (e.g. LCD images, pictures, audio files ...) using the ST-LINK utility. Works great for huge data (as RO, const), just a bit slow, but working transparent in C-code as any other RO memory.

marcopiovesan9
Associate II
Posted on February 22, 2016 at 12:27

Hi Clive,

thank you for your suggestion.

Marco