Skip to content

Hakoniwa sensor device registers as a Devicetree model (Erbium), Hakoniwa link and in-process - #83

Merged
tmori merged 1 commit into
mainfrom
feat/erbium-sensor-registers
Nov 8, 2026
Merged

tmori merged 1 commit into
mainfrom
feat/erbium-sensor-registers

Conversation

@tmori

@tmori tmori commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Makes the Hakoniwa sensor device of the RISC-V Erbium board a Devicetree node instead of a memory.txt DEV (EXDEV) device.

What changed

  • New model hakoniwa,sensor-registers (board/common/src/hako_sensor_registers_model.c), ported from the EXDEV glue with its behaviour unchanged:
    • it latches each sample at the sample's own time, with a data-ready pulse;
    • it writes the committed motor outputs to hil_actuator;
    • the test vehicle and the trace format are the same.
  • The same plugin library registers it next to hakoniwa,sensor-device. Both the Hakoniwa link build and the in-process aircraft build (HAKO_SENSOR_DEVICE_BUILD_INPROC) therefore carry it.
  • boards/erbium/erbium-hakoniwa.dts places the node at 0x20000000 with PLIC source 5. erbium.dtb is unchanged.
  • The test generator maps each Hakoniwa plugin compatible that a board uses.
  • New unit test hako-sensor-registers (test vehicle). A deliberately broken interrupt pulse makes it fail.

Checks

Test vehicle on PX4 aifoundry_erbium_hakoniwa, 3e9 clocks, against the C path with the EXDEV device:

  • the trace is identical: 3,899 sensor, GPS and actuator lines, with exact float bits;
  • the firmware console is identical (39,216 bytes); only the start-up log lines differ.

Hakoniwa x500 take-off to 2.5 m, headless, 3 runs each:

Configuration RTF
Before: C path + EXDEV, aircraft service 1.68 / 2.07 / 1.78
After: Devicetree plugin, aircraft service 1.93 / 1.64 / 1.89
After: Devicetree plugin, in-process aircraft 2.08 / 2.09 / 2.06

All runs PASS, holding 2.48-2.51 m. With the viewer at real time, 3 runs of the Devicetree plugin also passed.

ctest passes on macOS and on Ubuntu 24.04 (566/566).

Found on the way (not changed here): the core's EXDEV loader keeps a pointer into the MPU region table, and the Devicetree models reallocate that table. A DEV combined with a Devicetree can therefore read freed memory. athrill-target-riscv now refuses that combination.

🤖 Generated with Claude Code

…or-registers)

Ported from the EXDEV glue, behaviour unchanged: latch at the sample's
time, data-ready pulse, committed motor outputs to hil_actuator, test
vehicle, trace format. The same plugin library (Hakoniwa link or
in-process aircraft) registers it next to hakoniwa,sensor-device.
boards/erbium/erbium-hakoniwa.dts places it at 0x20000000, PLIC 5.

Test vehicle on PX4 aifoundry_erbium_hakoniwa, 3e9 clocks: the trace
(3899 sensor/GPS/actuator lines, exact float bits) and the firmware
console are identical to the C path with the EXDEV device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmori
tmori merged commit 5ba5392 into main Nov 8, 2026
10 checks passed
@tmori
tmori deleted the feat/erbium-sensor-registers branch November 8, 2026 05:11
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