cancel
Showing results for 
Search instead for 
Did you mean: 

External SDRAM on DISCO-F429ZI as Data Memory Witn Mbed

Nima Aghli
Associate
Posted on April 16, 2018 at 00:40

Hello Everybody,

I am using DISCO-F429ZI board that has external SDRAM on it with mbed-cli 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 &sharpdefine 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 tried

every

advice in this forum and others to change ld file and also dont know what to change is startup file, but it still doesn't work.

Things that I know about my SDRAM :

Start address: 0xD0000000

Length: 0x800000

I would really appreciate if someone can tell me what exactly I have to change in these 2 files to be able to to use

malloc

for larger variable definitions. This is piece of code in main.cpp that I want to store in SDRAM instead of internal

SRAM!

   

void

*

data

;

   

data

=

(

void

*)

malloc

(

190400

);

   

if

(

data

==

NULL

){

     

pc

.

printf

(

'Error:

ran

out

of

memory

'

);

   

}

which current I get 'ran out of memory'

I have seen codes like this to use in main.cpp to define them in SDRAM but I know I need to prepare things before!

/* 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

];

I have also attached 2 files.

Thanks for your helps

##external-sdram #disco-f429zi
1 REPLY 1
Nima Aghli
Associate
Posted on April 16, 2018 at 00:41

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6mY&d=%2Fa%2F0X0000000bvL%2FElmyj7alf7Hp78o78yurTBPyBrfXCvqn88ExpUgphOo&asPdf=false