AnsweredAssumed Answered

link Bootloader to application starts

Question asked by kaka on Jun 17, 2015
Latest reply on Jun 23, 2015 by Clive One
hej ,
i would like to know that, how to link JumpToApplication() to my original code starts?..
can anyone guide me about this?

i have written the code like the below in GCC linker file. 
GCC Linker file:
--------------------------------------------------------
MEMORY
{
     BOOT (rx) : ORIGIN = 0x08000000, LENGTH = 0x0000C000
     rom (rx)  : ORIGIN = 0x0800C000, LENGTH = 0x000F4000
     ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000
     ram1 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x00010000
}


_eram = 0x20000000 + 0x00020000;
SECTIONS
{
     .boot :
    {
        KEEP(*(.isr_vector))
        startup_stm32f4??.o(.text)
    } >BOOT

-----------------------------------------------------------

In the main, i have written like the below 
int main(void)
{
     typedef void (*pFunction)(void);
     pFunction JumpToApplication;
     RCC_DeInit();
     SysTick->CTRL = 0;
     SysTick->LOAD = 0;
     SysTick->VAL = 0;
     __set_PRIMASK(1);   // Disable interrupts  // in the core_cmFunc.h
     __set_MSP(*(__IO uint32_t*) APPLICATION_ADDR);     // in the core_cmFunc.h
     jumpAddress = *(__IO uint32_t*) (APPLICATION_ADDR);
     JumpToApplication = (pFunction) jumpAddress;
     JumpToApplication();
}
-------

thank you 


Outcomes