STM32F042 Bootloader Activation
Hy,
I am planning a system where 2 STM32F042 UFQFPN28 devices serve as CAN Controller and are controlled by one master CPU. PCB Space and CPU pins are short. I need to guarantee a fail safe FW update for the two STM32 MCUs.
I plan to wire the system as follows:

My host CPU can switch pin functions between SPI MOSI / USART TX and SPI MISO / USART RX. So in application mode I do SPI communication with two separate SS lines, in bootloader mode, I will hold one STM in reset and communicate with the other over UART in bootloader mode.
How can I activate bootloader mode?
This device has empty check mechanism, so on first boot it activate bootloader automatically?
And to trigger a firmware update in field, I need to erase 4 byte of User Flash from application and perform a reset to enter bootloader mode?

To stay fail safe, I assume I write the first 4 bytes of User Flash (address 0x0800 0000) at the very end of bootloader action, right?
My device will be pluggable. And I do not know the CAN bus state during plug in. How can I prevent to boot device in bootloader mode when CAN RX (PB8-BOOT) is high accidentally on reset? Will it leave bootloader automatically when no USART communication is performed in a given time?
Does that sound doable to you?
Regards
Harald
