Repository navigation
fix(kaos): Keep a C5 update through the board's next reset - #101
Merged
Merged
Conversation
A closed C5 rolls a new image back at its next reset unless a request reached it first. A software reset after an update now leaves an UPDATE note, and the next boot keeps the C5 running whatever the role and the wish.
An update ends with no link this boot, and the next boot reset the C5 before linking, so a closed C5 rolled every update back. AO_Radio now restarts the board 3.5 s after the update, leaves the UPDATE note and never holds the C5 meanwhile. The next boot brings the link up even with no radio wanted, and its first request confirms the image.
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.
Description of Change
A closed C5 never kept an update. Its build has app rollback on, and it confirms a new image at the first KODE request it receives. After
install dst=c5the update ends with the link down for the rest of the boot. The next boot's bring-up reset the C5 before any request reached it, so the bootloader found the image still pending and went back to the old one. The>okwas right, the update was activated, and a reset later it was gone.This change keeps the C5 running until a link has reached the new image:
KDRV_RADIO_NOTE_UPDATE. After a software reset it keeps the C5 whatever the role and the wish.kdrv_radio_note_update_waits()reads it at boot without erasing it.KDRV_RADIO_C5_ACTIVATE_MS, esp-hosted's restart delay, plusKDRV_RADIO_C5_BOOT_MS), then asks AO_Boot to restart the board (boot_exit_evt()). The park answer leaves the UPDATE note, andRadio_offdoes not hold the C5 meanwhile.A C5 without rollback (the open build) behaves as before, except that the board now restarts by itself after an update.
Test Scenarios
tools/host_tests.sh: 5257 cases across 8 suites. New cases cover the note rule, the restart after 3.5 s (asked once), the UPDATE note on the park, no hold after an update, and the link brought up for an update with nothing wanted.tools/check_layers.shclean.tests/targetbuilds on v6.1, full andnowifi, no warnings; RAM and starts checks pass.wifi_frames ch=6 ms=1000: v0.1.0 answersno_service, v0.1.1 has the service and answerswifi_off.>ok(SW_CPU_RESET), the boot saysC5 kept: it runs an update its first request confirms, the link is up in 0.85 s. Two port-open resets later, each one resetting the C5 (link up in 2.7 s), it still runs v0.1.1.Identity, vault and BLE keys untouched in every run (
id=locked vault=1 btkeys=6).Related links
kode_slave_c5v0.1.1 on a closed C5: the image was accepted and activated, then rolled back at the next reset.tools/kcli.py(the board restarts by itself afterinstall --dst c5).