A bootloader for STM32F407VG MCU. It's based on STM32CubeHAL.
- Flash, erase for a sector or an image (multiple sectors) and jump to the app.
- It supports four images with their headers. The images are with diffrerent sizes.
- CRC32 check for the programming records and for the entire image.
- It supports UART communication.
- Flasher python script.
- The content of the image is independent position code (IPC) while the image header must be at the start of the image.
- STM32CubeHAL is shared between the bootloader and the images.
- Address: The least significant 16-bit of the address of the location of programming.
- Type: The action to be performed (erase, flash, reset, etc.)
- data (optional): the data for the specified action (flashing data, image number, etc.). Its maximum number of bytes is 16 in case of flashing.
- CRC32: CRC32 computed for the entire PDU.
- You should have GNU Make and GNU Arm Embedded Toolchain
cd
to the repository directory and runmake
, you should have the build folder containing the binaries.- Flash the image using any STM32 MCU flashers (OpenOCD, STM32Cube programmer, etc.).
- Include an image header in your application at the start of the image using linker script (you can use the one in the apps folder).
- Fill the image header CRC32 of the entire image which can be calculated from the .hex file using the CRC calculator in apps folder. e.g.:
python app.py output.hex
- Use the flasher script to:
- Erase the image. e.g.
python flasher.py COM8 -a1 -i0
- Flash the image.
python flasher.py COM8 -f output.hex -a0 -i0
- Choose the active image.
python flasher.py COM8 -a5 -i0
- Reset MCU to let the active image work.
python flasher.py COM8 -a4
- To know how to use the flasher script run:
python flasher.py -h
- Erase the image. e.g.
- Backup SRAM is used as an EEPROM emulation. It means, it will act as an EEPROM as long as there's power on VBAT pin. For more information, visit this EEPROM emulation in STM32F2xx microcontrollers PDF.
- CAN communication.
- Transport layer ISO-TP (ISO 15765-2)
- Delta file
- Embedded Boot-Loader Design Course YouTube playlist
- Flash Memory and Bootloaders YouTube playlist