Skip to main content
Visitor II
July 9, 2025
Question

bootloader cannot boot app

  • July 9, 2025
  • 4 replies
  • 1199 views

1.i flash the app in flash address 0x08010000 

2.and flash the bootloader in flash address 0x0800000

3. use bootloader jump 0x08010000, but i can not found the app run(because led cannot Flicker)

please see my project bootloader and app,how i can let it run normal ????

    This topic has been closed for replies.

    4 replies

    Graduate II
    July 9, 2025

    If your bootloader is not jumping to the application code, make sure you're following these steps correctly:

     

    1. Read the application’s reset handler address:

    uint32_t JumpAddress = *(__IO uint32_t*)(APPLICATION_ADDRESS + 4);

    2. Assign the jump address to a function pointer:

    pFunction Jump_To_Application = (pFunction)JumpAddress;

    3. Deinitialize all peripherals and HAL modules used by the bootloader:

    HAL_DeInit();
    HAL_RCC_DeInit();
    SysTick->CTRL = 0;
    SysTick->LOAD = 0;
    SysTick->VAL = 0;

    4. Set the vector table offset to the application start address:

    SCB->VTOR = APPLICATION_ADDRESS;

     

    5. Set the MSP (Main Stack Pointer) from the application’s vector table:

    __set_MSP(*(__IO uint32_t*)APPLICATION_ADDRESS);

    6. Call the application’s reset handler:

    Jump_To_Application();

     

     

    :warning: Before Jumping: Validate Application Presence

    Make sure a valid stack pointer exists at the application base address. You can check like this:

    if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0xFF000000U) == 0x20000000U || // SRAM
     ((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0xFF000000U) == 0x10000000U) // CCM RAM (if used)
    {
     // Valid application – safe to jump
    }
    else
    {
     // Invalid memory content – do not jump
    }

    :light_bulb: Tip: Ensure your application binary is correctly linked to the base address (APPLICATION_ADDRESS) and that it starts with a valid vector table (stack pointer and reset handler). Misconfigured linker scripts or missing vector tables are common causes for failed jumps.

    jack_wangAuthor
    Visitor II
    July 9, 2025

    @jumman_JHINGA 

    i modify bootloader main.c and test, the problem become the led on but not Flicker, why Flicker????

    Graduate II
    July 9, 2025

    have you flashed your application code at Sector (0x8010000)?

    jack_wangAuthor
    Visitor II
    July 9, 2025

    @jumman_JHINGA yes i flash the application,you can see the test video and use my project to test!!!,it still not work?????

     

    Graduate II
    July 9, 2025

    In the User Appilcation we must take care these things:
    1. In the system_stm32fNxx.c file search for VECT_TAB_OFFSET and we have to change it with the offset of our user application address.
    For example, if flash base address is 0x08000000UL (also address for bootloader) and we want to start the application code from 0x08018000 then I will just add Vector Table offset to 0x00018000.

    #define VECT_TAB_OFFSET 0x00018000U 

    2. Now we have to change __ICFEDIT_intvec_start__ & __ICFEDIT_region_ROM_start__ macros address in the stm32f746xx_flash.icf linker script file present in EWARM folder. And these address will be our User Application address.

    define symbol __ICFEDIT_intvec_start__ = 0x08018000;
    define symbol __ICFEDIT_region_ROM_start__ = 0x08018000;

    for MDK-ARM:

    md4.PNG

     if your not missing any of this method then definatly it should have to work.

     

     

    Visitor II
    July 9, 2025

    I had the same problem and couldn’t figure it out. So I decided to test the ST Open Bootloader. However, I had a hard time finding a downloadable version.

    First, I tried to find an IDE project for the STM32H7 series, but had no luck. Next, I tried using this repository, but it failed due to a missing file: app_openbootloader.h

     

    I'm not sure how I should approach this problem. Any suggestions?

    Graduate II
    July 10, 2025

    Sorry i cant check you code, I have other works to do.

    At your application code ... make that LED pulled down .... if it is getting turned on.... so we could get clearity that bootloader code is able to jump to application code properly .... but application code is getting hanged... 

    Graduate II
    July 10, 2025

    i gon through with your Bootloader code.. 

    Problem: jump_to_app() is called in an infinite loop

    Your code:

    while (1)
    {
     extern void start_app(unsigned int vector);
     // start_app(0x8010000);
     jump_to_app();
    }

     What's happening:

    • You're jumping to the application inside a while(1) loop.

    • The application starts, but once it returns (or crashes), the bootloader jumps again — this creates undefined behavior.

    If the application LED turns on during HAL_GPIO_WritePin(...) (and then stalls due to vector table or clock misconfig), it will appear "stuck on" — exactly what you're observing.

     Suggested bootloader main():

     

    int main(void)
    {
     HAL_Init();
     SystemClock_Config();
     MX_GPIO_Init();
    
     // Check if valid user app exists
     if (((*(__IO uint32_t *)APP_FLASH_ADDR) & 0x2FFE0000) == 0x20000000)
     {
     jump_to_app(); // call once
     }
    
     // If app not found, stay in bootloader
     while (1)
     {
     HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_13); // Example: show bootloader alive
     HAL_Delay(500);
     }
    }

     

    Visitor II
    July 10, 2025

    But in that way, you can write firmware only once. Do you mean that there should be for example some UART routines before which can receive new firmware or some if case, button held down during startup....