>> The UART Bootloader updates the software of STM32F103 through UART.
>> We used the host application to transmit the hex file via UART.
>> The project comprises the Host App, Bootloader, and a Blinking Example App.
Stm32f103
USB To TTL Module
Host Machine
- This C code sends the Hex File record by record through the serial port.
- Sending the next record is not permitted until an OK message is received from the target.
- gcc
- make
- Clone the repo
$ git clone https://github.com/GomaaMohamed/UART_Bootloader.git
- Modify the path of the project home in the host app's makefile.
- Navigate to the host_app folder in the terminal and compile the application to generate the executable.
$ make all
"An executable named "burner" will be generated in binary format"
- Modify the permissions of the serial port that will be utilized.
$ sudo chmod 777 /dev/ttyUSB0
- Transmit the Hex File
$ ./burner ./app.hex /dev/ttyUSB0
- This is the bootloader that will be used to receive and burn the Hex File
sent from the host app.
- It is not permissible to receive a Hex record before analyzing and burning the previous one.
- The bootloader comprises the MCAL layer that includes the drivers of the MCU, and an APP layer
that contains the software components of the application.
- The Interface Module receives the Hex File record by record and sends it to the Parser Module.
- The Parser Module analyzes the Hex record, performs checksum, converts the Hex record from
ASCII to Hex,sets endianess, and sends the binary instructions to the Burner Module.
- The Burner Module burns and verifies the binary instructions in the internal flash.
- arm-none-eabi-gcc
- make
- st-flash
- gdb-multiarch
- openocd
- Clone the repo
$ git clone https://github.com/GomaaMohamed/UART_Bootloader.git
- Modify the path of the project home in the bootloader's makefile.
- Set the memory boundaries in the linker.ld file.
- Navigate to the bootloader folder in the terminal and compile the application to generate the executable.
$ make all
"This will create a binary executable named app.hex, which is the bootloader executable."
- burn the bootloader
$ make flash
- To build the Project
$ make all
- To clean the Project
$ make clean
- To erase the Flash
$ make erase
- To burn the Project
$ make flash
- To debug the Project
$ ./openport
"This bash script will launch OpenOCD to establish a remote Telnet port on the target"
$ ./startgdb ./app.elf
"his bash script will initiate a debugging session using gdb-multiarch."
- This is the application that will be programmed into the flash memory using the bootloader.
- It is an LED that blinks once every second.
- arm-none-eabi-gcc
- make
- st-flash
- gdb-multiarch
- openocd
- Clone the repo
$ git clone https://github.com/GomaaMohamed/UART_Bootloader.git
- Modify the path of the project home in the application's makefile.
- Set the memory boundaries in the linker.ld file.
- Navigate to the application folder in the terminal and compile the application to generate the Hex File.
$ make all
"This will create a binary executable named app.hex, which is the application executable"
- burn the bootloader "As stated in the Host App"
This library is released under the GNU GPL License ↗. Feel free to use it in your own projects,
modify it, and distribute it as needed. If you find any issues or have suggestions for
improvement, please open an issue or submit a pull request.