Hi
I'm working with the TLE9879 evalkit and ARM Keil uVision5. I'm trying to load and run my entire application from RAM, but I'm unsure about the setup process.
Could anyone share some guidance or steps on how to configure ARM Keil uVision5 for loading and executing applications in RAM on the TLE9879 evalkit? Any insights or examples would be a big help.
Mario
This is possible, but I think it only makes sense in very rare cases. Could you please explain?
Please remember, that this device has only 5 kB RAM and 128 kB Flash. An application usually needs a stack, has global variables, and has executable code. I doubt that you want to squeeze all this into 5K?
Sometimes it is necessary to execute code from RAM for example for in-system Flash programming. In this case, you would relocate only dedicated functions into RAM. There are devices on the market that have a big (on- or off-chip) RAM, but a slow external (maybe SPI) Flash connected. In this case, it can make sense to copy the complete application into RAM to execute it from there with max. speed. In this case, the application would always execute from RAM, even when you are not debugging.
What is your motivation to do this? Executing the code from Flash will probably be faster than from RAM, so what would be the benefit?
Hi,
Yes, you are correct. I indeed intend to perform in-system flash programming. I have already attempted to modify the .sct files to relocate the code to RAM, and it works. However, when I use the "Download" command (F8) to load the code onto the MCU, I encounter the following error:
Device: TLE9879QXA40 VTarget = 3.300V State of Pins: TCK: 0, TDI: 0, TDO: 0, TMS: 0, TRES: 8, TRST: 1 Hardware-Breakpoints: 2 Software-Breakpoints: 8192 Watchpoints: 1 JTAG speed: 3000 kHz
Erase Failed! Error: Flash Download failed - "Cortex-M3" Flash Load finished at 09:35:31 "
Do you have any insights into what might be causing this issue?
Thank you for your assistance.
; ************************************************************* ; *** Scatter-Loading Description File generated by uVision *** ; ************************************************************* LR_IROM1 0x18000080 0x00000C00 { ; load region size_region ER_IROM1 0x18000080 0x00000C00 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) .ANY (+XO) }- RW_RAM1 0x18000C80 0x00000010 { ; RW data .ANY (+RW +ZI) } RW_RAM2 0x18000C90 0x00000020 { .ANY (+RW +ZI) } RW_RAM3 0x18000CB0 0x00000250 { branchfunc.o (+RO +ZI +RW) .ANY (+RW +ZI) } } LR_IROM2 0x18001F00 0x00000100 { ER_IROM2 0x18001F00 0x00000100 { ; load address = execution address .ANY (+RO) } }
If you want to run the entire application in RAM, then you must not do a (Flash) download. Instead, you need a special project configuration, for which you can study existing example projects. One is the "CMSIS-RTOS Blinky (MCBSTM32E)", that you can access via the PackInstaller example tab. This project has a target called "STM32F103 RAM". Please see, how this project is configured, especially also the Debug_RAM.ini. In there the application is loaded to RAM and the PC and SP are set accordingly. I hope this helps.