- About the Project
- Getting Started
- Usage
- Results and Demo
- Future Work
- Report
- Troubleshooting
- Contributors
- Mentors
- Resources
- Acknowledgements
Designing a custom PCB with OTA support and a dual-image Bootloader using ESP32 WROOM-32E and STM32F103C8T6.
The project focuses on creating a custom PCB that integrates the Blue Pill (STM32F103C8T6) with ESP32 WROOM-32E.
The ESP32 hosts a website, receives two firmwares via OTA, creates memory partitions, and initializes a File System in one of the partitions.
On the STM side, a dual-image Bootloader requests firmware based on user input, verifies it, allocates it in flash memory, and executes it.
The firmware transfer is carried out via UART.
.
βββ assets #All images and test videos
βΒ Β βββ 2WayUART.mp4
βΒ Β βββ 3D-view back.png
βΒ Β βββ 3D-view.png
βΒ Β βββ EmbedC.png
βΒ Β βββ Final_PCB.png
βΒ Β βββ HAL.png
βΒ Β βββ LibOpenCM3.png
βΒ Β βββ OTA.png
βΒ Β βββ PCBSC1.png
βΒ Β βββ PCBSC2.png
βΒ Β βββ Routing.png
βΒ Β βββ SimpleBootloader.mp4
βΒ Β βββ SPIFFS.png
βΒ Β βββ UART.png
βΒ Β βββ website.png
βΒ Β βββ Wireless_CMD_Test.mp4
βΒ Β βββ WorkingVideo.mp4
βββ CustomBoot-32 #All the firmwares for both ESP as well as STM
βΒ Β βββ 1. OTA
βΒ Β βββ 2. Dual_Image_Bootloader
βΒ Β βββ 3. ESP_STM_UART1
βΒ Β βββ 4. ESP_STM_UART2
βΒ Β βββ 5. ESP_TO_STM_FIRMWARE_VIA_UART
βΒ Β βββ 6. ESP_STM_FILE_CRC
βΒ Β βββ 7. Controling_ESP_GPIO_Wirelessly
βΒ Β βββ 8. Wireless_Firmware_Selection_ESP_STM(Additional)
βββ Documentation #Detailed documentation of the project
βΒ Β βββ Final_DOC.pdf
βββ Gerber files #Files made for fabrication of PCB
βΒ Β βββ 4 SRA-B_Cu.gbr
βΒ Β βββ 4 SRA-B_Mask.gbr
βΒ Β βββ 4 SRA-B_Paste.gbr
βΒ Β βββ 4 SRA-B_Silkscreen.gbr
βΒ Β βββ 4 SRA-drlnew.zip
βΒ Β βββ 4 SRA-drl.rpt
βΒ Β βββ 4 SRA-Edge_Cuts.gbr
βΒ Β βββ 4 SRA-F_Cu.gbr
βΒ Β βββ 4 SRA-F_Mask.gbr
βΒ Β βββ 4 SRA-F_Paste.gbr
βΒ Β βββ 4 SRA-F_Silkscreen.gbr
βΒ Β βββ 4 SRA-job.gbrjob
βΒ Β βββ 4 SRA-NPTH-drl.gbr
βΒ Β βββ 4 SRA-NPTH-drl_map.gbr
βΒ Β βββ 4 SRA-PTH-drl.gbr
βΒ Β βββ 4 SRA-PTH-drl_map.gbr
βββ README.md
βββ Schematic files #Schematics of our PCB
βββ 4 SRA.kicad_pcb
βββ 4 SRA.kicad_sch
βββ untitled.kicad_sch
- Clone the repo
git clone https://github.com/avm1234567/Customboot-32.git
- Navigate to the project directory
cd CustomBoot-32
The codes used in our project are in the 'CustomBoot-32' directory.
- From the CustomBoot-32 directory head to the OTA directory.
cd 1. OTA
- In the code enter the SSID and password of your wifi in line 16 and 17.
#define WIFI_SSID "Your_SSID"
#define WIFI_PASS "Your_Password"
- Then open ESP-IDF Powershell and build the project.
idf.py fullclean
idf.py build
- After the build is complete flash it.
idf.py flash monitor
-
To generate the bin files open this project in STM32CubeIDE and build it
-
To flash this Code use STM32CubeProgrammer. Change your directory to Dual image bootloader directory.
-
After opening the directory first flash the LED_BLINK_2 bin file into STM-32 at the Start Address '0x08006000'. The path for the bin is:
CustomBoot-32/2. Dual_Image_Bootloader/LED_BLINK_2/Debug/LED_BLINK_2.bin
- After flashing the first bin file flash the LED_BLINK bin file into STM-32 at the Start Address '0x08004000'. The path for the bin is:
CustomBoot-32/2. Dual_Image_Bootloader/LED_BLINK/Debug/LED_BLINK.bin
- Lastly, flash the Bootloader at the Start Address '0x08000000'. The path for the bin is:
CustomBoot-32/2. Dual_Image_Bootloader/Learning_Bootloader/Debug/Learning_Bootloader.bin
- Press the 'Start Programming' button to run the program.
- To run the ESP side of the code change your directory to 'ESP_STM_COMM'.
cd 3. ESP_STM_UART1\ESP_STM_COMM
- After that build the code and flash it
idf.py fullclean
idf.py build
idf.py flash monitor
-
To flash the STM code, open STM32CubeIDE and generate the build files.
-
After generating flash the bin file into the STM using STM32CubeProgrammer at Start Address '0x08000000'
- To run the ESP side of the code change your directory to 'ESP_STM_COMM'.
cd 3. ESP_STM_UART2\ESP_STM_COMM
- After that build the code and flash it
idf.py fullclean
idf.py build
idf.py flash monitor
-
To flash the STM code, open STM32CubeIDE and generate the build files.
-
After generating flash the bin file into the STM using STM32CubeProgrammer at Start Address '0x08000000'.
-- To run the ESP side of the code change your directory to 'OTA'.
cd 5. ESP_TO_STM_FIRMWARE_VIA_UART\OTA
- After that build the code and flash it
idf.py build
idf.py flash monitor
- To flash the STM code, open STM32CubeIDE and generate the build files. You will find the bin files in the path
CustomBoot-32/5. ESP_TO_STM_FIRMWARE_VIA_UART/Learning_Bootloader/Debug/Learning_Bootloader.bin
- After generating flash the bin file into the STM using STM32CubeProgrammer at Start Address '0x08000000'.
- Download libopencm3 by cloning it to run bootloader file
git clone https://github.com/libopencm3/libopencm3.git
cd libopencm3
- After that flash the ESP32 in the directory
idf.py fullclean
CustomBoot-32/6. ESP_STM_FILE_CRC/OTA
idf.py build flash monitor
- Firstly fullclean, then build and flash the project.
idf.py fullclean
idf.py build
idf.py flash monitor
- Download libopencm3 by cloning it to run bootloader file
git clone https://github.com/libopencm3/libopencm3.git
cd libopencm3
- After that flash the ESP32 in the directory
idf.py fullclean
CustomBoot-32/8. Wireless_Firmware_Selection_ESP_STM(Additional)/OTA
idf.py build flash monitor
Screenshot of our custom PCB:
| Front | Back |
|---|---|
![]() |
![]() |
For other results and test videos, please check our Google Drive.
Refer our own report of project where we explain the entire process in detail.
- ERC rule check errors in PCB schematics.
- Routing issues in compact areas while adhering to manufacturer constraints.
- Wi-Fi SSID and password options not appearing in Menuconfig.
- CMakeLists errors affecting SPIFFS initialization.
- Partition table not being detected.
- SPIFFS initialization failure at runtime.
- Favicon loading errors.
- OTA binaries containing unnecessary bloatware.
- UART initialization issues.
- Binary file transfer failures.
- Errors in custom file protocol implementation.
- End-byte transmission errors during communication.
- Application jump not functioning correctly (MSP not set).
- Correct HAL-like application jump with LibOpenCM3.
- Schematic issues resolved through perfboard prototyping and testing.
- Bootloader basics (EmbeTronicx)
- EmbeddedInventor: Bootloader
- Getting Started with STM32
- Bare-metal UART STM32
- ESP32 UART
- CRC32 for STM
- LibOpenCM3 documentation
- SPIFFS
- FreeRTOS
- ESP Web Server Handling
- File Transfer Protocols
We are extremely grateful to our mentors β Prithvi Tambewagh, Shaunak Datar, and Vishal Mutha β for their guidance and support throughout the course of this project.
We also thank SRA-VJTI for their support in organizing Eklavya 2025 and for providing us the opportunity to work on this project.





