Skip to content

Flashing the firmware

CDC Badge OS targets the ESP32-S3 on the CDC Badge v1.0/v1.1. This page covers the three ways to flash it: the browser web flasher, the Python flash tool, and the serial bootloader command.

The badge must be in the ESP32-S3 ROM download (bootloader) mode before flashing. There are two ways in.

Software (badge already running CDC Badge OS)

Section titled “Software (badge already running CDC Badge OS)”
  • On the badge UI, open Tools → Expert → Bootloader, or

  • over the USB serial console, authenticate first and then request the bootloader:

    AUTH <pin>
    BOOTLOADER

The BOOTLOADER serial command requires an authenticated session, so you must send AUTH with the badge PIN first. After a successful AUTH, BOOTLOADER reboots the device into USB download mode.

  1. Press and hold the FLASH button.
  2. Briefly press RESET while still holding FLASH.
  3. Release FLASH.

The web flasher uses ESP Web Tools and flashes directly from the browser over Web Serial.

Requirements:

  • Google Chrome or Microsoft Edge (desktop) with Web Serial support.
  • A data-capable USB cable. Charge-only cables will not enumerate the device.
  • The badge in bootloader mode (step 1).

The flasher offers two installs:

InstallWhat it does
Firmware UpdateReplaces only the firmware. Installed plugins, language overlay, settings and PINs stay intact. It shows an “Erase device” checkbox that is unchecked by default. Use this for normal version upgrades.
Factory SetupWipes installed plugins and re-installs the language overlay. Use this on a fresh badge, or when an update leaves things broken.

The first boot after Factory Setup takes longer than usual because the firmware wipes every used secure-element slot and re-initialises storage. Do not unplug while the display is still updating.

tools/flash_firmware.py flashes the pre-built CI/release binaries with esptool. It can flash from a local directory or download a GitHub release.

Terminal window
# Download and flash the latest GitHub release
python tools/flash_firmware.py --release latest
# Flash a specific release tag
python tools/flash_firmware.py --release v1.0.0
# Flash from a local directory of .bin files
python tools/flash_firmware.py --dir ./artifacts/
# Pick the serial port manually
python tools/flash_firmware.py --dir ./artifacts/ --port /dev/cu.usbmodem1101
# Wipe settings (erase the NVS partition) after flashing
python tools/flash_firmware.py --release latest --erase-nvs

What the tool does:

  • Targets chip esp32s3 at 460800 baud, flash mode dio, 80 MHz, 16 MB.
  • Auto-detects the serial port (or use --port).
  • Resets into the app automatically after flashing (--after hard_reset).
  • With --erase-nvs, it erases the NVS region (0x9000, 0x5000 bytes) after flashing, which resets all settings.

It writes three binaries at these offsets:

OffsetBinary
0x0bootloader
0x8000partitions
0x50000firmware (app)

If the badge already runs CDC Badge OS, you do not need the FLASH/RESET button dance. Use the serial path from step 1 (AUTH <pin> then BOOTLOADER) to reboot into download mode, then run the web flasher or the Python tool. After flashing, the device hard-resets back into the new firmware on its own.

The on-device partition table:

PartitionTypeOffsetSize
nvsNVS (settings)0x90000x47000
app0app (factory)0x500000xDA0000
pluginsFAT (plugins + language overlay)0xDF00000x200000 (2 MB)
coredumpcoredump0xFF00000x10000

The CI builds two install manifests for the web flasher, both targeting chipFamily ESP32-S3:

Sets new_install_prompt_erase: true and flashes three parts:

PartOffset (decimal)Offset (hex)
bootloader.bin00x0
partitions.bin327680x8000
firmware.bin3276800x50000

Flashes the same three parts plus the initial plugins/language image:

PartOffset (decimal)Offset (hex)
bootloader.bin00x0
partitions.bin327680x8000
firmware.bin3276800x50000
plugins_initial.bin146145280xDF0000

The factory image’s plugins_initial.bin lands at 0xDF0000, the start of the plugins partition, which is why Factory Setup resets the plugin/language partition while a plain Firmware Update leaves it untouched.

  • Plugins are optional and live in the separate 2 MB FAT partition. They can be installed and updated without re-flashing the firmware, via the plugin web installer.
  • For a first boot, allow extra time after a Factory Setup while storage re-initialises.