A complete embedded development session with Claude — from hardware detection to flashed firmware, fully automated.
check if my Freenove Development Kit for ESP32-S3 ESP32 S3 CAM (Included), Dual-core 32-bit 240 MHz Microcontroller, Onboard Camera Wireless, Touch Screen Stereo Speakers Heart Rate Sensor, Tutorial Code is attached
Your Freenove ESP32-S3 board does not appear to be attached right now.
The only serial ports present are Bluetooth and the debug console — no USB serial devices were detected. Make sure you're using a data-capable USB cable, not a charge-only cable.
i installed the driver and rebooted
check the usb now!
✓ Your ESP32-S3 is detected!
Serial port: /dev/cu.wchusbserial5AB90133721
The wch prefix confirms the CH343/WCH USB serial driver is working. This is your port for flashing and serial communication.
install esptool py so that you can work with the board
redo that but use a virtual environment. the venv should be stored in the repo
(User interrupted — Claude switched to venv approach)
python3 -m venv .venv
.venv/bin/pip install esptool
# esptool.py v4.11.0 ✓
back up the current esp32 sketch to this repo — i mean back it up from the esp32 which is connected
Detected 8MB flash. Reading full image from the board…
.venv/bin/esptool.py --port /dev/cu.wchusbserial5AB90133721 \
read_flash 0x0 0x800000 backup/flash_backup_default.bin
# Chip: ESP32-S3 (QFN56) rev v0.2
# PSRAM: 8MB (AP_3v3)
# Flash: 8MB → backup/flash_backup_default.bin ✓
Also wrote restore_default.sh — run it any time to restore the factory firmware.
write a sketch which runs on the esp32. i want it to display a button on the lcd and when i hit it, the speakers beep
Researching pin assignments from the official Freenove GitHub repo — downloading their TFT_eSPI setup zip and parsing the actual source files…
| Peripheral | Chip | Pins |
|---|---|---|
| LCD 2.8" 240×320 | ST7789 | MOSI=20, SCLK=21, DC=0, CS=GND |
| Touch controller | FT6336U (I2C) | SDA=2, SCL=1 |
| I2S Speakers | Stereo amp | BCLK=42, DOUT=41, LRC=14 |
| Heart rate sensor | MAX30102 | I2C shared bus |
| SD card | SDMMC | CMD=38, CLK=39, D0=40 |
Writing sketches/beep_button/beep_button.ino with TFT_eSPI + FT6336U + I2S…
write a script which flashes that sketch to the esp32
shouldn't you be using esptool py?
You're right — esptool.py handles the flashing. The pipeline is:
arduino-cli compiles .ino → binary → esptool.py flashes it.
Wrote flash-sketch-001-button-beep.sh which automatically:
User_Setup.h with FNK0086 configbuild/.venv/bin/esptool.py./flash-sketch-001-button-beep.sh # compile + flash
./flash-sketch-001-button-beep.sh --compile # compile only
./flash-sketch-001-button-beep.sh --flash # flash only
run ./flash-sketch-001-button-beep.sh, iterate until it works
⚠ Error 1: Arduino-FT6336U not in Arduino registry — Freenove custom library.
→ Fixed: download zip directly from Freenove GitHub repo.
⚠ Error 2: Variable named touch clashes with TouchStatusEnum::touch inside the FT6336U library.
→ Fixed: renamed to ts.
⚠ Error 3: driver/i2s.h API deprecated in ESP32 Arduino core 3.x.
→ Fixed: migrated to driver/i2s_std.h with new channel API.
⚠ Error 4: boot_app0.bin lookup used ~/.arduino15 — macOS uses ~/Library/Arduino15.
→ Fixed: search both paths.
# Final flash output:
Wrote 386624 bytes at 0x00010000 in 4.9 seconds
Hash of data verified.
Hard resetting via RTS pin...
[flash] Flash complete. Board is resetting...
great but it keeps beeping. when i hit the button, start the beeping. when i hit it again, stop the beep
Redesigned as a toggle. Audio now runs as a FreeRTOS task on Core 0, continuously generating a sine wave into a phase accumulator. The UI loop on Core 1 simply flips a volatile bool beeping.
10ms fade-in/out envelope avoids clicks on start and stop.
// FreeRTOS audio task — Core 0
xTaskCreatePinnedToCore(beep_task, "beep", 4096, NULL, 1, NULL, 0);
// Loop on Core 1 — leading-edge toggle
if (hit && !prev_hit) {
beeping = !beeping;
draw_button(beeping);
}
| File | What it does |
|---|---|
CLAUDE.md | Full hardware reference: pins, libs, venv rules |
backup/flash_backup_default.bin | 8MB factory flash image from the board |
restore_default.sh | One-command factory restore via esptool.py |
sketches/beep_button/beep_button.ino | Toggle-beep sketch: LCD button + I2S audio |
flash-sketch-001-button-beep.sh | Full compile + flash automation |
.claude/settings.json | 24 whitelisted commands for this project |
.venv/ | Python venv with esptool v4.11.0 |