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

Bootloader RTX jump RTX app

Hello !

I am working on bootloader application using RTX on mdk 5.

The bootloader load the user application using Ethernet communication and proceed to the jump after a reset.

When i use an simple blinky example and modify the BCA, the jump WORKS WELL !

BUT If I use an RTX application, the jump don't works.

I used the bootloader's vendor (without RTX) the jump to my RTX application works..

I suspect that RTX application erased some thing at initialization

Some one already seen that before

Board used : FRDM K64F

IDE : mdk 5

Parents
  • I try this piece of code, but I always can't jump..

    Here is my code :

    __asm void boot_jump( uint32_t address )
    {
    LDR SP, [R0]
    LDR PC, [R0, #4]
    }

    void execute_user_code(void)
    {
    /* Change the Vector Table to the USER_FLASH_START
    in case the user application uses interrupts */

    //__disable_irq();

    SysTick->CTRL &= ~0x00000002;

    SCB->VTOR = (uint32_t)USER_FLASH_START;

    boot_jump(USER_FLASH_START);

    }

    /*----------------------------------------------------------------------------
    Main Thread 'main': Run Network
    *---------------------------------------------------------------------------*/
    int main (void)
    {

    if(Flash_ReadFW()==0)
    {
    execute_user_code();
    }

    osKernelInitialize (); // initialize RTOS kernel

    hardware_init();
    LED_Initialize ();
    Buttons_Initialize ();
    debug_printf("\r\n\r\nBootloader by - GB\r\n"); // ne pas oublier de cocher MicroLIB dans les options du projet !!!

    osThreadNew(blinky_Thread, NULL, NULL); // Create application main thread
    osThreadNew(LAN_Thread, NULL, NULL); // Create application main thread


    osKernelStart (); // start kernel with job2 execution
    while(1);
    }

    bootloader RTX is placed at 0x0 

    User RTX APP is placed at 0x00080000 => don't jump

    Blinky LED placed at 0x00080000 too => jump

    I need some help 

Reply
  • I try this piece of code, but I always can't jump..

    Here is my code :

    __asm void boot_jump( uint32_t address )
    {
    LDR SP, [R0]
    LDR PC, [R0, #4]
    }

    void execute_user_code(void)
    {
    /* Change the Vector Table to the USER_FLASH_START
    in case the user application uses interrupts */

    //__disable_irq();

    SysTick->CTRL &= ~0x00000002;

    SCB->VTOR = (uint32_t)USER_FLASH_START;

    boot_jump(USER_FLASH_START);

    }

    /*----------------------------------------------------------------------------
    Main Thread 'main': Run Network
    *---------------------------------------------------------------------------*/
    int main (void)
    {

    if(Flash_ReadFW()==0)
    {
    execute_user_code();
    }

    osKernelInitialize (); // initialize RTOS kernel

    hardware_init();
    LED_Initialize ();
    Buttons_Initialize ();
    debug_printf("\r\n\r\nBootloader by - GB\r\n"); // ne pas oublier de cocher MicroLIB dans les options du projet !!!

    osThreadNew(blinky_Thread, NULL, NULL); // Create application main thread
    osThreadNew(LAN_Thread, NULL, NULL); // Create application main thread


    osKernelStart (); // start kernel with job2 execution
    while(1);
    }

    bootloader RTX is placed at 0x0 

    User RTX APP is placed at 0x00080000 => don't jump

    Blinky LED placed at 0x00080000 too => jump

    I need some help 

Children