Repository navigation
RadioFoundry: pin, build and install firmware; stop losing TX contacts - #54
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.programgate. Reads the commit the radio reports incps_client info, logs it, and refuses a write to firmware that is not a verified revision.--allow-unverified-firmwareopts 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 withradios/<id>/firmware.lock.json. The board comes from a newradiofoundry_firmwarecapabilities block.codeplugger firmware install. Flashes a locked image through upstream'srfoundry, 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.pyundoes 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
62db1baefordm32,dm1701andmduv380(amd64 emulated on an Apple silicon Mac); the lock files record the hashes. Upstream has no published release to compare with.acd7cd69down to the locked62db1baeimage. The radio came back reporting that commit with the commit's own build stamp.acd7cd69; passed it and a DM-32UV at62db1baethrough fullprogram --confirmruns.Not verified
firmware installon the DM-32UV (a different flashing route) and the DM-1701.hwflag on the site rests on that write;site/radios.jsonis unchanged here.