cancel
Showing results for 
Search instead for 
Did you mean: 

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

Samuel_FREAL
Associate

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

3 REPLIES 3

> 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

TDK
Guru

> 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

 

If you feel a post has answered your question, please click "Accept as Solution".

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..