Skip to content
hw.dev
hw.dev/signal/trusted-firmware-esp32-tone-pin-hardware-test-2026
SignalTrusted Firmware

An ESP32 Tone Test Measures 32 Edges on the Real Pin

A hardware test now commands a 1 kilohertz ESP32 tone, measures 32 edges on its output pin, and checks that the pin goes quiet.

Thesis connection

Firmware tests can prove the waveform reached the physical pin instead of trusting a successful command response.

#embedded#testing#verification#tools
Read Original

Trusted Firmware added a board test that commands a 1 kilohertz tone, captures 32 edges on the same physical pin, and accepts the measured frequency only within 5 percent. It then stops the tone and checks that the line stays quiet. The ESP32-P4 board runs the test over a Transmission Control Protocol (TCP) connection because its firmware command channel isn't on the serial console.

The test found hardware-specific problems while it was being built. The capture peripheral initially turned the output pin into an input, which erased the waveform it was supposed to measure. The fix enables internal loopback only when the tone generator is driving that pin. The suite also checks that a board can't start a tone on a pin reserved for an Ethernet shield and clears pulse-width modulation (PWM) output after each run.

A successful firmware response proves that a command parser ran. Counting edges proves that the timer, pin routing, output peripheral, and test connection worked together. Teams with waveform-generating firmware should copy this pattern on one representative board before trusting simulator-only frequency tests across the rest of a product line.