fix(ark): pin the primary IMU on fmu-v6x and pi6x (#28444)

* fix(ark/fmu-v6x): pin the bus-1 IMU as the primary

The three IMUs run at equal voter priority, so the sensor voter selects
the primary by whichever validates first at boot and keeps it — a
non-deterministic race. Seed the intended IMU's calibration slot (per
hwtype: IIM-42652 on ARKV6X000, IIM-42653 on ARKV6X001, both on SPI1,
already the heater's regulated sensor) with a higher priority so
selection is deterministic; the voter still fails over to the other
IMUs if it degrades.

param set-default is shadowed by a stored calibration, so this takes
effect on a fresh flash calibrated afterwards; an already-calibrated
board keeps its stored priority until the params are reset.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(ark/pi6x): pin the SPI1 IMU as the primary

Same equal-priority voter race as fmu-v6x: two ICM-42688-P run at equal
priority, so the primary is decided by a boot race. Seed the SPI1 IMU's
calibration slot (already the heater's regulated sensor) with a higher
priority so selection is deterministic, with fallback to the SPI2 IMU on
degradation. Replaces the placeholder TODO on HEATER1_SENS_ID, whose id
is the running SPI1 device.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
(cherry picked from commit 3826a2a706)
This commit is contained in:
Jacob Dahl committed 2026-10-31 08:26:58 -08:00
1 parent f99a75e0ee
commit 8923183911
2 files changed
+21 -1

No files matched your search

+13
View File
@@ -26,11 +26,24 @@ param set-default UAVCAN_ESC_IFACE 2
if ver hwtypecmp ARKV6X000
then
# IIM-42652 on SPI1 is the primary IMU: seed its calibration slot with a
# higher voter priority so selection is deterministic rather than a boot
# race between the three equal-priority IMUs, falling back to the others
# only if it degrades. The heater regulates on it too.
param set-default CAL_ACC0_ID 2818058
param set-default CAL_GYRO0_ID 2818058
param set-default CAL_ACC0_PRIO 100
param set-default CAL_GYRO0_PRIO 100
param set-default HEATER1_SENS_ID 2818058
fi
if ver hwtypecmp ARKV6X001
then
# IIM-42653 on SPI1 is the primary IMU (see ARKV6X000 above).
param set-default CAL_ACC0_ID 3014666
param set-default CAL_GYRO0_ID 3014666
param set-default CAL_ACC0_PRIO 100
param set-default CAL_GYRO0_PRIO 100
param set-default HEATER1_SENS_ID 3014666
fi
+8 -1
View File
@@ -30,7 +30,14 @@ param set-default UAVCAN_ESC_IFACE 1
if ver hwtypecmp ARKPI6X000
then
# TODO: Add the correct sensor ID
# ICM-42688-P on SPI1 is the primary IMU: seed its calibration slot with a
# higher voter priority so selection is deterministic rather than a boot
# race between the two equal-priority IMUs, falling back to the SPI2
# ICM-42688-P only if it degrades. The heater regulates on it too.
param set-default CAL_ACC0_ID 2490378
param set-default CAL_GYRO0_ID 2490378
param set-default CAL_ACC0_PRIO 100
param set-default CAL_GYRO0_PRIO 100
param set-default HEATER1_SENS_ID 2490378
fi