mcuboot test image became active confirm without external confirm from mcumgr

I am testing with NCS 2.3.0,  nrf5340dk, on an application based on smp_svr sample.

I was testing with mcumgr  and found an unexpected behavior.  Maybe its a feature I have unwittingly enabled. 

I added the configuration from nrf/tests/modules/mcuboot/external_flash to my smp_server sample based application. 

I used mcumgr image upload to send the file

I did mcumgr image test <hash>  to prepare the test. 

I triggered a reset (reset button) and on my next call to image list, only 1 image was found and it was active confirmed state.  I thought this would only be allowed if I used mcumgr to confirm the image.

Did I unknowingly disable the image swap feature from mcuboot when I copied the externa_flash test?

Is this somehow part of the serial recovery settings in the externa_flash test?

Parents
  • Hi,

    First a note: The test you use have been updated in v2.4.0, I suggest looking at the changes to child image configuration, which makes it configure the MCUboot child image properly.

    Then to your question:

    Serial Recovery will overwrite the primary slot, and by default not interact with the secondary slot.
    So what you explain is expected.

    I have written a little intro to MCUboot + samples at https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples. (not official)

    Give it a read, and let me know if you got any questions.

    Regards,
    Sigurd Hellesvik

  • Thanks for the link to your (unofficial) documentation. 

    As I understand it, serial recover should be a serial interface from mcuboot, right? 

    I sent the image using the application running the smp server, NOT serial recovery so it should not have overwritten the primary slot.   Further it only performs the update after i have marked it for TEST and then perform a reset. It Is not marked CONFIRM, yet the image is still written into the primary slow instead of being temporarily swapped.

    However perhaps when serial recover is enabled the behavior to always overwrite the primary slot becomes the default?  I will remove the serial recover options and re-test to see if this behavior goes away.   If it does, then I feel this is a bug.  The serial recovery behavior should only be active when mcuboot recieves the image via serial, not when the application / smp server writes it into the secondary slot and clearly marks it as a test image.

Reply
  • Thanks for the link to your (unofficial) documentation. 

    As I understand it, serial recover should be a serial interface from mcuboot, right? 

    I sent the image using the application running the smp server, NOT serial recovery so it should not have overwritten the primary slot.   Further it only performs the update after i have marked it for TEST and then perform a reset. It Is not marked CONFIRM, yet the image is still written into the primary slow instead of being temporarily swapped.

    However perhaps when serial recover is enabled the behavior to always overwrite the primary slot becomes the default?  I will remove the serial recover options and re-test to see if this behavior goes away.   If it does, then I feel this is a bug.  The serial recovery behavior should only be active when mcuboot recieves the image via serial, not when the application / smp server writes it into the secondary slot and clearly marks it as a test image.

Children
No Data
Related