Skip to content

feat(x5h): before/after actuation parameter profiles for the MRM demo - #47

Merged
oguzkaganozt merged 8 commits into
autowarefoundation:feat/freertos-x5h-netiffrom
youtalk:feat/x5h-actuation-param-profiles
Sep 23, 2026
Merged

oguzkaganozt merged 8 commits into
autowarefoundation:feat/freertos-x5h-netiffrom
youtalk:feat/x5h-actuation-param-profiles

Conversation

@youtalk

@youtalk youtalk commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Stacks on #45.

Adds a compile-time ACTUATION_PARAM_PROFILE for the X5H CR52 firmware:

  • after (the default) is the tuned profile and keeps the five longitudinal-controller deceleration defaults this tree already carried, so an unconfigured build is unchanged in behaviour on every target and the S32Z2, Zephyr and POSIX targets are unaffected.
  • before selects the CES 2026 untuned deceleration limits (stopped_acc -0.4, emergency_acc -0.75, emergency_jerk -1.0, min_acc -0.75, min_jerk -1.0).

Selected with build.sh --platform freertos-x5h --param-profile before|after. The profile name is printed in the FreeRTOS boot banner, which also places actuation_param_profile=<name> in .rodata; check-elf-contract.sh gains an optional third argument that asserts it, so which profile an image carries is machine-verifiable before it is ever flashed. CI builds the before profile into its own -d directory and uploads it as a separate artifact, freertos-x5h-before-elfs, deliberately distinct from freertos-x5h-elfs so an operator fetching a flash image cannot confuse the untuned demo baseline with the image that ships.

Only the after image is a behavioural no-op: the boot banner now carries the identity string on both x5h images, so their .rodata differs from their predecessors by exactly that string.

Verified on hardware (2026-08-20). Both profiles were flashed onto an R-Car X5H Ironhide board and the MRM fault-injection scenario was run under each. Measured stop distance: before 52.96 m mean (3 runs), after 39.39 m mean (4 runs) — a 13.6 m / 34% difference, with the tuned profile reproducing to 0.33 m across six reflashes. Every run completed the MRM chain (mrm=succeeded, final commanded velocity zero). A disassembly diff of the two builds confirms exactly five changed constants in the longitudinal controller and nothing else.

The consuming side — the stop-distance measurement and the demo orchestrator — is a companion pull request in autowarefoundation/openadkit.

Why a compile-time switch, and not a parameter file

One question a reviewer will ask: why compile this in, when declare_parameter defaults can be overridden at run time with a parameter file? The run-time route works, but it leaves the firmware image ambiguous. The same ELF can then run as either profile, and which one it runs as depends on files that live outside the image. The compile-time switch stamps the profile name into .rodata, so check-elf-contract.sh reads the profile back out of the ELF alone. Before a board session we can prove which profile is about to be flashed, from the file we are about to flash and nothing else. That matters because the before profile is the untuned CES 2026 baseline. It brakes weakly on purpose. An operator must not be able to flash it while believing it is the tuned image that ships, and a parameter file cannot give that guarantee.

@youtalk
youtalk marked this pull request as ready for review August 27, 2026 13:11
@youtalk
youtalk force-pushed the feat/freertos-x5h-netif branch from 27c729d to 829e117 Compare August 31, 2026 18:38
@youtalk
youtalk force-pushed the feat/x5h-actuation-param-profiles branch from 1b9cfa6 to 9004f2e Compare August 31, 2026 18:38
@youtalk
youtalk force-pushed the feat/freertos-x5h-netif branch from 829e117 to 74fbb0a Compare August 31, 2026 21:25
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
… profile

The header and CMakeLists.txt comments claimed an unconfigured "after"
build is byte-identical to its predecessor on every target; the boot
banner's new profile-identity string makes that false for freertos_x5h
specifically (Zephyr/S32Z2/POSIX are unaffected). Reword both comments
to state what actually holds: identical parameter values and code
everywhere, identical .rodata except for that string on freertos_x5h.

Also apply the after/before convention consistently to the diag ELF
contract re-verification steps (they build an "after" image but omitted
the argument), and document --param-profile, check-elf-contract.sh's
full argument list, and the two CI artifact names in the freertos_x5h
README.

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
The usage block in the freertos_x5h README sat inside a runnable bash
fence but carried placeholder arguments. A verbatim copy-paste failed
with CONTRACT_FAIL, because the script looked for the literal string
'[service-name]' in .rodata. Use the real values for the default build
instead, and say in the prose what to change for a before build.

Also align the copyright line of actuation_param_profile.h with the
convention the rest of this tree uses for 2026-dated files: 49 files
carry 'Arm Limited and contributors.' and 9 carry 'Arm Limited.'

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Stacked fork PRs against feat/freertos-x5h-netif never matched
pull_request: branches: [main], and push: on the head branch does not
create upstream checks. Include the stacked base so the before-profile
job actually runs.

Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com>
Do not enumerate stacked head/base branch names. An unfiltered
pull_request trigger covers PRs against main and feature-branch bases.

Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com>
pull_request (unfiltered) plus workflow_dispatch is enough. Listing
feature-branch names under push: was the same one-off trigger pattern.

Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com>
@oguzkaganozt
oguzkaganozt merged commit 9a4d7f1 into autowarefoundation:feat/freertos-x5h-netif Sep 23, 2026
4 checks passed
oguzkaganozt pushed a commit that referenced this pull request Oct 8, 2026
#47 merged into feat/freertos-x5h-netif 17 seconds after #45 had
squash-merged that branch into main. Its content therefore never
reached main: actuation_param_profile.h, the build.sh
--param-profile switch, the profile argument of
check-elf-contract.sh and the before-profile CI artifact are all
missing there. This re-applies the reviewed #47 squash commit
(9a4d7f1) to main unchanged.

The CI trigger change in it also matters for the stack above:
pull_request is unfiltered, so a stacked pull request whose base
is not main still runs this workflow.

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
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.

2 participants