TL;DR
I wanted to build a personalized PCB badge for DEF CON, just for the heck of it. I’ve built wearable PCBs before, but this time I wanted to give LLMs a go.
I went through this journey with an open mind: I genuinely wanted to see what LLMs were capable of in this domain, while having a little fun. I had zero intent of pushing LLMs in a corner of nonsensical or extremely hard challenges (e.g., to make them fail), nor find issues in their reasoning on purpose. I approached this as a curious child. I did use an adversarial-review step to minimize the chances of introducing issues, although this wasn’t enough: there was at least one hardware bug that I found in post-manufacturing and had to fix through a board rework (i.e., desolder a switch). I didn’t have a multimeter as I was vacationing, so I summoned Opus to help me diagnose and confirm the bug by feeding machine code through JTAG via OpenOCD: it felt pretty satisfactory. More about this below.
I’m not an electronic professional, but I’ve designed prototypes in KiCAD before, going through the entire concept-to-DVT/EVT/PVT flow for some of my toy projects. This is to say that I didn’t let agents go completely YOLO, yet I’m still far from being a professional electronic engineer. I guided agents and glued their work together, but other than that I relied on agents for the actual work, including design review checks diagnose and debugging. The only 100%-manual work I did was the PCB layout.
I started from a few hand-drawn sketches, which I outsourced to my kids. I fed the sketches with some prompts to a mix of GPT 5.5 (via ChatGPT and Codex) for high-level visual design and KiCAD actual schematics (via CLI). I used Claude Opus 4.6-4.8 (via Claude Code) for firmware design and implementation, both with context of the schematics. I was in the loop for all the manual UI-heavy steps of the entire schematics design (i.e., place components, trace wires), not because there are no good MPCs/CLIs that could help there, but because I wanted to go through the whole thing step by step, to see exactly what the model was telling me to do.
Overall, I’m happy with the result and I guesstimate that this flow compressed the timeline to about one half compared to a fully human-based flow. Plus, the LLMs suggested me adding protection circuitry and battery-charging components that I’d have not thought of—as a non professional electronic designer.Summary of lessons learned.
Takeaways
LLMs are great as force-multiplier design consultants, which know more than I do about the nitty-gritty details of each components and have the capability of rapidly doing deep dives on hundreds of sources, which would take me hours/days.
LLMs fail at maintaining an accurate, full end-to-end picture of the whole project: we as humans still excel in that and I think this is where our time is best invested.
Vision models can help a lot with visualizing the final product as early as on day 0, which helps thinking through dimensions, weight, PCB layout, etc.
LLMs are great at estimating overall cost: once you’ve selected most of the components, throw them into an agent and ask them to do some deep search on component costs and they’ll give you an accurate range.
Most time saving was on selecting sourcing components: use “ask me questions” so your agent will interview you about what the design requirements/goals/constrains are, and spend some time connecting your agent to LCSC, PCB Parts, or whatever your sourcing DB is (MCP or CLI/curl doesn’t matter, just let the agent query those DBs).
Good time saving was on downloading symbols, footprints, and models: tell your agent
easyeda2kicad -hor equivalent, which does most of the job, and have an up to date KiCAD component library.I never had to use KiCAD MCP, partly because when I tried it failed to connect components correctly, mostly because I wanted to do the manual steps myself.
Agents/LLMs won’t save you time in the hard-hard/physical aspects of hardware development such as preparing the production kit, verify component availability, confirm pop/depop, etc.: rely on a good export plugin such as “Fabrication Toolkit” and know the fab’s capabilities and constrains.
Have and maintain a BOM in a CSV scratch file as early as possible and let the agent read/update it as you talk to it: this will help giving a structure, TODO-style, step-by-step approach to the assisted schematic design.
Agents need to flexibly build context around certain areas: let them access component datasheets in a folder and let them know about
pdftotextor similar tools.
Sketch on paper: the originality seed
I wanted to really be lazy on this project and outsourced most of the artistic aspect to my minions. To make this a feasible and contained task, I put a size constrain (I drew a rectangle) and gave them some visual seeds. I threw the past 2 years worth’s of conference badges (PCB and non-PCB) on a table, pulled out a few drawing papers and told my kids to just jot down what came to mind without too much thinking. They’ve both been at DEF CON a few times so they’re exposed to the conference vibes and the world of hacker badges.
I wasn’t expecting anything near to a complete design. All I wanted was an alternative perspective and some creative/crafty inputs for me to assemble in an initial sketch. My plan was to then seed all this to a LLM with vision mode, and task it to create some concept renders.
Early mock renders: designing backward
Nothing feels more motivating to me than seeing the vision of the final product. I could see it in my mind while sifting through the sketches, but seeing it in “3D” is a whole new story. Normally, you’d have to wait until some of the PCB layout is done to be able to appreciate the look and feel of what you’re designing. Having an high-quality mock in minutes is just amazing.
I threw all the sketches (the originality seed), photos of past badges, and blog posts about badge making into a ChatGPT chat, and talked to the LLM for about 3-5 minutes, starting from a prompt like this:
User: You are a hacker conference PCB badge designer.
Agent: Understood. I’ll approach your requests as a hacker-conference PCB badge designer, balancing:
Visual identity and collectible appeal
Schematic and PCB architecture
Power budget and battery safety
ESP32, RP2040, STM32, or custom MCU selection
E-paper, OLED, TFT, LEDs, touch, and physical controls
BLE, Wi-Fi, LoRa, NFC, UWB, and USB
Manufacturability, assembly cost, and component availability
Firmware architecture, games, puzzles, and badge-to-badge interaction
Enclosure, lanyard mounting, antennas, and human factors
Bring-up, test fixtures, and production risk
I’ll treat it as a real badge that must survive manufacturing, shipping, registration-day chaos, and several days of enthusiastic hacking.
High-level sweep: system architecture, components, and domains
I had a vague idea of what I wanted to build, I could see how it would look, what FW functionalities and HW & FW interfaces it needed, but I didn’t have an architecture or implementation plan in mind. Plus, I had to start dealing with component selection and wiring, while keeping an eye on FW driver support.
I described the requirements, interfaces, and use case to ChatGPT 5.5 and iterated through a first draft of a TRD.
User: Let’s talk about components.
Go deeper in the design. BOM will have at least:
ESP32-S3, PMIC for the LiPo battery,
USB-C port on the back,
a few capacitors, some resistors,
blue LEDs on the syth, except for the 2 red eyes,
button on the sword,
2 side buttons for reset and boot,
SAO plastic headers,
LiPo battery.
┌──────────── USB D+/D− ─────────── ESP32-S3
USB-C 5 V ── ESD/TVS ────┤
└── BQ25185 charger/power path
│
┌────────────┴────────────┐
│ │
1S LiPo SYS
│
┌───────────────────────┼───────────────────┐
│ │ │
TPS631000 LP5813 charger status
3.3 V buck-boost LED driver to ESP32
│ │
ESP32, I²C, switches, blue scythe LEDs
sensors and SAO ports + two red eyesIt started with the electrical architecture, then continued through the rest. Here’s an outline of the transcript, with some excerpt when relevant:
Core BOM recommendation
Ref. Proposed component Purpose U1 ESP32-S3-WROOM-1-N8 Main MCU, Wi-Fi, BLE and native USB U2 BQ25185 One-cell LiPo charger with power path U3 TPS631000 3.3 V buck-boost regulator U4 LP5813DDRRR Twelve-channel LED driver with integrated boost and animation engine U5 TCA9543A Two-channel I²C switch isolating the two SAO ports ... ... ...
Battery charging and power path
3.3 V system regulator
Scythe and eye LEDs
Buttons
USB-C implementation
SAO interfaces
ESP32 I²C → TCA9543A
├── Channel 0 → SAO1 SDA/SCL
└── Channel 1 → SAO2 SDA/SCL
Proposed GPIO allocation,
PCB stack and placement (A four-layer PCB is worth the cost): here, I had to steer it back to a two-layer later.
Firmware-driver assessment.
User: Work on two fronts in parallel or sequentially.
Check that EspressIf and/or Arduino (PlatformIO) have drivers for them.
Create the most detailed schematics diagram that you can create, not in plaintext, but in PDF/SVG.
The outcome will be handed off to a FW engineer and HW engineer, respectively.
Rough BOM and cost estimation
User: Learn how to use https://github.com/yaqwsx/jlcparts/blob/master/LCSC-API.md and query LCSC to obtain an accurate estimate of the BOM cost. Quote JLCPCB PCB manufacturing + assembly separately.
JLCPCB manufacturing estimate, separate from components
JLCPCB assembly estimate, separate from PCB and BOM
All-in planning cost

I manufactured 5 items, which inflated the cost of about 1.5x, plus shipping and import tax, each of the 5 badges ended up ~$66. Not far from the estimate.
I asked ChatGPT to export a visual block design. I wasn’t aiming at accurate component selection and full schematic from the beginning: Mostly, I was interested in having a 10,000-foot view of the architecture, and which domains I should start reasoning about. Here’s what it produced.
It’s clunky and ugly. It’s one of those outcomes that, at a first glance, may even seem legit, but quickly turn out to be just slop. I didn’t care of the details: I knew this was slop, but it was enough to “see” a primitive high-level architecture. I ignored the wires and kept the blocks as a rough reference throughout the rest of the process.
I asked ChatGPT to export a markdown of the whole TRD conversation, as input for the next phase.
From TRD to KiCAD schematic: iterate through the BOM
Was now time to switch to Codex CLI. I created a prompt to inform Codex about kicad-cli and easyeda2kicad. These are enough for Codex to 1/ parse the KiCAD artifacts and 2/ download LCSC symbols, footprints, and 3D models where KiCAD could find them.
I tried to use one of the KiCAD MCPs, spent about 10’ on it, but was not happy with the outcome. Plus, I wanted to stay in the loop and not give Codex too much freedom to act on the artifacts. On multiple dozens of interaction over the course of 2 hours, Codex never attempted to use easyed2kicad unless told to do so by me, whereas it consistently used kicad-cli to read the status of the project.
After a failed attempt to have Codex CLI create a schematics from scratch (based on the TRD and draft BOM), I decided to start fresh. I created an empty schematics and prompted Codex GUI like this:
Then I decided to start building the schematic by iterating through the BOM, which was now a bit more stable (with MPNs, etc.). Still, I was open to some minor changes if better choices would come up later.
User: Use the CSV BOM to guide me step by step on adding the parts - I’ll confirm what I added at each step.
Agent: Step 1: Add The Charger IC
Add this exact BOM line first:
Refs: U2
Qty: 1
Value: BQ25185DLHR
Description: 1S LiPo charger / power-path PMIC
Package/Footprint: WSON-10 2.2x2.0mm
Manufacturer: Texas Instruments
MPN: BQ25185DLHR
JLCPCB/LCSC Part #: C19725033
Populate: Yes
Agent: Checks before you confirm:
Package is
WSON-10 / DLH, not a different BQ25185 package.The JLC/LCSC field is
C19725033.This is the charger/power-path IC, reference
U2.Do not substitute
BQ25896RTWRhere.Reply with what you added for
U2, and I’ll give you Step 2.User: BQ25185DLHR
Agent: Good.U2 = BQ25185DLHRis correct.
Agent: Step 2: Add The 3.3 V Buck-Boost Regulator.
Add the main regulator next:
Refs: U3
Qty: 1
Value: TPS631000
Description: 3.3 V buck-boost regulator
Manufacturer: Texas Instruments
MPN: TPS631000
JLCPCB/LCSC Part #: TBD for now
Populate: Yes
Agent: Important checks:
It must be a
TPS631000buck-boost part, not an LDO.Match the exact package suffix you find to the footprint. The BOM still says
VQFN-HR per selected variant, so the suffix matters.This regulator creates the stable
3V3rail from the charger/system rail.Reply with the exact TPS631000 part number or LCSC/JLC ID you add.
At each iteration, I’d manually place the component. If I could not find it, I’d either ask Codex to fetch it via easyeda2kicad, or call the tool myself by repeating the last shell command and change just the --lcsc_id <ID>.
To minimize cycling through windows, I placed a terminal sidebar next to KiCAD and continued through all the parts.
Closing the loop with pcbparts: letting Codex source exact parts
At this point I gained confidence that the loop was actually helping me create the schematic, which was developing in front of me quite swiftly. However, I was getting bored of copy-pasting the next placed-part number. So I searched and found pcbparts, an MCP/CLI to lookup IDs from LCSC (and others):
User: Add this mcp server to your settings https://pcbparts.dev/mcp
Agent: Added the MCP server globally aspcbparts:
[mcp_servers.pcbparts]
url = "https://pcbparts.dev/mcp"
Agent: codex mcp list shows it enabled:
pcbparts https://pcbparts.dev/mcp enabled.
And now I could close the loop:
User: use pcbparts to find the next BOM item on the list on LCSC.
Agent: Found the next BOM item withpcbpartsand updated the CSV.U4is now:
TLC59116IPWR
LCSC/JLC: C131194
Package: TSSOP-28
Library: Extended
Stock reported: 2403
Price reported: $1.3386
Agent: Next BOM item is the SAO I2C mux:
U5 = TCA9548Aunless you want to reconsiderTCA9543A.
Then I gave the agent a simple local memory:
User: create a local memory so that when I ask you to to lookup the next part in the BOM, if there’s a match, you call
easyeda2kicad --footprint --symbol --lcsc_id <id>
So now I could say:
User: use pcbparts to find the next BOM item on the list on LCSC.
And the agent would close the loop:
Agent: Found and updated the next BOM item:
U5: TCA9548APWR
LCSC/JLC: C130026
Package: TSSOP-24
Library: Extended
Stock reported by pcbparts: 15192
Agent: Updated BOM: flat_bom_jlcpcb_lcsc.csv
I also ran:
easyeda2kicad --footprint --symbol --lcsc_id C130026
Agent: It created:
Symbol: /Users/u/Documents/Kicad/easyeda2kicad/easyeda2kicad.kicad_sym
Footprint: /Users/u/Documents/Kicad/easyeda2kicad/easyeda2kicad.pretty/TSSOP-24_L7.8-W4.4-P0.65-LS6.4-BL.kicad_mod
Agent: Next unresolved populated item is
U6 U7, the SAO power load switches.
So my “human in the loop” role would now be reduced to:
User: OK, next one on the BOM.
Agent: (...lookup, download, import to KiCAD)
User: next
Agent: (...lookup, download, import to KiCAD)
...
User: I’ve added them all. Walk me through each group of components by type and help me check resource designators and numbering.
...
User: I placed all the parts. Guide me through connecting them.
Agent: Before wiring, fix these three things:
U4is currentlyTLC59711PWPR, notTLC59116IPWR. Stop and replace that symbol/footprint before connecting LEDs. The TLC59711 is a different interface/topology.
C15is currently anotherCL21A226MAQNNNE22 uF 0805. BOM saysC15 = CL31A476MPHNNNE, 47 uF 1206.Test points currently have no footprint assigned. Use
TestPoint:TestPoint_Pad_D1.5mmfor most, and optionallyD1.0mmfor USB D+/D-.Then start wiring in this order.
Step 1: Global Nets. Create these net labels first:
GND
VBUS_5V
VBUS_FUSED
BAT
SYS
3V3
USB_D_P
USB_D_N
I2C_SDA
I2C_SCL
CHIP_PU
GPIO0_BOOT
Agent: Also create later-use labels:
SAO1_3V3
SAO2_3V3
SAO1_SDA
SAO1_SCL
SAO2_SDA
SAO2_SCL
SAO1_GPIO1
SAO1_GPIO2
SAO2_GPIO1
SAO2_GPIO2
STAT1
STAT2
LED_SUPPLY
Agent: Step 2: USB-C Input. Wire
J1:
J1 VBUS pins A4/B9 and B4/A9 -> VBUS_5V
J1 GND pins A1/B12 and B1/A12 -> GND
J1 shell / EH pads -> GND, preferably through chassis-style direct GND for this badge
J1 SBU1/SBU2 -> no connect
J1 CC1 -> R1 -> GND
J1 CC2 -> R2 -> GND
J1 Dp1 + Dp2 -> USB_D_P_CONN
J1 Dn1 + Dn2 -> USB_D_N_CONN
A couple of times I’d change my mind about parts, so I threw in some plot twists to Codex, which would respond very well.
As I saw my role becoming that of a button clicker, I wanted to gain something. I wanted to go beyond just connecting parts and following directions. I wanted to learn a bit more: some of these parts were new to me. I knew what they were needed for, but I never used them in any design nor programmed them. So I took the opportunity to familiarize.
I continued until the schematics was complete.
Adversarial review cycles: it feels too good, so it’s not true
I wanted to check if we had made any mistakes, so I cleared the session and:
User: perform an adversarial review of the current schematics and identify issues. Consider that this device is a hacker badge, not a production device.
(worked 4 minutes)
Agent: Completed the adversarial schematic review and wrote it here:
adversarial_schematic_review.mdHigh-signal findings:
TPS631000feedback network is wrong:FBis tied to3V3instead of a divider to the 500 mV FB reference.
LED_V+is just3V3through a 0-ohm link, which is not credible for the TLC59711 blue LED sink design at the configured current.
TPS22948SAO fault outputs are open-drain but have no external pull-ups.USB D+/D- shunt caps are DNP, but still production-ambiguous as generic
Cparts unless BOM/CPL generation honors DNP.Verification run:
kicad-cli sch export netlistandkicad-cli sch erc. ERC reports 213 violations, mostly EasyEDA import pin-type noise; I used the exported netlist for the actual findings.
Then I started to tackle these one by one, but I wanted Codex to help me.
User: Let’s tackle these findings 1 by 1. Walk me step by step on how to manually fix the issues, because I want to understand.
Agent:
Which reminded me that I had to pick actual parts for resistors:
I repeated the adversarial review cycle a couple of times until Codex wasn’t reporting any more findings. However, as we’ll see later, it shorted two nets without noticing. The reason is because it didn’t have the model of a slide switch, so it assumed all pins were independent.
With the help of a friend, we ran a 30m review, to have a second pair of human eyes.
I moved from schematics to PCB layout as I’d do for any other KiCAD project. I’ll not go through this here, but there are plenty of good follow-along tutorials on YouTube.
Once done, I created the production kit and ordered PCB + assembly service on JLCPCB.
Claude Opus on firmware: helloworld + selftest
I had no sharp idea of what the firmware would do exactly. After all, this project was 99% about “let’s see how good LLMs are at electronic design”. I still wanted something flashy, just for the heck of it, and there were some components that I never used before. So, at the very least, I wanted a “hello world” firmware and a vetting routine to self-test the devices.
$ claude
▐▛███▜▌ Claude Code v2.1.220
▝▜█████▛▘ Opus 4.6 with high effort · Claude Pro
▘▘ ▝▝ ~/dev/PCB/fs-badge/fs-badge-fw
❯ /init read the hardware design at @../fs-badge/production - this new repository is an ESP-IDF-based firmware to control the badge.
Which created the following CLAUDE.md/AGENTS.md:
# CLAUDE.md
## What this repo is
ESP-IDF firmware for the **Making Threats Mortal** conference PCB badge. The firmware controls an ESP32-S3-WROOM module driving 12 LEDs, three buttons, two SAO expansion ports, a BQ25185 charger, a TPS631000 buck-boost, and native USB-C.
At the time of writing, this directory is **empty aside from `.claude/`** — no ESP-IDF project has been scaffolded yet. Any first-touch work will need to `idf.py create-project` (or manually create `CMakeLists.txt`, `sdkconfig.defaults`, `main/`, `components/`) before builds are possible.
## Source of truth for hardware
The authoritative hardware handoff lives one directory up:
- `../fs-badge/design/making_threats_mortal_badge_hw_design_export.md` — full hardware design export. Read this before touching pin maps, ADC scaling, charger decoding, LED driver control, SAO handling, or bring-up code.
- `../fs-badge/design/making_threats_mortal_badge_reference_schematic_revA.pdf` — reference schematic (not production-verified).
- `../fs-badge/making_threats_mortal_badge.kicad_sch` / `.kicad_pcb` — the KiCad recapture. This is the real pin assignment ground truth once frozen; the design export may drift from it.
- `../fs-badge/production/bom.csv`, `positions.csv`, `netlist.ipc` — as-built production files for Rev A.
- `../fs-badge/AGENTS.md` — project-level constraints and open decisions.
When the design export and the KiCad schematic disagree, the KiCad schematic wins.
## Board summary (firmware-relevant)
- **MCU:** ESP32-S3-WROOM-1-N8 (native USB, no external UART bridge).
- **Power:** USB-C → BQ25185 charger/power-path → SYS → TPS631000 3.3 V buck-boost. Separate LED rail. Two switchable SAO 3.3 V rails.
- **Inputs:** sword button (main), reset side button (→ CHIP_PU), boot side button (→ GPIO0).
- **LEDs:** 12 total (10 blue scythe + 2 red eyes) driven by a **TLC59711** 12-channel constant-current driver over a serial/SPI-style interface — **not I²C**. Do not treat it as a TLC59116.
- **I²C:** internal bus is muxed to the two SAO ports through a **TCA9543A** (or TCA9548A alternative). SAO ports must never be wired straight to the internal bus.
- **Battery sense:** resistor divider (1 MΩ / 330 kΩ) into an ADC1 pin. At 4.2 V the ADC sees ~1.04 V.
### Proposed GPIO map (verify against KiCad before use)
| GPIO | Function |
|---|---|
| GPIO0 | Boot button (strapping) |
| GPIO1 / ADC1 | Battery voltage divider |
| GPIO4 | Sword button / wake |
| GPIO5, GPIO6 | BQ25185 STAT1, STAT2 |
| GPIO7, GPIO16 | TLC59711 SCLK, SDAT |
| GPIO8, GPIO9 | Internal I²C SDA, SCL |
| GPIO10–13 | SAO1 GPIO1/2, SAO2 GPIO1/2 |
| GPIO14, GPIO15 | SAO1, SAO2 power-enable |
| GPIO17, GPIO18 | Rescue UART TX, RX |
| GPIO19, GPIO20 | USB D−, D+ |
| GPIO21 | Charger CE / spare |
| CHIP_PU | Reset button |
**Avoid** GPIO3, GPIO45, GPIO46 (strapping) unless final module pinout is reviewed.
## Firmware architecture direction
The design export prescribes ESP-IDF (Arduino/PlatformIO is only for prototyping). Plan the codebase as ESP-IDF components:
- `board/` — pin map, board init, power-switch/EN control.
- `power/` — BQ25185 STAT-pin decode, charger CE control, battery ADC with `esp_adc_cal` calibration.
- `input/` — button debounce (sword, boot), reset is hardware-only via CHIP_PU.
- `leds/` — TLC59711 serial driver, animations, brightness policy.
- `i2c_mux/` — TCA9543A / TCA9548A channel select, bus-recovery on stuck-low.
- `sao/` — per-port power cycling, current-limit fault handling, I²C probe.
- `console/` — USB CDC serial console, rescue UART fallback.
- `selftest/` — production self-test entry point (button combo or USB command).
## Bring-up order (from hardware export §13.3)
Firmware bring-up follows the hardware bring-up order — get each stage working before the next:
1. USB CDC enumerates and prints boot banner.
2. Reset + boot buttons behave correctly at boot.
3. Battery ADC reads a plausible voltage.
4. Charger STAT1/STAT2 decode matches BQ25185 truth table.
5. Internal I²C scan with SAO ports powered off.
6. TLC59711 serial link + per-channel LED sweep.
7. SAO power switching with a dummy load, one port at a time.
8. TCA9543A channel select + SAO I²C probe + stuck-bus recovery.
9. Charging with a real protected LiPo, monitor thermals.
With this context, I summoned superpowers and started brainstorming.
❯ /superpowers:brainstorming read the hardware specifications and produce a barebone "hello world" ESP-IDF firmware that checks that the devices are present and responsive. Use graceful failover (i.e., proceed to next device if one fails, just report failure, but don't block). Ask me questions if unsure about which drivers to use. Prioritize drivers available through the IDF ecosystem.
After a few interview questions and implementation plan, the result was a configurable dual-mode firmware to either 1/ print “hello world” and do nothing else and 2/ scan and probe the devices and print their status on the UART.
# Hello-World Boot Self-Test — Design Spec
Date: 2026-07-13
Status: Draft, awaiting user review
Target: `Making Threats Mortal` badge, Rev A hardware (KiCad recapture)
## 1. Goal
Ship the first real firmware commit for the badge: an ESP-IDF v5.5 project
that boots on Rev A hardware, prints a banner over native USB CDC, and runs a
graceful-failover self-test that probes every device on the board without
blocking on any single failure.
A Kconfig switch replaces the self-test with a minimal `hello world` loop for
smoke-testing the toolchain, bring-up jigs, and CI wiring.
## 2. Hardware ground truth
Sourced from `../fs-badge/making_threats_mortal_badge.kicad_pcb` (the KiCad
schematic wins over the design export per project `CLAUDE.md`) and confirmed
against `../fs-badge/docs/adversarial_schematic_review_postfix.md`.
### 2.1 Confirmed parts
| Ref | Part | Role |
|---|---|---|
| U1 | ESP32-S3-MINI-1-N8 | MCU (native USB, 8 MB flash, no PSRAM) |
| U2 | BQ25185DLHR | LiPo charger, STAT pins only, no I²C |
| U3 | TPS631000DRLR | 3.3 V buck-boost, no firmware control |
| U4 | TLC59711PWPR | 12-ch constant-current LED driver, SPI-style |
| U5 | TCA9548APWR | 8-ch I²C mux at 0x70, A0/A1/A2 tied to GND |
| U6, U7 | TPS22948 | SAO1/SAO2 load switches with open-drain FLT |
| SW1, SW5 | TS-1187A | Sword button (dual contact wired to two GPIOs) |
| SW6 | TS-1187A | Back button |
| SW2, SW3 | TS24CA | Reset (CHIP_PU) and boot (GPIO0) side buttons |
| SW4 | MSK12C02 | Slide power switch (hardware only) |
...
This was enough to get started. And to find out that the ESP32 was grounded, for real.
BOOT0 issue: shorted nets due to missing device model
Both LLMs and I failed at detecting that there was a short between two nets, which resulted in the BOOT0 pin to be GND’d, which keeps the ESP32 from booting.
$ idf.py monitor
Executing action: monitor
Serial port /dev/cu.usbmodem101:
Connecting…
Detecting chip type… ESP32-S3
Running idf_monitor in directory ...
--- esp-idf-monitor 1.9.0 on /dev/cu.usbmodem101 115200
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x0 (DOWNLOAD(USB/UART0))
Saved PC:0x40048d14
--- 0x40048d14: uart_rx_one_char in ROM
waiting for download
At first I couldn’t see anything obvious, so I ran a few review cycles with GPT and Opus 4.6, with high effort. I asked them to focus on potential causes of BOOT0 being grounded. They found none and started rambling about chip failures, which I ignored immediately.
To make things worse, I didn’t have a meter handy as I was traveling. So I asked Opus to help me debug via JTAG, to validate that the ESP32 was really in download mode.
User: Help me use the USB (maybe with openocd via idf.py) to use the JTAG and see more. + (pasted serial session)
Agent: Runidf.py openocdin one terminal, thentelnet localhost 4444in another terminal. In the OpenOCD prompt:
halt
reg # sanity: shows PC, should be somewhere in ROM
mdw 0x60009004 1 # IO_MUX_GPIO0_REG: bit 0 = GPIO0 live level
Where mdw reads and displays 32-bit word values from a specified memory address (see CPU Configuration (OpenOCD User’s Guide)). If bit 0 = 0 -> GPIO0 is currently LOW while the chip is halted, USB-powered, and nothing on the board is being pressed. On ESP32-S3, IO_MUX_GPIO0_REG is at 0x6000_9000 + 0x0004 offset. Opus got this address wrong the first time, but when I pasted the raw OpenOCD output (including the JTAG tap: esp32s3.tap0 tap/device found:... string), it correctly identified the target and pointed me to the right address.
After a few interactions, more and more attention was growing around how I had wired the switches. At the beginning I thought it was a bad switch, but then I looked closer and saw the truth: I really had created a loop and I could not see it. And neither the LLMs. The switch is a SHOU HAN TS24CA, with pin 1 and 2 normally open (i.e., the contact switch), and pin 3 and 4 shorted.
Can you see it? At first, 1 and 2 seem disconnected but, because 3 and 4 are shorted, this creates a loop and shorts GND with BOOT0. I elegantly reworked the board using the only tool I had available: a pocket knife. I snapped the switch, which let BOOT0 free, and the ESP32 booted.
So, why didn’t I see it during design? I don’t know. Maybe was rushing through things. Why the ERC didn’t see it? Because it didn’t have the switch model: It couldn’t tell what the pins were supposed to do. For the same reason, no LLMs were able to see this glaring obvious short.
Flashy firmware
At this point the board was booting, so I wanted to get the best out of it. So I prompted Claude to create an application firmware that would animate the blue LEDs and make the red eyes LEDs breath, using one of the buttons to switch between animation patterns. Last, I wanted Wi-Fi provisioning and a small web UI to show the device status.
❯ /brainstorming create a third firmware type, that is, the production app; the app reacts to pressures of one of the three buttons (pick the one that works). The effect is that it randomizes the flashing blue LEDs with a nice animation pattern, including fading. The 2 red LEDs (the eyes) are never turned on in isolation (they're eyes): if they're turned on, they're always both on. Also, add wifi onboarding and a small webserver that shows the status of the badge and it's devices, battery status/level, similar to what's currently shown on the UART console. BTW, the battery is currently shown as 4086mV, but there's no battery connected, while the charger is shown as "[FAIL] charger STAT1=H STAT2=L fault" - maybe something to investigate.
After a few interview questions, Opus produced this (excerpt):
# Production (Attendee) App — Design Spec
Date: 2026-07-26
Status: Rev 2 — adversarial-review findings applied (see §15). Awaiting
user review of rev 2.
Target: Making Threats Mortal badge, Rev A hardware (KiCad recapture)
Supersedes: nothing
Companion spec (split-out): `2026-07-26-battery-charger-nobattery-investigation.md`
(to be authored separately; see §6)
## 1. Goal
Add a third firmware mode alongside `SELFTEST` and `HELLO`: the production
(attendee) app that ships on the badge. It runs the LED artwork, reacts to the
sword button, and exposes a small WiFi-based status page. Existing modes are
untouched.
Scope for this spec (single PR):
1. New `CONFIG_FS_BADGE_APP_MODE_PRODUCTION` Kconfig option and `app_main`
dispatch.
2. LED animation engine — randomized fading blue patterns on the 10 scythe
LEDs plus an always-both-on eye policy for the 2 red eyes.
3. Sword button — short-press cycles patterns, long-press enters
reprovisioning.
4. WiFi onboarding via a first-party SoftAP captive portal (custom httpd +
DNS hijack + OS connectivity-probe handlers), with saved credentials in
NVS via `esp_wifi_set_storage(WIFI_STORAGE_FLASH)`.
5. Small HTTP status server on connected WiFi, discoverable via mDNS.
6. Boot-time device probe reused from selftest stages, populating the status
page.
...
After a ~1hr subagent-driven development session, the firmware was booting. Before success, I had to adjust the ESP-IDF SDK version, which Opus pinned at v5.5, while I had more recent ones available. I told Claude to use eim --help to figure out how to find and activate the right SDK version and bake the right eim commands into the Makefile.
$ make host-build && make host-flash-monitor HOST_PORT=/dev/tty.usbmodem101
2026-08-01 17:15:03 - 5 - 08 - INFO - Using selected IDF version: v6.0.2
...
Executing action: all (aliases: build)
Running cmake in directory /Users/u/dev/PCB/fs-badge/fs-badge-fw/build
Executing "cmake -G Ninja -B /Users/u/dev/PCB/fs-badge/fs-badge-fw/build -DPYTHON_DEPS_CHECKED=1 -
...
[3/5] No install step for 'bootloader'
[4/5] Completed 'bootloader'
[4/5] Running utility command for flash
...
Connected to ESP32-S3 on /dev/tty.usbmodem101:
Chip type: ESP32-S3 (QFN56) (revision v0.2)
Features: Wi-Fi, BT 5 (LE), Dual Core + LP Core, 240MHz, Embedded Flash 8MB (GD)
Crystal frequency: 40MHz
USB mode: USB-OTG
MAC: 38:44:be:c6:09:88
Stub flasher running.
Changing baud rate to 460800…
Changed.
Configuring flash size…
Writing 'bootloader/bootloader.bin' at 0x00000000…
SHA digest in image updated.
Flash will be erased from 0x00000000 to 0x00004fff…
Wrote 19200 bytes (12472 compressed) at 0x00000000 in 0.4 seconds (412.9 kbit/s).
Hash of data verified.
Writing 'partition_table/partition-table.bin' at 0x00008000…
Flash will be erased from 0x00008000 to 0x00008fff…
Wrote 3072 bytes (120 compressed) at 0x00008000 in 0.1 seconds (384.6 kbit/s).
Hash of data verified.
Writing 'fs-badge-fw.bin' at 0x00010000…
Flash will be erased from 0x00010000 to 0x000fbfff…
Wrote 966352 bytes (611604 compressed) at 0x00010000 in 16.2 seconds (475.8 kbit/s).
Hash of data verified.
Hard resetting via RTS pin…
Executing action: monitor
...
--- Using /dev/cu.usbmodem101 instead…
--- esp-idf-monitor 1.9.0 on /dev/cu.usbmodem101 115200
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
I (260) main_task: Started on CPU0
I (297) main_task: Calling app_main()
I (297) board: configuring pins
I (298) board: board_init complete
--------------------------------------------------
=== FS-BADGE ===
IDF : v6.0.2
fw : v0.1.0-rc2-25-g964e247-dirty (Aug 1 2026)
chip : esp32s3 rev 2, cores 2
flash : 8 MB
--------------------------------------------------
production: full stack coming up
I (351) pp: pp rom version: e7ae62f
I (351) net80211: net80211 rom version: e7ae62f
I (353) wifi:wifi driver task: 3fced84c, prio:23, stack:6656, core=0
I (376) wifi:wifi firmware version: 00ad238
I (376) wifi:wifi certification version: v7.0
I (377) wifi:config NVS flash: enabled
I (377) wifi:config nano formatting: disabled
I (377) wifi:Init data frame dynamic rx buffer num: 32
I (377) wifi:Init static rx mgmt buffer num: 5
I (378) wifi:Init management short buffer num: 32
I (378) wifi:Init dynamic tx buffer num: 32
I (378) wifi:Init static tx FG buffer num: 2
I (378) wifi:Init static rx buffer size: 1600
I (379) wifi:Init static rx buffer num: 10
I (379) wifi:Init dynamic rx buffer num: 32
I (380) wifi_init: rx ba win: 6
I (380) wifi_init: accept mbox: 6
I (380) wifi_init: tcpip mbox: 32
I (380) wifi_init: udp mbox: 6
I (381) wifi_init: tcp mbox: 6
I (381) wifi_init: tcp tx win: 5760
I (381) wifi_init: tcp rx win: 5760
I (381) wifi_init: tcp mss: 1440
I (381) wifi_init: WiFi IRAM OP enabled
I (381) wifi_init: WiFi RX IRAM OP enabled
I (381) netmgr: no stored creds -- starting provisioning
I (388) phy_init: phy_version 712,87e8c20e,Apr 13 2026,18:51:10
I (431) wifi:mode : sta (38:44:be:c6:09:88) + softAP (38:44:be:c6:09:89)
I (433) wifi:enable tsf
I (437) wifi:Total power save buffer number: 16
I (438) wifi:Init max length of beacon: 752/752
I (438) wifi:Init max length of beacon: 752/752
I (440) netmgr: STA_START -> connect
I (442) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
I (448) portal: captive portal httpd up
I (448) netmgr: state -> provisioning
I (448) netmgr: captive portal up as fs-badge-0988

























