AnsweredAssumed Answered

STM32F4 Keil V5 & RTX & Custom Bootloader

Question asked by duarte.andre on Aug 18, 2014
Latest reply on Sep 26, 2014 by bruno.celdran
Hi all,

After some battle i was able to set a jump from my custom Bootloader to the App using in Keil V5.

Custom Bootloader resides in      IROM 0x08000000
App resides in                     IROM 0x08020000

Need to set both mem addr in the Keil projects settings target and link.

Now the tricky bit is that Keil uses a block of mem @ the beginning of the specified mem addr to do some work. In the Bootloader app under debug in the Reset_Handler the __main pointer loaded to R0 will be not 0x08000000 but 0x080001AD instead of the expected 0x08000000.

So the BTL jump routine is:

      JumpAddress = 0x080201AD;                                        // App addr offset + "Keil offset"                              
      Jump_To_Application = (pFunction) JumpAddress;
      NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x20000);          // App addr offset
      __set_MSP(*(__IO uint32_t*) 0x08020000);                         // Initialize user application's Stack Pointer
      Jump_To_Application();

Even changing considerably the BTL app the Keil offset still is 0x1AD, so i assume its static.
Im using the same clock and app settings in the BTL & in the App so i dont need to reconfigure anything in the App startup, so basically there is no "startup sequence" in the App.
Im using the RTX in the App, but not in the BTL, if i enable the RTX in the BTL, the jump fails.

If someone know more about this subjects, please post...

-> Exactly why Keil has this "const" addr offset ? Initiliazation of ZI-data ?
-> If you were able to perform a BTL jump with the RTX enable, please tell us how ...
-> Easier way ... Always good to know...

Thanks,
AD

Outcomes