Skip to main content
Visitor II
February 5, 2021
Question

How to Jump to system bootloader from user application without BOOT0 pin in STM32H743BIT6

  • February 5, 2021
  • 4 replies
  • 1607 views

I know jump to system bootloader using BOOT0 Pin, but my requirement is to jump from user application.

I successfully jump to system bootloader from user application in STM32L100RC, but its not happening in STM32H743BIT6.

Please support if any know how to Jump to system bootloader in STM32H743.

    This topic has been closed for replies.

    4 replies

    Graduate II
    February 5, 2021

    As explained often here, have code very early in your startup that checks for a magic patters in some RAM memory. If you find that magic, erase it and jump to bootloader. To get from user code to bootloader, set that magic and trigger a reset.

    AMull.11Author
    Visitor II
    February 5, 2021

    Dear Uwe Bonnes, Thank you for your response

    Can you please explain me exactly how to do this or you can share me the link to understand about this.

    Thank you

    AMull.11Author
    Visitor II
    February 5, 2021

    void L100RCSystemBootloaderJump(void)

    {

    typedef void (*pFunction)(void);

    pFunction JumpToSystemBoot;

    uint32_t JumpAddress = 0x1FF00000;

    HAL_RCC_DeInit();

    SysTick->CTRL = 0;

    SysTick->LOAD = 0;

    SysTick->VAL = 0;

    __disable_irq();

    __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();

    JumpToSystemBoot= (void (*)(void)) (*((uint32_t *)(JumpAddress + 4)));

    __set_MSP(*(__IO uint32_t*) JumpAddress );

    JumpToSystemBoot();

    while(1);

    }

    void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)

    {

    if(GPIO_Pin == PushButton_Pin)

    {

    L100RCSystemBootloaderJump();

    }

    }

    int main()

    {

    /*Other Application*/

    while(1)

    {

    /*Other Application*/

    }

    return 0;

    }

    This is what i exactly did for STM32L100RC.

    For STM32H743 i am getting error for __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH.

    Please explain me how to Jump system bootloader from user application.

    Visitor II
    February 15, 2021

    same problem to: __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH(); seems not to be implemented in STM32Cube_FW_H7_V1.8.0.

    I found an article adressing the same question (https://community.st.com/s/article/STM32H7-bootloader-jump-from-application?t=1613404786300),

    but here the address was 0x1FF09800. Anyway, for both addresses, my cpu gets an exception and stucks...

    AMull.11Author
    Visitor II
    February 17, 2021

    Yes there in no mapping in STM32H7

    You can try below code which is working for me

    void JumpToSystemBootLoader (void)

    {

      void (*JumpToSysBoot)(void); /* declare a function pointer */

    __IO uint32_t sys_boot_address = 0; 

    uint8_t indx = 0;

    sys_boot_address = 0x1FF09800;/* STM32H7 system BootLoader address */

    /* Disable all enabled interrupts in NVIC and Clear all pending interrupt requests in NVIC */

    for (indx = 0; indx < 8; indx++)

      {

    NVIC->ICER[indx] = 0xFFFFFFFF;

        NVIC->ICPR[indx] = 0xFFFFFFFF;

    /* Disable all enabled peripherals, use HSI clock */

      HAL_RCC_DeInit();

    /* Disable all interrupts */

      __set_PRIMASK(1); 

    /* Disable SysTick */

    SysTick->CTRL = 0;

     SysTick->LOAD = 0;

     SysTick->VAL = 0;

    /* Enable all interrupts */

    __set_PRIMASK(0);

    JumpToSysBoot = (void (*)(void)) (*((uint32_t *) (sys_boot_address + 4)));

    /* Activate the MSP */

     __set_MSP(*(uint32_t *)sys_boot_address);

    __set_CONTROL(0);

    /* Jump to the system BootLoader */

     JumpToSysBoot(); 

    /* It will not execute if jump is successful*/

      while (1)

    {

     __NOP();

    }

    }