Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 2.58 KB

File metadata and controls

39 lines (31 loc) · 2.58 KB

AGENTS.md

Scope

  • 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.txt is the authoritative module list. Everything ships as one main component.

Search First

  • Ignore build/ when searching. It contains generated artifacts, cached logs, and stale grep noise.
  • Ignore sdkconfig for edits. It is generated; the editable sources of truth are sdkconfig.defaults and main/Kconfig.projbuild.
  • If docs and code disagree, trust main/ plus build config over prose in docs/.

Build And Verify

  • Use an ESP-IDF shell before running anything. In this workspace, assume idf.py is 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.

Build-Critical Config

  • sdkconfig.defaults pins the target to esp32s3, uses the custom partitions.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 Config

  • Runtime overrides come from /sdcard/baitnswitch.cfg, parsed by main/config/app_config.c.
  • Default runtime paths are /sdcard/baitnswitch.cfg for config and /sdcard/baitnswitch-logs.txt for exported logs.

Real Entrypoints

  • main/app_main.c only calls bs_app_main().
  • main/app/app.c is the top-level wiring: it creates the app event queue, initializes platform, storage, transfer, and usb_host, mounts /sdcard, attempts to load runtime config, starts the USB host, and runs the UI/event loop.

Directory Map

  • 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.

Hardware Claims

  • 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.