Repository navigation
Add SoundCard PIC32 firmware updates - #55
Merged
Merged
Conversation
The new client implements the host side of Microchip AN1388, the serial bootloader on the PIC32 co-processor of the SoundCard. It reads the bootloader version, erases application flash, programs the records of an Intel HEX image and verifies the flash CRC against it. A program frame is never resent, since flash cannot be programmed again without an erase. The CI workflow now downloads two SoundCard release images, pinned by SHA-256, for the tests that program a real image.
Updating SoundCard firmware now also writes the PIC32 coprocessor image, which must sit next to the firmware file under the same name with a .PIC32 or legacy .X suffix after the device name. The update refuses to start when the coprocessor image is missing, and writes the coprocessor first. The coprocessor update switches the serial port to the PIC32 bootloader through register 82, writes and verifies the image at 115200 baud, and clears the register so the coprocessor restarts on its own. The record that holds the application reset address is written last, so an interrupted update leaves the coprocessor in its bootloader.
glopesdev
requested review from
MicBoucinha,
artursilva0,
bruno-f-cruz and
filcarv
October 22, 2026 17:33
Contributor
Author
|
Thanks @artursilva0 for trying this out independently. A build of the v3.0 test firmware was written to a SoundCard with the update command from this pull request, and a sound played successfully afterwards. This confirms that the coprocessor application starts after the update, which is the one step the device cannot report by itself. Together with the fw3.0 to fw2.2 update described above, this covers both directions, so I will go ahead and merge. |
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.
This adds firmware updates for the PIC32 coprocessor of the SoundCard, so the
updatecommand can write both processors of a SoundCard on any platform.Harp.Toolkit.Coregains a client for the Microchip AN1388 serial bootloader on the PIC32, in the newHarp.Toolkit.Firmware.PIC32namespace. It reads Intel HEX images record by record, and erases, programs and verifies application flash against a CRC computed from the image. A program frame is never resent, since flash cannot be programmed again without an erase. The SoundCard sequence inHarp.Toolkit.Firmware.SoundCardswitches the serial port to the PIC32 bootloader through register 82, runs the update at 115200 baud, and clears the register so the coprocessor restarts on its own. The record that holds the application reset address is written last, so an interrupted update leaves the coprocessor in its bootloader rather than running an incomplete image.The
updatecommand keeps its single firmware argument. When the image is for the SoundCard, the coprocessor image must sit next to it under the same name with a.PIC32suffix after the device name, or the legacy.X, and the update writes the coprocessor first. Without the coprocessor image the update refuses to start, so both processors always run the same release, and a SoundCard can no longer be updated with its ATxmega image alone.The CI workflow now downloads two SoundCard PIC32 release images, pinned by SHA-256, for tests that program a real image into an emulated bootloader.
An update from fw3.0 to fw2.2 completed on a hardware 2.2 SoundCard, including the CRC check of the coprocessor flash. The device does not report when the coprocessor application is running, so the update waits a fixed two seconds after clearing register 82.
Closes #9