This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Jump to application from bootloader RA6M3 renesas controller Keil MDK 5.36 Arm 6.16

Hi,

we are trying to jump to Application from Bootloader

Application address is located at  0x10000

We are using Keil MDK 5.36 Arm 6.16 Compiler

we are using the below code to jump to application, Same is working with E2Studio(Renesas IDE), But this doesn't works with Keil 

void jumptoUserApp(uint32_t app_link_location)
{
    user_app_fnptr      *p_jump_to_app;             // Function pointer to the user application.

    p_jump_to_app = ((user_app_fnptr*)app_link_location);// + 1U; // Point to the start reset vector for the  application.
//    __disable_irq();                                // Disable interrupts

    /* Disable MSP monitoring  */
    R_MPU_SPMON->SP[0].CTL = 0;
    while(R_MPU_SPMON->SP[0].CTL != 0);

    R_MPU_SPMON->SP[1].CTL = 0;
    while(R_MPU_SPMON->SP[1].CTL != 0);


    SysTick->CTRL               = 0;                   /*Disable the systick timer */
    NVIC_DisableIRQ( SysTick_IRQn);                    /*Disable the systick timer IRQ */
    NVIC_ClearPendingIRQ(SysTick_IRQn);                /*Clear any pending systick timer IRQ */


    /*
   * Clear all interrupts!
   *
   */
    for(uint32_t i = 0; i<96; i++)
    {
       R_ICU->IELSR[i]= 0;
    }
    for(uint32_t i = 0; i<8; i++)
    {
       NVIC->ICER[i]= 0xFFFFFFFF;
       NVIC->ICPR[i]= 0xFFFFFFFF;
    }
    for(uint32_t i = 0; i<16; i++)
    {
       R_ICU->IRQCR[i]= 0;
    }

    __set_CONTROL(0);

    SCB->VTOR = (uint32_t)app_link_location;    // Update the vector table to the reset vector of the application.
    __DSB();                                        //Complete all explicit memory accesses.
    __set_MSP(*((uint32_t*)app_link_location)); //Set stack for the application
   
    (*p_jump_to_app)();                             //Jump to application
}

Parents Reply Children
No data