- This is a single ESP-IDF firmware project for Cardputer-Adv on
ESP-IDF 5.4.2; it is not a package monorepo. main/CMakeLists.txtis the authoritative module list. Everything ships as onemaincomponent.
- Ignore
build/when searching. It contains generated artifacts, cached logs, and stale grep noise. - Ignore
sdkconfigfor edits. It is generated; the editable sources of truth aresdkconfig.defaultsandmain/Kconfig.projbuild. - If docs and code disagree, trust
main/plus build config over prose indocs/.
- Use an ESP-IDF shell before running anything. In this workspace, assume
idf.pyis not available from a plain PowerShell session. - First-time setup or after cleaning build state:
idf.py set-target esp32s3 - Main verification command:
idf.py build - No repo-local test, lint, formatter, or CI config was found. Do not invent JS/Python-style checks that are not here.
sdkconfig.defaultspins the target toesp32s3, uses the custompartitions.csv, sets 8 MB flash, disables the ESP console, and enables FATFS LFN on heap.- Project-specific Kconfig knobs such as battery thresholds, heap gates, file-size limits, and build/session policy live in
main/Kconfig.projbuild.
- Runtime overrides come from
/sdcard/baitnswitch.cfg, parsed bymain/config/app_config.c. - Default runtime paths are
/sdcard/baitnswitch.cfgfor config and/sdcard/baitnswitch-logs.txtfor exported logs.
main/app_main.conly callsbs_app_main().main/app/app.cis the top-level wiring: it creates the app event queue, initializesplatform,storage,transfer, andusb_host, mounts/sdcard, attempts to load runtime config, starts the USB host, and runs the UI/event loop.
main/platform/: Cardputer-Adv hardware bring-up and render/input path: external UART, ST7789 LCD, TCA8418 keyboard, battery ADC.main/storage/: SD-over-SDSPI mount/browse plus background SHA-256 worker.main/usb_host/: ESP-IDF USB host lifecycle, descriptor capture, and RCM device/interface ownership.main/backend/: NX RCM transport, payload shaping, upload, and trigger flow.main/transfer/: polls backend snapshots and converts them into app events.
- Docs explicitly leave real-hardware validation incomplete for LCD orientation/gaps, keyboard behavior, battery calibration, USB host power behavior, and full RCM-device testing.
- Do not claim hardware validation or production readiness unless you actually verified it on device.