Repository navigation
Flash the SDK's merged hex for sysbuild builds; ask for pin reset after nRF91 UICR write (0.7.1) - #29
Merged
Merged
Conversation
Sysbuild builds without Partition Manager were flashed as two probe-rs downloads: the non-application images (here only the nRF9151 Feather's UICR image) merged into zephyr-tools/bootloaders.hex, then the application. The chip reset between the sessions with UICR written but no application to reopen the debug port, so the nRF91x1 locked it and the application download failed. Flash merged_<board_target>.hex from SB_CONFIG_MERGED_HEX_FILES instead, one download per board target in domains.yaml flash_order. The board or project enables it; if the file is missing, flashing fails with a message saying to set it. The UICR strip/erase step is unchanged. Removes the bootloader split, its forced --preverify, and the hex merge and range helpers only it used.
New UICR values, APPROTECT included, only take effect after a pin or power-on reset. After a flash that writes UICR (the erase path), the nRF91 locks its debug port as soon as the probe-rs session ends, so the post-flash probe-rs reset always failed with an erase_all permission error. The Feather's onboard probe has no reset line, so --connect-under-reset doesn't help. Skip the reset in that case and tell the user to press the board's reset button or power-cycle it. Flashes where UICR already matches are unchanged.
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.
Summary
merged_<board_target>.hexfor sysbuild builds (NCS 3.5+). Previously the non-application images (on the nRF9151 Feather, only the UICR debug-access image) were merged intozephyr-tools/bootloaders.hexand flashed in a separate probe-rs session from the application. The chip reset between sessions with UICR written but no application to reopen the debug port, so the nRF91x1 locked it and the application download failed. Now the SDK's merged hex (fromSB_CONFIG_MERGED_HEX_FILES) is flashed in one download per board target indomains.yamlflash_order. If it's missing, flashing stops with a message saying to set the option. The extension doesn't add any hidden-Dto the build; the board or project enables it (nfed'sfeather_nrf9151defaults it on).probe-rs resetalways failed with anerase_allpermission error. The Feather's onboard probe has no reset line, so--connect-under-resetdoesn't help. In that case the reset is skipped and the user is asked to press reset or power-cycle. Flashes where UICR already matches are unchanged.--preverify, and the hex merge/range helpers only it used.Behavior change
Sysbuild builds flashed with probe-rs need
SB_CONFIG_MERGED_HEX_FILES=y. Partition Manager builds (NCS ≤ 3.4) and single-image builds are unaffected.Testing
npm run check-types,npm run lint,npm test(70 passing).ret_lxmf, NCS 3.5,CONFIG_NRF91_ANOMALY_36_WORKAROUND=y): after a recovery erase, a singleprobe-rs download --verifyof the merged hex succeeds, UICR then reads0x50FA50FAat0xFF8000/0xFF802C, and the chip is locked until the reset button is pressed or the board is power-cycled. After that,probe-rs resetsucceeds and the chip stays unlocked.