The robot can be soft-bricked by breaking the USB connection during firmware upload. The firmware then has to be uploaded using an SWD programmer.
Let's split the firmware into 2 parts:
The first part is stored in the first page(s) of the flash. It initializes the UART and calls the main appplication. It contains the UART RX IRQ handler and the DFU jump function.
The second part contains the appplication. During normal use only this part is overwritten.
If the second part is corrupted, the UART RX handler still works, so we can jump to DFU mode.
The robot can be soft-bricked by breaking the USB connection during firmware upload. The firmware then has to be uploaded using an SWD programmer.
Let's split the firmware into 2 parts:
If the second part is corrupted, the UART RX handler still works, so we can jump to DFU mode.