Skip to content

PrettyCool Caliper firmware ​

ESP-IDF 5.4 firmware for the caliper's ESP32-S3-MINI-1-N4R2: AS5311 magnetic sensing (PCNT + SSI), the experimental capacitive scale, an LVGL UI on the ST7789, NimBLE (custom GATT service + Battery + Device Information + HID keyboard), Wi-Fi with a web page and MQTT/HTTP push, TinyUSB CDC + MSC, a LittleFS reading log, and the BQ25180 / MAX17048 / LIS2DW12 power side.

Status: source complete, not yet built with idf.py and never run on hardware. The portable core passes its host tests (22 groups, 649 checks, re-run after the 2026-11-07 review fixes). Details, design and the list of unverified items: docs/firmware.md.

Build ​

sh
. ~/esp/esp-idf/export.sh             # ESP-IDF v5.4.x with the esp32s3 tools installed
idf.py set-target esp32s3
idf.py build                          # 4 MB flash (N4R2), the default
# 8 MB (N8R2):
idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.8mb" set-target esp32s3 build
idf.py -p /dev/ttyACM0 flash monitor  # see docs/firmware.md §10 once TinyUSB owns the USB port

The pin map comes from caliper/hardware/design/nets.py. After changing it, regenerate the header (the build stops if it is stale):

sh
python3 tools/gen_pins.py

Host tests ​

sh
cmake -S test/host -B build-host -G Ninja && cmake --build build-host && ./build-host/caliper_tests

Layout ​

Path
main/app_main.ctasks and wiring
main/proto/caliper_gatt.hthe BLE contract shared with caliper/app
main/board_pins.hgenerated from nets.py by tools/gen_pins.py
components/measureportable core: units, rounding, tolerance, stats, log records, GATT codecs, settings JSON, CSV, buttons, HID map
components/sensor_mag, sensor_capAS5311 and the experimental capacitive scale
components/caliper_coreevent bus, live state, commands
components/store, ui, ble, caliper_wifi, caliper_usb, powerthe rest
test/hosthost unit tests

Hardware design files, docs and generators for prettycoolboards.