Electronics > Microcontrollers

Custom STM32 bootloader guidance

<< < (7/7)

Georgy.Moshkin:
Bootloader rules I came up with during few years
1. write protected bootloader sector
2. readout protection is on
3. crc32 and retry mechanism
4. aes encrypted in software, easy to migrate
5. can enter to bootloader on reboot during 500ms window
6. a way to reboot without powering cycling
7. dma bridging between two usarts for flashing other MCU, e.g. esp8266
8. no swdio swdclk pins routed on final pcb

peter-h:

--- Quote ---dma bridging between two usarts for flashing other MCU, e.g. esp8266
--- End quote ---

That's an interesting option. The 32F4 boot loader can flash the flash directly from serial uart data; whether it uses dma I don't know but there is no need to because programming is quite slow.

I remember someone telling me that having two CPUs is the only provably non-brickable way. I guess it is true. One of them is just a boot loader and feeds the data to the main CPU, with its serial boot loader activated.

Georgy.Moshkin:

--- Quote from: peter-h on June 18, 2023, 09:19:39 pm ---
--- Quote ---dma bridging between two usarts for flashing other MCU, e.g. esp8266
--- End quote ---

That's an interesting option. The 32F4 boot loader can flash the flash directly from serial uart data; whether it uses dma I don't know but there is no need to because programming is quite slow.

I remember someone telling me that having two CPUs is the only provably non-brickable way. I guess it is true. One of them is just a boot loader and feeds the data to the main CPU, with its serial boot loader activated.

--- End quote ---

Yes, probably DMA is not so important for bridging.  I have commands for write protecting of first sector and for setting RDP level. Theoretically, write protected bootloader may be overwritten, but this never happened to me.
Two CPU way is interesting too, maybe cheaper is to use some flash IC with bootloader pre-flashed, and route with WE pin tied to "write disabled" voltage level. After it is soldered, write protection is always on.

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod