AnsweredAssumed Answered

How to Preform an Application Jump in Internal Flash Memory of RT 1064

Question asked by Matt Thimsen on Aug 13, 2019
Latest reply on Aug 17, 2019 by Takashi Kashiwagi


I need to preform an application jump from a bootloader application to another application (an LED blink example) somewhere else in the internal flash memory. Both applications are executing in place in internal flash memory. 


Eventually the application will be programmed to the internal flash via the ROM api as a part of the bootloader. For the sake of simplicity this is being done using the MCUXpresso 11.0 GUI Flash tool. 


The bin file of the iled_blinky example is being placed at address location 0x70200000 as follows:

The bootloader application is the uploaded using the same method at address 0x70000000, and the board is reset. 

The flash memory is erased between attempts.


I am attempting to skip any IVT by jumping to the application entry point of the iled project, which is the ResetISR function. The .map file shows it at address 0x70002308. I am assuming that by giving the GUI flash tool the base address of 0x70200000, this then becomes  0x70202308. Is that correct?


The code am using to preform the jump is as follows:


__attribute__((always_inline)) static inline void JumpApplication(uint32_t topOfMainStack, uint32_t AppliAddr){
   asm volatile ("mov r13, %0" : : "r" (topOfMainStack) : );
   asm volatile ("mov r15, %0" : : "r" (AppliAddr) : );




JumpApplication(*(uint32_t*)0x70202304, *(uint32_t*)0x70202308);


Attempting the jump just results in a hardfault.


Both projects are attached.


There are multiple threads on this issue but most of them are inconclusive. If we can figure this one out I will upload both projects so they can be used as examples.