2024-01-09 08:13 AM
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
2024-01-09 08:32 AM - edited 2024-01-09 08:33 AM
> 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
2024-01-09 08:41 AM
> 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:
2024-01-09 10:31 AM
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