Here, this is a bootloader designed from scratch for STM32F407 out of hobby. Though it is designed for ST, it can be used with any ARM Cortex M4 based controllers with minimal changes.
How are we getting updates for embedded software remotely and how are we able to flash or configure any controller from anywhere!!! This is studied here and ended up with this bootloader that can be controlled remotely over piconet.
This custom bootloader is placed at sector 0, i .e at starting address of flash. If the predefined input is not received within a specific time, bootloader will call user application which resides at sector 2 of flash. This is the normal mode of operation . Once the system receives user input to latch on bootloader mode it will wait for further command. Since my bluetooth module is compatible with UART communication, I preferred UART communication for my bootloader. As per the user input, bootloader is featured with the following opertion,
- Programming the flash
- Erasing the flash
- Jumping to Memory locations
- CRC Check
- Enabling sector protection
- Disabling protection
- Memory Read etc.
Lot of new things came to my attention during this project including ST's native bootloader, option bits of ST etc.. It was an interesting learning time! Next phase I may update this to communicate over internet.
The complete work is available in the following Github repository:
https://github.com/nidhinboom/Bootloader.git