Repository navigation
mgmt: mcumgr: img_mgmt: is a slot partition on a disabled device supported? #125900
Unanswered
TheArkadiuszGrzelka
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
img_mgmt_flash_area_id()maps a slot when its partition node exists, but the flash map has no area for a partition on a disabled device. For that slot,img_mgmt_erased_val()andimg_mgmt_slot_info()log an error on every request.No upstream board or sample does this. The known trigger is nRF Connect SDK on nRF5340:
flash_sim.overlayputsslot2_partitionon a disabled flash simulator with 2 updatable images. Nordic lists it as NCSDK-21790, wontfix in v2.4.0 to v3.0.2, and occurs on v3.4.0.nrfconnect/sdk-zephyr#1176 proposed ERR to WRN and was closed. The MCUmgr maintainer said the image count should not be 2 if the application cannot use both, and that it is an application configuration bug. Image 1 is updatable through slot 3; only slot 2 is unreachable.
Reproducer: a native_sim suite on main with
slot2_partitionon a disabledzephyr,sim-flashlogs one error per state read and per slot info read. Option 1 below makes it pass.Is this layout supported? If not, the fix belongs in nRF Connect SDK. If so, two options:
img_mgmt_flash_area_id()returns -1 for a slot without a flash area. Erase and read of it returnIMG_MGMT_ERR_INVALID_SLOTinstead ofIMG_MGMT_ERR_FLASH_OPEN_FAILED.read_boot_swap_state()asserts on -1 in direct-XIP-with-revert modes.All reactions