Skip to content

Flashing the DevKit

Time
20 min
Difficulty
Easy

What you'll learn

  • How to upload to an ESP32 whose automatic reset doesn't work
  • What the device shows when it first starts
  • How to calibrate the touch screen for your shield

Now the signer itself: the airgap_wallet sketch goes onto the ESP32 DevKit.

Open the sketch and pick the board and port

Section titled “Open the sketch and pick the board and port”
  1. In the Arduino IDE, open airgap_wallet with File → Open….
  2. Select Tools → Board → esp32 → ESP32 Dev Module.
  3. Open Tools → Port before and after plugging the DevKit into the computer by USB. The entry that appears is the DevKit’s port: select it.

Most ESP32 boards reset themselves into download mode when an upload starts. On the tested DevKit, with the shield attached, that didn’t work reliably, so hold the BOOT button during every upload:

  1. Press and hold BOOT on the DevKit.
  2. While holding it, click Upload (the arrow button). The IDE compiles the sketch first, which takes a while; then it starts sending it to the board.
  3. Keep holding BOOT until the Output panel shows the upload has finished.
  4. Release BOOT and press EN (the reset button) to start the firmware.

For the first upload, set Tools → Erase All Flash Before Sketch Upload to Enabled to wipe the whole flash chip, as you did for the camera board. Set it back to Disabled afterwards.

Like the camera sketch, airgap_wallet has its own partitions.csv with no crash-dump area. The ESP32 core uses it automatically.

The IDE shows these in the Output panel.

  • Failed to connect to ESP32: No serial data received or Wrong boot mode detected: the board didn’t enter download mode. Hold BOOT and try again.
  • “Access is denied” or “port busy”: another program, such as a serial terminal, has the port open. Close it first.

After pressing EN, the device starts up. In testing, it showed a Bitcoin logo and “SIGNET PROTOTYPE” before the menu, and the serial output reported the display ID as 0x9341. If the screen stays white or shows garbage, check the wiring from step 4 wire by wire, especially LCD_RD on GPIO21 and LCD_D0 on GPIO22.

Touch calibration depends on your exact shield, so the values in the firmware may not fit yours. If taps land in the wrong place:

  1. Open Dev tests, then Recalibrate.
  2. Touch each of the four corner targets when asked. A red flash means “try that one again”.

The device uses the new calibration straight away, and shows the matching lines for airgap_wallet/config.h on the screen. To keep them after a restart, copy them into config.h (with TOUCH_CAL_VALID 1) and upload again.

The Touch test under Dev tests shows a dot wherever you touch. Use it to check the edges of the screen.

The firmware prints status lines over USB at 115200 baud: counts, versions, fingerprints and public information only, never secrets. To watch them, open Tools → Serial Monitor and set the speed in its baud-rate list to 115200 baud.

  • The upload worked with BOOT held, and the device starts after pressing EN.
  • Erase All Flash Before Sketch Upload is back to Disabled.
  • The display shows the start screen without garbage.
  • Touches land where you tap (recalibrate if not).