Skip to content

V0.6.x#11

Open
tristanalderson wants to merge 31 commits into
mainfrom
v0.6.x
Open

V0.6.x#11
tristanalderson wants to merge 31 commits into
mainfrom
v0.6.x

Conversation

@tristanalderson

Copy link
Copy Markdown
Collaborator

No description provided.

tristanalderson and others added 17 commits June 10, 2026 13:56
…tore, flight recorder

Replaces the flash-table design with AimFileSystem (littlefs over
AimBlockDevice drivers), AimConfigStore (atomic JSON load/save), and
AimFlightRecorder (RDES-compressed row logging with dump protocol).
Updates AimNetwork to 0.4.x packet layout and examples.

Baseline commit of in-flight work prior to fw/config-ownership changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…load

- AimFlightRecorder::closeLog(): sync+close the log handle and reset RDES
  state so callers can safely format the filesystem; next writeRow() starts
  a fresh log with a raw origin row. Destructor now reuses it.
- AimFlightRecorder::isLogging() accessor.
- AimConfigStore::loadDetailed(): distinguishes NOT_PRESENT (normal — first
  boot or post-reset) from READ_FAILED / PARSE_FAILED / STORAGE_NOT_READY.
  bool load() now delegates, behavior unchanged.

Additive only; both ESP32 and STM32 consumers build clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Device (AimFlightRecorder::serviceDump): pad the final block to the fixed
512 B block size with 0xFF at EOF. The host reads exactly blockSize per
block and trims to totalBytes afterwards, so a short final block left it
in an infinite resend loop (the ~13 min wedge seen on hardware).

Host (extract_tool/main.py):
- enter_console_root(): console entry needs a DOUBLE Ctrl-A within the
  firmware's 750 ms guard window; the old single-press path silently
  failed and the tool hung waiting for the dump handshake.
- Ack every block with 'N' (the final ack is what tells the board the
  dump is complete; previously the device stayed wedged in dump mode).
- Bounded waits: 5 s for the '#' handshake, max 5 'L' resend retries per
  block — protocol faults now raise IOError instead of hanging.

Verified on bench ESP32-S3: full dump end-to-end including a padded
422 B final block, 19/19 console regression checks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
startDump now saves and zeroes the global logger filter mask (stopDump
restores it) so every dump consumer gets a clean binary stream instead of
each caller re-implementing the mute. The dump wire-protocol bytes
('#'/'N'/'L') become named constants in AimFlightRecorder.h, mirrored in
extract_tool/main.py as the shared host contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both were orphaned by the console refactor — the console now goes through
AimFlightRecorder/AimConfigStore and nothing in any consumer (Upper_Control,
Lower_Control_test, examples) calls them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fixed-size periodic and latched-dirty TX slots; driven by a single
service() call per loop tick. Replaces scattered per-module timers
and eliminates the need for a sendTimedPktEx method in the transport.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onsole soon to be applied eslewhere), fix bug in config load
tristanalderson and others added 10 commits June 12, 2026 15:21
aim_catalog.h is the single source of truth for classes, subjects,
scaling, and fixed priorities; it lands in the same commit as the
protocol doc per the catalog/header invariant. kSchemaVersion=1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rename AimLogger -> aim_logger (logger.cpp/.h unchanged) and replace the
single example/ with paired examples/{esp32,stm32}_logger/ PlatformIO
projects.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename AimNetwork -> aim_network and rewrite the protocol from v0.4.2
(Pkt, 11-bit IDs) to v0.6.x: Msg with 29-bit extended IDs, class-mask
filtering, new aim_job.h timer helper and aim_catalog.h message catalog,
updated ESP32 (TWAI) and STM32 (bxCAN) backend cores.

Rework the canbus examples: fix swapped listener/publisher header
banners, drive the 1 Hz time sync off g_tick1000, and drop dead locals,
an unused aim_job.h include, and a duplicate trailing comment block.

Move the protocol spec to the repo root as the workspace ground-truth
doc (aim_protocol_v0.6.x_draft.md -> aim_protocol_v0.6.0.md) and fix its
title version to match kNetworkVersionString = "0.6.0".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename AimFlashStorage -> aim_flash_storage and migrate the littlefs
submodule to the new path. Relocate the flash debug console out of
av-prop/Upper_Control into this shared library as a hook-based skeleton
(aim_console), and replace the SerialFlash dependency with a direct
SpiNorFlashDriver that auto-detects any W25Q-compatible chip from its
JEDEC ID (covers both BY25Q128ES and W25Q128JV).

Fix a dump-stall bug: the console DUMP state now peek()s for the q/b
abort key instead of read()ing it, so the host's N/L block-control bytes
reach serviceDump(). Verified end-to-end on ESP32 hardware (29,870 rows).

Add esp32_flash and stm32_flash examples, redo the extract_tool, and
rewrite the README. Delete AimConfigStore and AimNodeConfig — node
identity and the telemetry schema are build-time constants, so nothing
needs persisting at runtime (drops the ArduinoJson dependency).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Update the root README "What's Inside" entries and the Quick-Start
example path to the new snake_case library names, and correct the CAN
design note: v0.6.x uses content-based addressing (consumers filter by
message class/subject) — there is no destination field.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ES constants

Renames aim_console_init/service/is_active to lowerCamelCase (aimConsoleInit,
aimConsoleService, aimConsoleIsActive) to match workspace naming convention.
Extracts _isGeometryValid() helper in AimFileSystem to de-duplicate three
identical geometry guard checks. Replaces bare 0x80/0xC0/0xE0 RDES bit-prefix
literals with named constexpr constants (kRdesLvl2Prefix, kRdesLvl3Prefix,
kRdesRaw32Prefix).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename valve/PT subjects to AV-tag names (Av204/Av203/Av205, AvSpare),
add power-FET subjects (PwrPtUcm, PwrSolLcm, PwrPtLcm), raise priority
for LCM sensors. Bump kSchemaVersion 1 -> 2 (carried in every HEARTBEAT).
service() now takes the loop's local millis() as its first argument instead
of calling millis() internally, so liveness/heartbeat timing uses the same
clock the caller schedules on. All six nodes are updated to match.
Concurrent LOG_* calls (e.g. the ESP32 UCM logging from both cores) could
interleave mid-line on the shared stream. Guard the single output write with
a std::mutex, gated on _GLIBCXX_HAS_GTHREADS so it is a real lock only where
the toolchain has threads and a no-op on single-threaded bare-metal nodes.
…ff recovery, console blocking read

STM32 bxCAN switches to interrupt-driven TX/RX with static mailbox queues.
ESP32 TWAI gains bounded bus-off recovery with cooldown. aim_console adds
aimConsoleWaitRead() for multi-byte hook parsing. Job drops default member
init in favor of explicit {period, 0U} at all call sites.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant