- About the Project
- Getting Started
- Usage
- Results and Demo
- 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
├── README.md
└── Schematic files # Schematics of our PCB
├── 4 SRA.kicad_pcb
└── 4 SRA.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-32directory, navigate to theOTAdirectory:
cd CustomBoot-32/1.\ OTA- In the code, set your Wi-Fi SSID and password (lines 16-17):
#define WIFI_SSID "Your_SSID"
#define WIFI_PASS "Your_Password"- Build using ESP-IDF PowerShell:
idf.py fullclean
idf.py build- Flash and open the serial monitor:
idf.py flash monitor - To generate the binary files, open this project in STM32CubeIDE and build it.
- To flash this code, use STM32CubeProgrammer:
- Flash
LED_BLINK_2.binat start address0x08006000:CustomBoot-32/2. Dual_Image_Bootloader/LED_BLINK_2/Debug/LED_BLINK_2.bin - Flash
LED_BLINK.binat start address0x08004000:CustomBoot-32/2. Dual_Image_Bootloader/LED_BLINK/Debug/LED_BLINK.bin - Flash the Bootloader at start address
0x08000000:CustomBoot-32/2. Dual_Image_Bootloader/Learning_Bootloader/Debug/Learning_Bootloader.bin
- Flash
- Click Start Programming to run.
- For the ESP32 code:
cd CustomBoot-32/3.\ ESP_STM_UART1/ESP_STM_COMM
idf.py fullclean
idf.py build
idf.py flash monitor - For the STM32 code, generate build files in STM32CubeIDE and flash the binary using STM32CubeProgrammer at address
0x08000000.
- For the ESP32 code:
cd CustomBoot-32/4.\ ESP_STM_UART2/ESP_STM_COMM
idf.py fullclean
idf.py build
idf.py flash monitor - For the STM32 code, generate build files in STM32CubeIDE and flash the binary using STM32CubeProgrammer at address
0x08000000.
- For the ESP32 code:
cd CustomBoot-32/5.\ ESP_TO_STM_FIRMWARE_VIA_UART/OTA
idf.py build
idf.py flash monitor - For the STM32 code, build in STM32CubeIDE and flash the binary found at
CustomBoot-32/5. ESP_TO_STM_FIRMWARE_VIA_UART/Learning_Bootloader/Debug/Learning_Bootloader.binat address0x08000000.
- Clone
libopencm3required for the bootloader:
git clone https://github.com/libopencm3/libopencm3.git
cd libopencm3- Flash the ESP32 firmware:
cd CustomBoot-32/6.\ ESP_STM_FILE_CRC/OTA
idf.py fullclean
idf.py build flash monitor- Clean, build, and flash:
cd CustomBoot-32/7.\ Controling_ESP_GPIO_Wirelessly
idf.py fullclean
idf.py build
idf.py flash monitor- Clone
libopencm3required for the bootloader:
git clone https://github.com/libopencm3/libopencm3.git
cd libopencm3- Flash the ESP32 firmware:
cd CustomBoot-32/8.\ Wireless_Firmware_Selection_ESP_STM\(Additional\)/OTA
idf.py fullclean
idf.py build flash monitorCustom PCB Views:
| Front | Back |
|---|---|
![]() |
![]() |
For other results and test videos, check the Google Drive Folder.
Refer to the detailed project Report.
- 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.


