2016-01-13 02:42 AM
Hi,
I have 2 applications. The first one I download to flash on adress 0x08000000. First application should copy second app from flash (adress 0x08040000) to RAM which start from 0x20010000.I'm using Keil 5.Configuration of first application is:IROM1: Start: 0x8000000, size: 0x20000IRAM1: Start: 0x20040000, size: 0x10000Configuration of second application is:IROM1: Start: 0x20010000, size: 0x30000IRAM1: Start: 0x20040000, size: 0x10000In second app I also uncomment line: #define VECT_TAB_SRAM The second application is copied to RAM OK, but it stops on its startup function.Do I need to repeat the configuration in both applications (for eg. HAL_Init() or SystemClock_Config() functions)?Have you some advice how to execute second app in RAM?Regards,Robert2016-01-13 03:00 AM
Hi Robert! Keil Ide is very complexcity ide, and whrn you build you project it INSERT a startup code where are some peripherals has initialized - NVIC, SYS_TICK,
FMC(if needed) and some other.. and then runs to main. So you can reinitialize this peripherals in different manner. Also watch to ini file that keil also can use as startup. for first aap i think you may not change this, but for the seconed - first thing you need - get deal you app with previous startup initialization. Also watch on the interrupt vector table - second app can make offset for it (always this file has named - startup.s). Sorry for my distinguish english. Best regards!2016-01-13 03:29 AM
Other than setting SCB->VTOR none of the code in SystemInit() needs to run again if you did it in your loader application.
Make sure you don't have interrupts (SysTick?) running as you hand over control.Suggest you step through the hand-over and into the app to understand where exactly it is jamming up.2016-01-13 06:49 AM
The problem was in size of RAM
The correct size is 0xC000.Thanks for help :)