Chapter 8 — Firmware
Chapter 8 of 10 · Choose your path below
The V4 PCB runs two separate firmware images: one for the STM32 control chip and one for the ESP32 web interface. Both need to be current.
Choose your path:
Good news: you may already be done.
Peak Coffee ships the V4 PCB and HMI screen with the latest firmware pre-installed. If you purchased the Complete Kit and haven't done anything to the firmware, it's ready.
What you need to do:
- Proceed to STEP 1 — Verify firmware version below
- If the version is current, skip to Chapter 9 — First Run
- If an update is available, the ESP32 supports OTA (Over-The-Air) updates via Wi-Fi — no programmer needed
STEP 1B — Verify firmware version (Path B)
- Power on the machine (plug in, press switch)
- The HMI screen will show the Gaggiuino boot screen
- Navigate to Settings → System → About on the touchscreen
- Note the firmware version displayed
Check the current release at github.com/Zer0-bit/gaggiuino/releases.
If your installed version matches the current release, you're done with this chapter.
OTA update (if needed)
- On the HMI, go to Settings → System → Wi-Fi
- Connect to your home network
- Go to Settings → System → Firmware Update
- The ESP32 will download and install the latest UI firmware automatically
- For STM32 core updates: connect via USB-C (see the official Gaggiuino docs)
Skip to Chapter 9 — First Run.
Manual firmware flashing
You will flash the STM32 core via USB and the ST-Link programmer, and the ESP32 UI via OTA over Wi-Fi.
For this path, prepare:
- ST-Link programmer (1×) — from your kit
- USB-A to USB-mini cable (1×) — for ST-Link
- USB-C cable (1×) — for PCB power
- A laptop or desktop computer with USB ports
- STM32CubeProgrammer (free download from ST) — install before starting
Install STM32CubeProgrammer before your build session
STM32CubeProgrammer is a 500MB download from ST's website. Install it on your computer before starting this chapter.
STEP 1A — Download the firmware
Go to github.com/Zer0-bit/gaggiuino/releases.
Download the latest release. It contains two files:
- gaggiuino-stm32.bin — the STM32 core firmware
- gaggiuino-esp32.bin — the ESP32 UI firmware (flashed via OTA later)
Breaking update — check release notes
If upgrading from a firmware version released before February 2025, you must flash an intermediate version first. The release notes will tell you if this applies. Read them before flashing.
STEP 2A — Connect the ST-Link
The ST-Link programmer connects between your computer (USB-A port) and the V4 PCB (4-pin SWD header).
- Connect the ST-Link to your computer via USB-mini cable.
- Connect the ST-Link to the PCB's SWD header. The header is labelled
SWDand has 4 pins:SWDIO,SWCLK,GND,3.3V. - Power the PCB via USB-C (connect to a phone charger or computer USB port).
PIN 1 orientation
The SWD connector is not keyed. Pin 1 is marked on the PCB silkscreen with a square pad or a dot. Connecting the ST-Link backwards will not damage the board, but it will not connect. Verify orientation.
STEP 3A — Flash the STM32 firmware
- Open STM32CubeProgrammer.
- Select ST-LINK from the connection type dropdown (top right).
- Click Connect. The status bar should show the detected STM32U585.
If it does not connect: - Verify the SWD cable orientation - Try a different USB port - Check that the PCB is powered
- Click Open File and select
gaggiuino-stm32.bin. - Click Download (the blue button).
- Wait for the progress bar to complete. You should see "File download complete".
- Click Disconnect.
STEP 4A — Flash the ESP32 via OTA
The ESP32 does not use the ST-Link. It updates over Wi-Fi.
- Power the PCB on (USB-C only, machine does not need to be running).
- On the HMI screen, go to Settings → System → Wi-Fi.
- Connect to your home network.
- Go to Settings → System → Firmware Update.
- If prompted for the ESP32 binary, you can serve it from a local web server or use the Gaggiuino update server.
- Follow the on-screen prompts. The ESP32 will reboot automatically when done.
STEP 5A — Verify
After both flashes:
- Power-cycle the PCB (disconnect and reconnect USB-C).
- The HMI should boot to the Gaggiuino home screen.
- Go to Settings → System → About and verify the version matches the release you downloaded.
Both paths converge here
Whether you used Path A or Path B, you now have a PCB running current firmware and a screen that shows the Gaggiuino interface.
Before you close up the machine and power it on from the mains, verify the bench test in Chapter 7 STEP 8 passed — screen boots, thermocouple reads room temperature.
