2018-06-10 05:28 AM
Hello.,.,
I am using STM32H743 MCU in our application. Here I have a reuirement to run the program in RAM during debug session, I am using Keil 5 IDE. Presently the is flashing to MCU flash during debug also.
Can anybody help how to make setup in keil IDE to run code in RAM during debugging time.
Thank you .,
#keil-mdk5 #stm32h7Solved! Go to Solution.
2018-06-10 06:15 AM
1) Configure the Target settings to build code for RAM
2) Disable 'Load Application at Startup'
3) Use 'Initialization File' to drive download/execution
Assuming an 0x20000000 SRAM address (Dbg_RAM.ini)
FUNC void Setup (void) {
SP = _RDWORD(0x20000000); // Setup Stack Pointer PC = _RDWORD(0x20000004); // Setup Program Counter _WDWORD(0xE000ED08, 0x20000000); // Setup Vector Table Offset Register}LOAD %L INCREMENTAL // load the application
Setup(); // Setup for Running
g, main
For external memory you'll need to add setup code to stand up the clocks, peripheral, pins and memory
2018-06-10 06:15 AM
1) Configure the Target settings to build code for RAM
2) Disable 'Load Application at Startup'
3) Use 'Initialization File' to drive download/execution
Assuming an 0x20000000 SRAM address (Dbg_RAM.ini)
FUNC void Setup (void) {
SP = _RDWORD(0x20000000); // Setup Stack Pointer PC = _RDWORD(0x20000004); // Setup Program Counter _WDWORD(0xE000ED08, 0x20000000); // Setup Vector Table Offset Register}LOAD %L INCREMENTAL // load the application
Setup(); // Setup for Running
g, main
For external memory you'll need to add setup code to stand up the clocks, peripheral, pins and memory
2018-06-10 06:40 AM
https://community.st.com/0D50X00009bMM79SAG
Although I have never tested it on H7.
2018-06-10 08:59 AM
>>Although I have never tested it on H7
The process should be the same, the addresses might change.
I'm sure this is ALL documented, and the mechanics are not particularly complicated. You have to walk the debugger through the steps you would normally do in software for external memory set up, which is usually board/chip specific.
Certain SRAM on the H7 will likely require clocks to be enabled.
2018-06-10 09:34 AM
F7/H7 area scares me;) Had STM32F746-DISCO, played with the graphic and switched to Raspberry PI - like boards. I prefer simpler boards in ARM area.
I believe PC-like apps (complex graphic, Ethernet connectivity, flash storage) run better on PC-like boards...
2018-06-11 04:00 AM
If you have a section of initialized variables that are changed during runtime, special considerations are needed for a program in RAM to keep the initialisation values over reset. Normally, after reset the values would have the value set during runtime. So you must handle initialized, but variable datea in the reset routine and load them to from a save area.