3 years, 5 months ago.

How to used external SDRAM on DISCO-F429ZI as

Hello, DISCO-F429ZI board has external SDRAM on it and I have an application that I use very large arrays in it I would like to find out a way that I can use this external SDRAM as my Data Memory(Heap memory).

First step I have found is to uncomment #define DATA_IN_ExtSDRAM from system_stm32f4xx.c file, apparently this is not enough and based on my research I have to change startup_stm32f429xx.S and STM32F429xI.ld(linker) I have found some code https://github.com/MaJerle/stm32f429/blob/master/14-STM32F429_SDRAM_VARIABLES/User/main.c that this is done in keil by setting up some configuration explained as :


To tell compiler, that we have external RAM memory, open "Options for Target" and in "Target" tab use IRAM2 value and type location where it starts and how big it is, in our case is set:

Start address: 0xD0000000

Length: 0x800000

My question is how can I achieve some like that using mbed cli ?

For example I would like that use something like this as described in the given link:

/* Create small array and force linker to put it to external RAM at location 0xD0001000 which is external RAM */
uint32_t SmallArray[10] __attribute__((at(0xD0001000)));

/* Create very big array, compiler will use external RAM because its size is too big for internal RAM on STM32F429 */
uint32_t BigArray[0x100000];
Be the first to answer this question.