Skip to content

feat(flash): flash and provision a left/right pair with two J-Links - #370

Merged
TobiasRoeddiger merged 2 commits into
mainfrom
codex/dual-jlink-flasher
Oct 23, 2026
Merged

TobiasRoeddiger merged 2 commits into
mainfrom
codex/dual-jlink-flasher

Conversation

@TobiasRoeddiger

Copy link
Copy Markdown
Member

Adds tools/flash/flash_pair.sh to program two earables concurrently and provision their left/right roles, hardware revision, and shared pair identity in one command. The script runs on Bash 3.2+ without Python.

bash tools/flash/flash_pair.sh \
  --left-snr 123456789 --right-snr 987654321 \
  --hw 2.0.1 --build-dir ./build_fota

The script validates both probes and backs up each device's UICR before erasing. It derives the pair ID using the firmware's normal chip-ID XOR calculation, verifies both core images and configuration readback, then resets both devices only after both have passed. Per-probe locks prevent overlapping pair-script runs, and separate logs/backups are retained under the selected build directory. The known Nordic worker-process crash is retried once with the same command. --dry-run validates the plan without accessing hardware.

This is full provisioning: existing phone bonds and previous pair configuration are erased. Stock 2.3.0 ignores the stored pair identity for CSIP; use the 2.3.1 firmware fix in #369 or another firmware version that honors it.

Also adds a concise tools/flash/README.md covering the purpose, prerequisites, options, and configuration-retention behavior of all six scripts in that folder.

Validation:

  • Bash 3.2 syntax, help, dry-run, and whitespace checks passed.
  • Local mocked-command checks covered concurrent programming, reset ordering, input validation, backup failures, malformed chip IDs, programming/write/readback failures, and bounded worker-crash retries. No test files are included in this PR.
  • Live parallel flashing with two J-Link BASE Compacts, hardware 2.0.1, and the compiled 2.3.1 FOTA build passed image and configuration verification; both application boot logs reported 2.3.1.
  • Runtime limitation: the left device started Bluetooth advertising, while the right remained in charging activity during capture. End-to-end Bluetooth pairing is not yet verified; the script explicitly reports that programming success does not establish runtime Bluetooth success.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

✅ Unit tests passed

5 passed, 0 failed/error, 0 skipped — view workflow run

Test scenario Platform Result
openearable.unit.sensor_component native_sim/native/64 ✅ passed
openearable.unit.sensor_transport native_sim/native/64 ✅ passed
openearable.unit.ring_buffer native_sim/native/64 ✅ passed
openearable.unit.audio_encoder native_sim/native/64 ✅ passed
openearable.unit.audio_startup native_sim/native/64 ✅ passed

Download the unit-test-results artifact for full Twister reports and logs.

@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.zip
openearable_v2_fota.zip

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Compiler warnings

The extended-warning build completed successfully.

Application compiler warnings

Show warnings
unicast_server/main.cpp:78:33: warning: 'int usb_enable(usb_dc_status_callback)' is deprecated [-Wdeprecated-declarations]

View this workflow run

@github-actions

Copy link
Copy Markdown

CodeChecker static analysis

✅ No non-style issues found.

@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.zip
openearable_v2_fota.zip

@TobiasRoeddiger
TobiasRoeddiger merged commit 5ad1fd2 into main Oct 23, 2026
4 checks passed
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