
Use STM32 cube IDE to write code and perform read, write, flash, and reboot operations, with notepad plus plus for firmware editing and web browser testing via Web Serial API.
Learn to receive data from a microcontroller using JavaScript and the Web Serial API by building a simple html interface that displays received bytes in hexadecimal and decimal.
Trigger usb re-enumeration without unplugging by pulsing the stm32 f103 usb d+ pin low for 100 ms using hal gpio initialization, configuring a12 as gpio output to reset the pin.
Command 0x05 switches to the main application by resetting the microcontroller; the bootloader checks the backup register and returns a one-byte hex response, similar to 0x03 erase flash.
Erase 64kB of undocumented flash on stm32 f103; bootloader memory remains. Verify the erase with stm32 cube programmer and implement a web interface erase flash button using zero three command.
Write to STM32 flash memory using a web-based bootloader. Send erase and write commands, format data into four-byte blocks, and verify with STM32 cube programmer.
Add a CRC-32 checksum feature to the bootloader by implementing a Crc32 function and a lookup table, with per-byte updates and an initial CRC value, and validate using command 0x06.
Enhance the stm32 bootloader protocol to read larger data chunks over usb by adding a read n parameter to command zero two, enabling 1–255 byte reads and faster flash access.
Add a crc32 checksum field to read commands and extend responses; calculate and verify data checksums in C and JavaScript, and validate flash data with cube programmer.
Integrate AES decryption into the STM32 bootloader to decrypt encrypted binaries using the same key and a CBC mode, then decrypt before writing to flash.
Activate the bootloader via power-on and reset checks with gpio inputs or a serial command within a short window, then jump to the main application only if the checksum passes.
Thank you for taking the STM32 Bootloader course! I hope you enjoyed the Web Serial API approach—flashing via a browser makes things so much easier. If you have questions, just drop them in the Q&A or message me directly. Happy coding!
Note: This course currently only supports the STM32F1 series (Blue Pill boards with STM32F103C8T6).
This course focuses on USB-based firmware upgrades (wired connection) using Web Serial API – not internet/Wi-Fi updates.
This course is for developers who want to watch code being written line-by-line. I explain concepts slowly and clearly, but the screen recordings are intentionally sped up 2x to save time. If you want to code along with every example (great for learning!), you'll need to pause and rewind frequently.
That's it – no diagrams or deep dives into flash memory theory. We'll modify STM32 and HTML code bit by bit and immediately test how it works. The screen is always split:
• Left side: Web browser + IDE (live coding)
• Right side: Slides (key concepts)
Take this course if you're into STM32 HAL and want to build a reliable, production-ready bootloader. While we focus on USB CDC and Web Serial API, the core concepts can easily adapt to UART-based bootloaders or EXE flasher utilities.
To simplify things, I've prepared helper functions for Web Serial API and STM32 USB-CDC (see myserial.js and usb_serial.c).
The course won’t explain the internals – experienced developers will quickly grasp how they work (the code is minimal)
Beginners: Try using them as-is first, but ask me if you get stuck adapting them to your projects