Skip to main content
Visitor II
January 9, 2024
Question

[Reprogramming MCU during runtime with UART from a software trigger]

  • January 9, 2024
  • 3 replies
  • 1347 views

Hello,

I would like to reprogram an ST MCU (STM32F0/C0/G0/L0) during runtime with UART and from a software trigger.

According to the AN2606, a boot pin is mandatory so that after reset, the bootloader can read the state of the boot pin and jump to the actual firmware or start to download a new firmware.

Is there a possibility for the trigger to be software (like something written in RAM that is read after reset) instead of using an hardware trigger with the boot pin ?

Thank you for your response

    This topic has been closed for replies.

    3 replies

    Super User
    January 9, 2024

    > According to the AN2606, a boot pin is mandatory

    It's not the case for most modern STM32.

    Many STM32 support entering boot mode by setting particular bits in option bytes; some support entering it when FLASH is empty. Another option is to jump to bootloader from the user code. AN2606 details the bootloader entry modes, it depends on particular STM32 (sub)family.

    JW

    Super User
    January 9, 2024

    > Is there a possibility for the trigger to be software (like something written in RAM that is read after reset) instead of using an hardware trigger with the boot pin ?

    You can jump to the bootloader directly within your code based on whatever trigger you want. See here for example:

    https://community.st.com/t5/stm32-mcus/how-to-jump-to-system-bootloader-from-application-code-on-stm32/ta-p/49424

     

    Graduate II
    January 9, 2024

    For end-user IAP there might be significantly clearer/simpler approaches to updating application code in FLASH.

    The ISP method of the System Loader does work, but might be better for disaster recovery.

    The control transfer methods of the MCU are pretty straight forward. You can jump/branch from assembler, or use function-pointers in C. The vector table contains a list of addresses