This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C129EKCPDT: How to jump to application address from bootloader

Part Number: TM4C129EKCPDT

Hi

I put bootloader in flash 0x0~0x10000, application in  0x10000~0x7FFFF.

Could you let me know how to jump to 0x10000 after finish downloading the firmware? Is there a jump example? 

I write below code but it doesn't jump to the application address. Thanks.

#define ApplicationAddress   0x10000

void Jump2App(void)

{

         // turn off SysTick and its interrupt before entering

         ROM_SysTickIntDisable();

         ROM_SysTickDisable();

         // Disable all processor interrupts.

         HWREG(NVIC_DIS0) = 0xffffffff;

         HWREG(NVIC_DIS1) = 0xffffffff;

         HWREG(NVIC_DIS2) = 0xffffffff;

         HWREG(NVIC_DIS3) = 0xffffffff;

         HWREG(NVIC_DIS4) = 0xffffffff;

         (*((void (*)(void))(*(uint32_t *)ApplicationAddress)))();

}

  • Hi Daniel,

      Have you tried out the various bootloader examples that come with the TivaWare library? Please check out the bl_startup_ccs.s startup file in the bootloader example. Below is a snippet of the code.

        ;;
        ;; Load the stack pointer from the application's vector table.
        ;;
     .if (APP_START_ADDRESS != VTABLE_START_ADDRESS)
        movw    r0, #(APP_START_ADDRESS & 0xffff)
     .if (APP_START_ADDRESS > 0xffff)
        movt    r0, #(APP_START_ADDRESS >> 16)
     .endif
     .endif
        ldr     sp, [r0]
    
        ;;
        ;; Load the initial PC from the application's vector table and branch to
        ;; the application's entry point.
        ;;
        ldr     r0, [r0, #4]
        bx      r0
        .endasmfunc