2014-09-02 02:13 PM
Hi:
I am using STM3221G-EVAL board. The board has a couple of switches to select the Boot source.
Boot related jumpers
BOOT 0 BOOT 1 Boot source
0 1 or 0 STM3221G-EVAL boots from
User Flash
(Default setting)
1 1 STM3221G-EVAL boots from
Embedded SRAM
1 0 STM3221G-EVAL boots from
System Memory
I would like to place the code in SRAM instead of User Flash. I am using the Demonstration Builder example firmware provided by ST and using IAR tool chain.
I have been changing parameters on the Linker and in some of the firmware header files, to avoid the errors, but the firmware doesn't work.What are the normal guidelines to do this?Thanks, #run-code-from-sram2014-09-02 04:15 PM
In Keil you use a debugger initialization script, to set up the hardware, and external buses as required, and load the firmware directly into RAM. This replaces the usual flash algorithm that downloads to flash. You also obviously have to build your code to reside in SRAM at 0x20000000, and move and shrink the usual RAM allocation depending on how large the code is.
ie IROM at 0x20000000 [0x10000] IRAM at 0x20010000 [0x10000] IAR likely has similar debug and linker scripting (.icf), review your manuals and support materials. The vector table (SCB->VTOR) is typically reconfigured in system-stm32f2xx.c2014-09-03 11:04 AM
I think the problem is the fact that the Demonstration firmware is too big to fit in the internal SRAM. I just try another code (much smaller) and ran it fine out of the internal SRAM.
However, the STM3221G-EVAL board has a 16 Mbit SRAM connected to FSMC bus of the STM32F217IGH6.Is there anyway to put the code in the external SRAM chip and run it from there?Thanks,2014-09-03 12:15 PM
Like I said, in Keil you have this debugger script thing, in it you enumerate all the pokes (addresses, values) that you would normally do in ExternalMemInit() (or whatever) to walk the processor through the initialization of your clocks, pins and external memory bus interface. THEN the debugger can load your code into that memory.
I'm pretty sure IAR has a near identical scheme, I would perhaps look for examples of ARM9 boards, or others within the install, that primarily have external memory, say an ATMEL AT91SAM9260, and have a ''Run from SDRAM'' build target.2017-12-28 10:56 PM
I have also same problem and question.
I would like to place the code in
SRAMinstead of User Flash. Did you resolve this problem?2017-12-29 09:34 AM
Both IROM and IRAM would need to be set to non-overlapping RAM addresses for the Linker to build a suitably based image.
On the F1 you'd need a small hack at the end of the vector table, as illustrated in the GNU/GCC start up file examples.