Examples¶
The ESP32 test applications: one per interface, each a self-checking test that prints a pass / fail summary over the serial monitor.
| App | What it shows | Source | CI |
|---|---|---|---|
ascii_art |
ASCII art generator example | AsciiArtComprehensiveTest.cpp |
yes |
gpio_test |
GPIO peripheral comprehensive testing | GpioComprehensiveTest.cpp |
yes |
adc_test |
ADC peripheral comprehensive testing | AdcComprehensiveTest.cpp |
yes |
uart_test |
UART peripheral comprehensive testing | UartComprehensiveTest.cpp |
yes |
usb_serial_jtag_test |
Built-in USB Serial/JTAG controller (CDC-ACM + JTAG over native USB) comprehensive testing | UsbSerialJtagComprehensiveTest.cpp |
yes |
spi_test |
SPI peripheral comprehensive testing | SpiComprehensiveTest.cpp |
yes |
i2c_test |
I2C peripheral comprehensive testing | I2cComprehensiveTest.cpp |
yes |
pwm_test |
PWM peripheral comprehensive testing | PwmComprehensiveTest.cpp |
yes |
can_test |
CAN peripheral comprehensive testing | CanComprehensiveTest.cpp |
yes |
pio_test |
PIO/RMT comprehensive testing | PioComprehensiveTest.cpp |
yes |
temperature_test |
Temperature sensor comprehensive testing | TemperatureComprehensiveTest.cpp |
yes |
nvs_test |
NVS (Non-Volatile Storage) comprehensive testing | NvsComprehensiveTest.cpp |
yes |
timer_test |
Timer peripheral comprehensive testing | TimerComprehensiveTest.cpp |
yes |
logger_test |
Logger system comprehensive testing | LoggerComprehensiveTest.cpp |
yes |
wifi_test |
WiFi connectivity comprehensive testing | WifiComprehensiveTest.cpp |
yes |
bluetooth_test |
Comprehensive Bluetooth testing suite | BluetoothComprehensiveTest.cpp |
yes |
dog_test |
DigitalOutputGuard comprehensive testing suite | DigitalOutputGuardComprehensiveTest.cpp |
yes |
Build and flash one (from examples/esp32, ESP-IDF environment loaded):
Source of this table: examples/esp32/app_config.yml.
One-time setup¶
The build scripts come from hf-espidf-project-tools,
checked out as the examples/esp32/scripts submodule. They install the ESP-IDF version an app asks for.
git submodule update --init examples/esp32/scripts
cd examples/esp32
./scripts/build_app.sh list # the apps above
./scripts/build_app.sh can_test Release # build one
./scripts/flash_app.sh flash_monitor can_test Release
What to read in an example¶
| Part | Where | Shows |
|---|---|---|
| Object construction and configuration | The test_* functions |
The configuration struct for that Esp* class |
| Error checks | The same functions | Return codes compared against *_SUCCESS |
| Pins | constexpr hf_pin_num_t constants near the top of each file |
The ESP32-C6 pins the test expects; change them for your board |
| Test framework | examples/esp32/main/TestFramework.h |
The pass / fail bookkeeping |
The CI workflow builds every app with ci_enabled: true for each ESP-IDF version and build type listed in
app_config.yml.
Next: Testing and CI.