2018-05-20 07:13 AM
Hi,
I want to execute my application code (binary file) from the SDRAM and not from internal flash.
I tried to begin with the example in the Cube FW package (FMC_SDRAM_MemRemap) but this example describes how to execute a function in sdram and not the whole code.
Could someone help me ? what should i modify to let the whole code (binary file .bin) executes from SDRAM ?
Thanks
Note that i'm using an STM32F756-Eval board
ELMHIRI.Syrine
‌##external-sdram #sdram-fmc #sdram2018-05-20 01:37 PM
Do you want to copy the code out of FLASH into SDRAM, or run in SDRAM directly from the debugger?
In the debugger case you'll need to make a debugger script, or initialization file, that stands up all the clocks, pins, controller and memory for your specific board/parts before the debugger can download and execute for there.
For an application you'd get the linker to build an image for the SDRAM address, and then make a small FLASH based loader to stand up the SDRAM, copy the image, and then transfer control to it.
2018-05-20 05:18 PM
<< In the debugger case you'll need to make a debugger script, or initialization file, that stands up all the clocks, pins, controller and memory for your specific board/parts before the debugger can download and execute for there. >>
I didn't understand you, sorry!
I thought I must change something in the linker file and in the startup file in order to run my code from SDRAM.
All i want is to execute the code from the SDRAN and not from FLASH.
what shoud i do ?
2018-05-20 05:20 PM
Could you detail the steps to do and what should I change/add please
2018-05-21 06:42 AM
Changing the linker settings is one issue.
How are you planning on getting the code into the SDRAM?
2018-05-23 03:56 AM
getting the code into the SDRAM isn't a problem. I can use ST-Link Utility to program the bin file into the SDRAM. or I can use the STM32Cube programmer.
The problem is what changes do I have to make i order to execute the code from SDRAM : tell the PC (program counter) to point to the instructions inside SDRAM : boot from SDRAM
2018-05-23 06:22 AM
Control transfer to code in SDRAM is no different from any other memory range.
External SDRAM comes in many forms, using different chips, pins, bus widths etc. The processor doesn't know what you have attached. You're not going to 'boot' into SDRAM. You need minimal code, or scripting, to configure the interface before the memory is accessible.
2018-05-23 07:18 AM
Turvey.Clive.002
has outlined the steps already.Please respect Clive's time, and try to see what you have been given.
You need minimal code <- You need to start from Flash and set up the SDRAM configuration.
Inform the linker that your 'Payload code' starts within the SDRAM.
Transfer your payload from the source to the SDRAM at the specific address, execute.
( executing from Flash is faster code, the internal memory flash fetch is much wider than 32bits.)
Please review Clive's verbose answers above.