Skip to content

avm1234567/Customboot-32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

111 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ CustomBoot-32

✨ SRA Eklavya 2025

πŸ“‘ Table of Contents


⭐ About the Project

Aim

Designing a custom PCB with OTA support and a dual-image Bootloader using ESP32 WROOM-32E and STM32F103C8T6.

Description

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.

Tech-Stack

Coding Language

Embedded C

Libraries

HAL
LibOpenCM3

File Protocol

SPIFFS

Communication Protocols

UART
OTA




πŸ“ File Structure

.
β”œβ”€β”€ 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



πŸš€ Getting Started

Installation

  1. Clone the repo
    git clone https://github.com/avm1234567/Customboot-32.git
  2. Navigate to the project directory
    cd CustomBoot-32

Usage

The codes used in our project are in the 'CustomBoot-32' directory.

1. OTA

  • 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 

2. Dual_Image_Bootloader

  • 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.

3. ESP_STM_UART1

  • 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'

4. ESP_STM_UART2

  • 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'.

5. ESP_TO_STM_FIRMWARE_VIA_UART

-- 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'.

6. ESP_STM_FILE CRC

  • 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

7. Controling_ESP_GPIO_Wirelessly

  • Firstly fullclean, then build and flash the project.
idf.py fullclean
idf.py build
idf.py flash monitor

8. Wireless_Firmware_Selection

  • 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

πŸ“Έ Results

Screenshot of our custom PCB:

Front Back
Front Back

Actual PCB

Demo:

Working Demo of final PCB

For other results and test videos, please check our Google Drive.

Report

Refer our own report of project where we explain the entire process in detail.

πŸ›  Troubleshooting

  • 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.

πŸ‘₯ Contributors

πŸŽ“ Mentors


πŸ“š Resources


πŸ™ Acknowledgements

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.

About

STM32+ESP32 Development Board with Custom Bootloader and OTA Support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors