Step 12 of 56
The examples: all 96 of them
Most need no wiring, most tell you PASS or FAIL, and each one is the fastest way to find out whether a peripheral works on your board before you write a line against it.
How to use them
Every example builds and runs the same way, and the short name is enough:
./x list # names, profiles, directories
./x run gpio0_blink # build + flash + monitor
./x run i2c_loopback -p /dev/ttyACM0
Run the self-test before writing code. When a driver page here says a peripheral works, that is a claim about the authors' board. The matching example is how you turn it into a claim about yours — and most need no external wiring at all, using internal loopback or a pad the chip samples itself.
They are also meant to be read. Each opens with a header saying what
it demonstrates, what the console should print, and what hardware it needs;
magic numbers are named and the reasoning is in the code.
examples/STYLE.md records the bar, with
esp32s3_gpio0_blink and esp32s3_gdma_copy as the
models.
Mind the profile column. An example built for
embedded will not build under light-tasking — the
RAII driver handles need finalization (step 8).
That is the first thing to check when a copied example fails to compile.
The catalogue
Generated from ./x list --json and the examples' own headers, so
it cannot drift from what the repository actually contains. The last column
links to the step that explains the thing being demonstrated.
| Example | Profile | What it shows | Step |
|---|---|---|---|
adc_read | embedded | Ada SAR ADC one-shot self-test | 25 |
aes_gcm_kat | embedded | AES-GCM AEAD as a known-answer test (KAT) on the ESP32-S3: authenticated encrypt + decrypt for AES-128 and AES-256, driving the hardware AES block with software GHASH/CTR. Encrypt must reproduce the expected ciphertext and tag; decrypt must verify the tag and recover the original plaintext | 27 |
b612 | embedded | B612 anti-aliased font on an ST7789 display | 49 |
ch422g | embedded | CH422G I2C I/O-expander driver demo | 34 |
crypto | embedded | Ada hardware-crypto self-test | 27 |
delay_test | embedded | 55 | |
dns_secure | embedded | One name, four DNS transports: UDP, TCP, DoT and DoH, over the W5500 | 41 |
embedded | embedded | embedded runtime profile demo | 08 |
es8311 | embedded | ES8311 audio codec -- full-duplex 440 Hz loopback | 31 |
exceptions | embedded | Ada exception demonstration (embedded profile) | 08 |
ext4 | embedded | Ada ext4-on-SD self-test | 47 |
ext4_flash | embedded | A real ext4 filesystem on wear-leveled SPI NOR flash | 47 |
ext4_mkfs | embedded | Format a blank SPI NOR flash to ext4 ON-DEVICE, then use it (ESP32-S3) | 47 |
ext4_sdmmc | embedded | What: mount a real ext4 (or ext2/3) SD card with the pure-Ada filesystem (ESP32S3.Ext4) over the SDMMC block driver, then list the root directory and read /hello.txt | 28 |
ext4_write | embedded | ext4 WRITE battery for the pure-Ada filesystem | 47 |
fram | embedded | I2C FRAM driver demo | 36 |
ftp | embedded | An FTP *client* over the WIZnet W5500 Ethernet controller, driven through the portable FTP_Client package (which is itself written against the GNAT.Sockets facade) | 45 |
ftp_inet | embedded | A REAL-WORLD FTP client run over the W5500: it logs in anonymously to the public GNU FTP server (ftp.gnu.org), prints a file's SIZE, downloads it (RETR, counting bytes and comparing to SIZE), lists the root (NLST), and quits | 45 |
ftp_server | embedded | An anonymous FTP *server* on the ESP32-S3, exposing the ext4-on-W25Q-flash filesystem over the network: a desktop FTP client (FileZilla, the `ftp` CLI, a browser, Python ftplib) can browse, download, upload, delete and mkdir on the board's flash | 45 |
full_intr | full | full-profile interrupt-attach test (`ESP32S3_RTS_PROFILE=full`) | 08 |
full_tasking | full | Full Ada tasking -- the constructs the Jorvik runtime profile forbids, here running over the BB kernel on core 0 | 08 |
gdma_copy | embedded | Ada GDMA self-test | 17 |
gpio0_blink | light-tasking | a bare-metal Ada peripheral driver (ESP32-S3, no FreeRTOS) | 13 |
gps | embedded | The reusable HAL GPS driver (ESP32S3.GPS): a task-driven UART NMEA receiver | 38 |
gps_display | embedded | Multi-sensor dashboard on a 240x240 ST7789 panel (bare-metal ESP32-S3, no FreeRTOS, no IDF) | 38 |
gt911 | embedded | GT911 capacitive-touch driver demo | 30 |
hc595 | embedded | A string of 74HC595 shift registers driven over SPI: MOSI->SER, SCLK->SRCLK, a GPIO RCLK latch and a GPIO /OE. It walks a single high output across the whole string ("chase"), so you can watch it on LEDs or a scope and confirm the wiring, the chip count, and the bit/chip ordering | 34 |
heaptest | embedded | On-target malloc/free stress of the Ada TLSF allocator (ESP32-S3) | 09 |
heartbeat | light-tasking | 05 | |
i2c_loopback | embedded | An Ada I2C MASTER hardware self-test -- exercises the reusable HAL master driver (ESP32S3.I2C) with NO external wiring and no device on the bus | 14 |
i2s_loopback | embedded | Ada I2S self-test | 18 |
i2s_pdm | embedded | Ada I2S PDM microphone capture demo | 18 |
intr_levels | embedded | 55 | |
lcd | embedded | 19 | |
lcd_i8080 | embedded | Ada LCD (i80 8-bit parallel) self-test (no IDF) | 19 |
ledc_pwm | embedded | Ada LEDC PWM self-test | 22 |
m24c64 | embedded | M24C64 I2C EEPROM driver demo | 36 |
mac | embedded | Reading the factory MAC address programmed into the ESP32-S3's eFuse, and the per-interface MACs the chip derives from it (Espressif allocates each part a block of four) | 29 |
mcpwm_pwm | embedded | Ada MCPWM PWM-output self-test | 23 |
modbus_master | embedded | A Modbus TCP *master* on the ESP32-S3 over the W5500: it connects to a slave on the LAN, reads holding registers and writes one back, reporting each Status | 44 |
modbus_slave | embedded | A Modbus TCP *slave* on the ESP32-S3 over the W5500: it serves holding registers and coils that live in the application's own storage (Slave_Dev) -- the Modbus.Slave library keeps no register tables | 44 |
multinic | embedded | Multiple network interfaces on one board: TWO W5500s, the routing table that chooses between them, and interface pinning | 40 |
p256_kat | embedded | Known-answer test for the pure-Ada P-256 (secp256r1) ECDSA + ECDH (P256) | 27 |
pcf85063a | embedded | PCF85063A real-time clock | 33 |
pcnt_count | embedded | Ada PCNT self-test | 24 |
psram | light-tasking | External PSRAM from Ada (ESP32-S3, no FreeRTOS, no ESP-IDF) | 09 |
qmi8658c | embedded | QMI8658C 6-axis IMU driver demo (bare-metal ESP32-S3, no FreeRTOS, no IDF) | 32 |
rendezvous | full | Ada task RENDEZVOUS on the bare-metal dual-core ESP32-S3 -- synchronous task-to-task message passing (entries / `accept` / entry calls with `out` parameters): the full tasking model that lives beyond Jorvik | 08 |
rmt_loopback | embedded | Ada RMT self-test | 21 |
rsa_kat | embedded | ESP32-S3 RSA accelerator known-answer test (KAT) | 27 |
rtc_sleep | embedded | Ada RTC deep-sleep + retained-memory self-test | 26 |
rtcio_hold | embedded | Ada RTC-IO pad-hold self-test | 26 |
sd_spi | embedded | SD card over SPI | 28 |
sdm_output | embedded | Ada SDM self-test | 22 |
sdmmc | embedded | Ada native SD/MMC-host self-test | 28 |
sdmmc_ch422g | embedded | Reading an SD card on a board where the card's DAT3/CD line is wired not to the SoC but to a CH422G I2C expander pin, so two reusable HAL drivers work together: * ESP32S3.CH422G drives the card's DAT3/CD high via its IO4 pin -- needed so the card enters/stays in SD mode | 34 |
shared_l2 | embedded | Two drivers, one interrupt -- ESP32S3.Shared_L2 | 55 |
sht41 | embedded | SHT41 temperature/humidity sensor driver demo | 32 |
simd | embedded | The ESP32S3.SIMD library (libs/esp32s3_simd) running on real silicon: a few representative vector kernels whose inner loops are GNAT inline assembly over the Xtensa LX7 PIE SIMD unit (the q-registers) | 51 |
smp | light-tasking | Dual-core SMP cross-core mailbox (no FreeRTOS) | 08 |
sparknacl_kat | embedded | SPARKNaCl known-answer tests | 27 |
spi_loopback | embedded | An Ada SPI MASTER hardware self-test -- exercises the reusable HAL master driver (ESP32S3.SPI) with NO external wiring | 15 |
st7789 | embedded | ST7789 SPI display driver demo | 30 |
st7789_cube | embedded | Bouncing solid-colour 3D cube on a 240x240 ST7789 panel (bare-metal ESP32-S3, no FreeRTOS, no IDF) | 30 |
stack_usage | light-tasking | Runtime stack high-water-mark measurement (ESP32S3.Stack_Usage): paint the environment-task stack with a sentinel, run a workload that drives the stack to a known depth, then report the peak bytes actually used | 52 |
stress | full | RTS stress suite: a randomized tiny-delay storm (stress_storm) plus cross-core wakeup ping-pong pairs (stress_pingpong), watched by an on-board stall monitor (stress_monitor) | 55 |
tca9555 | embedded | The reusable HAL driver ESP32S3.TCA9555 -- a 16-bit I2C GPIO expander -- driven against a real part at 0x20 | 34 |
timer_count | embedded | Ada general-purpose timer self-test (no IDF) | 24 |
tls_hello | embedded | Pure-Ada TLS 1.3 client over the W5500 (Ethernet) | 42 |
tls_resume | embedded | TLS 1.3 session resumption (PSK) over the W5500 (Ethernet) | 42 |
tls_weather | embedded | Real-world HTTPS over pure-Ada TLS 1.3: fetch a live weather forecast from api.open-meteo.com, end to end with no external C TLS library | 42 |
tlv2556 | embedded | TI TLV2556 12-bit serial ADC bring-up | 37 |
touch_read | embedded | Ada capacitive-touch read self-test | 25 |
twai_loopback | embedded | Ada TWAI (CAN) self-test | 20 |
tx1812 | embedded | Drive a string of TX1812 addressable RGB LEDs on IO48 via the RMT peripheral | 35 |
uart_loopback | embedded | Ada UART self-test | 16 |
w25q | embedded | Winbond W25Q256FV SPI NOR flash bring-up | 36 |
w5500 | embedded | WIZnet W5500 TCP echo server | 39 |
w5500_control | embedded | WIZnet W5500 control registers | 39 |
w5500_dhcp | embedded | DHCP client on the W5500 with automatic lease maintenance | 39 |
w5500_dns | embedded | A DNS name lookup over the W5500 Ethernet chip, using the portable DNS_Client module | 39 |
w5500_http | embedded | An HTTP GET *client* over the WIZnet W5500 Ethernet controller, driven through the GNAT.Sockets facade (a TCP stream socket) | 39 |
w5500_lowpower | embedded | WIZnet W5500 PHY power-down (low-power) | 39 |
w5500_ntp | embedded | An SNTP / NTP time client over a Wiznet W5500 Ethernet module | 39 |
w5500_weather | embedded | Weather forecast for a latitude / longitude, from Open-Meteo (open-meteo.com) | 39 |
wifi_deepsleep | embedded | ESP32-S3: associate to Wi-Fi, then deep-sleep -- the RTC power-down IS the radio power-down | 43 |
wifi_dns | embedded | ESP32-S3 Wi-Fi DNS over a pure-Ada software IP stack | 43 |
wifi_http | embedded | ESP32-S3 Wi-Fi HTTP fetch over a pure-Ada software TCP stack | 43 |
wifi_scan | embedded | ESP32-S3 Wi-Fi scan + WPA2 connect, end to end on libs/esp32s3_wifi | 43 |
wifi_sniff | embedded | ESP32-S3 Wi-Fi promiscuous sniffer -- a WPA2 ground-truth tool | 43 |
wifi_tls | embedded | ESP32-S3 Wi-Fi HTTPS: pure-Ada TLS 1.3 over the software TCP stack | 43 |
wl | embedded | Dynamic wear-leveling FTL over the W25Q SPI NOR flash | 46 |
x509_chain | embedded | X.509 certificate-chain validation | 42 |
x509_kat | embedded | X.509 DER parser known-answer test (X509.Parse) | 42 |
x509_policy | embedded | X.509 leaf-certificate policy checks | 42 |
x509_verify | embedded | End-to-end X.509 certificate signature verification as a known-answer test | 42 |