Skip to content

RadioFoundry: pin, build and install firmware; stop losing TX contacts - #54

Merged
emuehlstein merged 5 commits into
mainfrom
feat/radiofoundry-firmware
Dec 3, 2026
Merged

emuehlstein merged 5 commits into
mainfrom
feat/radiofoundry-firmware

Conversation

@emuehlstein

Copy link
Copy Markdown
Contributor

Pins the firmware on RadioFoundry radios, and fixes a codeplug bug the bench test of that work exposed.

Firmware: pin, build, install

All keyed on VERIFIED_REVISIONS, the list that already pins the RadioFoundry checkout.

  • program gate. Reads the commit the radio reports in cps_client info, logs it, and refuses a write to firmware that is not a verified revision. --allow-unverified-firmware opts in.
  • codeplugger firmware build. Compiles a radio's image from a scratch clone of the checkout at one commit, in the toolchain container that commit pins, and compares its SHA-256 with radios/<id>/firmware.lock.json. The board comes from a new radiofoundry_firmware capabilities block.
  • codeplugger firmware install. Flashes a locked image through upstream's rfoundry, showing its plan first and afterwards requiring the radio to report the commit that was sent.

radiofoundry-cps: TX contacts were being lost behind a clean verify

qdmr's encoder writes a channel's TX contact or its group list, never both, and gives every contact a TS1 override. RadioFoundry's codeplug_port.py undoes both, but it finds channels by qdmr's indentation and read codeplugger's export as empty lists, so neither fix-up ran. Both verify steps compare the radio with the encoded image, so they passed.

The backend now hands upstream a re-indented copy of the export, and refuses an image whose TX contacts or contact timeslot overrides differ from the export.

Verified

  • Builds reproduce byte for byte at 62db1bae for dm32, dm1701 and mduv380 (amd64 emulated on an Apple silicon Mac); the lock files record the hashes. Upstream has no published release to compare with.
  • Install: one RT3S, from acd7cd69 down to the locked 62db1bae image. The radio came back reporting that commit with the commit's own build stamp.
  • Gate: refused that RT3S at acd7cd69; passed it and a DM-32UV at 62db1bae through full program --confirm runs.
  • Contact fix: an RT3S and a DM-32UV written through the fixed path both read back with 38 of 38 TX contacts and no timeslot overrides, compared against the export. Before the fix both held 9 TX contacts and a TS1 override on all 23 contacts.

Not verified

  • firmware install on the DM-32UV (a different flashing route) and the DM-1701.
  • The DM-1701 written on 2026-12-01 went through the old conversion path and has not been read back or re-programmed. Its hw flag on the site rests on that write; site/radios.json is unchanged here.

emuehlstein and others added 5 commits December 2, 2026 18:06
A RadioFoundry radio's codeplug is written into a layout its firmware
defines, so the radio is only reproducible when the firmware is pinned
too. Three pieces, all keyed on VERIFIED_REVISIONS:

- program reads the commit the radio reports in cps_client info, logs
  it, and refuses a write to firmware that is not a verified revision
  (--allow-unverified-firmware opts in).
- firmware build compiles a radio's image from a scratch clone of the
  RadioFoundry checkout at one commit, in the toolchain container that
  commit pins, packages it with upstream's release.py, and compares its
  SHA-256 with radios/<id>/firmware.lock.json. The board comes from a
  new radiofoundry_firmware capabilities block.
- firmware install flashes a locked image through upstream's rfoundry,
  showing its plan first and afterwards requiring the radio to report
  the commit that was sent.

Builds reproduce at 62db1bae for dm32, dm1701 and mduv380 under amd64
emulation on an Apple silicon Mac; the lock files record the hashes.
The install path and the program gate have not run against a radio.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bench run on an RT3S: the radio answered nothing over CPS or the debug
link until it was reset and recabled. After a flash that would have
surfaced as a bare "info failed", with no hint that rfoundry had already
written the image. The post-flash identity read now gets the read-back
retry budget, and a silent radio is reported as a finished flash that is
not confirmed, with how to check it.

Also records what the bench run showed: the RT3S reported acd7cd69 and
the firmware check refused it, and firmware install without --confirm
ran through rfoundry's plan against the radio with nothing written.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
An RT3S running acd7cd69 was refused by the firmware check, then
flashed to the locked 62db1bae image with firmware install: rfoundry
kept the codec and rewrote sectors 3 to 9, and the radio came back
reporting 62db1bae with build stamp 20261130182236, the commit's own
time, and passes the check.

It was the second attempt. The first failed within a second of the plan
and its output was not kept; three plan-only runs back to back
afterwards each found the radio, so the cause is unknown and is listed
as such. The DM-32UV and DM-1701 have not been flashed this way.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
An RT3S programmed through this backend read back clean while holding 9
of its profile's 38 TX contacts and a TS1 override on all 23 contacts.

qdmr's open-firmware encoder writes a channel's TX contact or its group
list, never both, and gives every contact a TS1 override. RadioFoundry's
codeplug_port.py undoes both, but it finds channels and contacts by
qdmr's indentation and reads a list whose items start in column zero as
empty. Codeplugger's export is written that way, so neither fix-up ran
and neither said so. Both verify steps compare the radio with the
encoded image, so they passed.

- Hand upstream a copy of the export re-indented the way qdmr writes it.
- Decode the image and compare it with the export; refuse an image in
  which a channel lost or changed its TX contact, or a contact carries a
  timeslot override the export did not ask for.

Hardware-verified on the RT3S (eam_rt3s_01, RadioFoundry 62db1bae): 29
contacts put back, 23 overrides cleared, 52 bytes changed, and the
decoded read-back compared with the export shows no differences. This
was also the first program --confirm through the firmware gate.

The DM-1701 and DM-32UV written on 2026-12-01 went through the old path
and need re-programming; the docs now say so.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A DM-32UV carrying the 279-channel bench codeplug from the old
conversion path was read before being re-programmed: none of its 31 DMR
channels with a group list had a TX contact, and all 23 contacts carried
a TS1 override. That confirms on a second model what the RT3S showed.

It was then written through the fixed path with the same codeplug as the
RT3S, passing the firmware gate on 62db1bae. The byte compare differed
in 4,541 bytes of VFO scratch and padding that equal the pre-write
backup, and the decoded read-back compared with the export shows no
differences: 38 of 38 TX contacts, no timeslot overrides.

The DM-1701 is the one radio from the old path still unchecked.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@emuehlstein
emuehlstein merged commit 6e8a288 into main Dec 3, 2026
2 checks passed
@emuehlstein
emuehlstein deleted the feat/radiofoundry-firmware branch December 3, 2026 01:08
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