MCUBoot Update hooks - Rejects any mcuboot updates when used with immutable bootlader

Dear nordic,

state of your MCUBoot + Immutable bootloader is just awful. 


Please fix this hook, when enabled it disables updates of the mcuboot bootloader when used with immutable bootloader.
This issue is detected upon next mcuboot update, however then it is too late it will brick all devices due to next update rejection.

https://github.com/nrfconnect/sdk-mcuboot/blob/bf00840a090f396ec1554968e19fa0e02c077d38/boot/zephyr/hooks_sample.c#L57



PS: 

MCUBoot + Immutable bootloader used with external flash does not work due reading the header directly from memory instead of the Flash_area. Honestly did you even tried it ? 
https://github.com/nrfconnect/sdk-mcuboot/blob/bf00840a090f396ec1554968e19fa0e02c077d38/boot/bootutil/src/loader.c#L920
https://github.com/nrfconnect/sdk-mcuboot/blob/bf00840a090f396ec1554968e19fa0e02c077d38/boot/bootutil/src/loader.c#L934

I would submit a patch however you have disabled any issue to the repository. Should i just create pull request ?

Parents
  • optical said:
    What is the correct procedure for updating the bootloader ? We are currently using mcumgr upload -> test -> restart. This is works the main down fall of this method is that after second update(v1(s0) -> v2(s1) -> v3(s0)) the image swaped out from the s0 image will be marked as Test. This leads to bricking the device due to mcumgr not able to erase image marked as test and the update procedure will not unmark(test) the image in the secondary slot.

    Usually when using TEST with MCUboot, the image will revert after unless you are confirming the image, right.

    Do you confirm the image in MCUboot when you do this?

    If not, do the MCUboot image revert each time you reset?

    Regards,
    Sigurd Hellesvik

  • The procedure for updating bootloader does not support the revert feature. By my opinion. Because this is handled by the immutable bootloader.  


    I'm asking for application note or documentation, which exactly describes procedure for updating the MCUBoot Bootloader using Mcumgr. 

  • Hi,

    Just as a note: I will get ti the rest of the things you ask about also, I just started in an end to get more insight into this case.

    If the bootloader does not support the revert feature, can you try to use "confirm" instead of "test"?
    Then maybe you will no longer get the following error:

    optical said:
    This leads to bricking the device due to mcumgr not able to erase image marked as test and the update procedure will not unmark(test) the image in the secondary slot.

    For your question:

    optical said:
    I'm asking for application note or documentation, which exactly describes procedure for updating the MCUBoot Bootloader using Mcumgr. 

    It is unofficial, but I made a sample to test updatable bootloaders at Sample on how to use NSIB(b0) to update MCUBoot feat. SMP Server.

    Is this the kind of thing you are asking for, or do you want something more detailed?

    optical said:
    Do you experience this issue as well ?

    When I test my sample linked above, I am able to do v1(s0) -> v2(s1) -> v3(s0)->v4(s1)->v5(s0). I stopped there cause I guess that proves that it workes for me.
    This is what you wanted me to test right?

    Regards,
    Sigurd Hellesvik

Reply
  • Hi,

    Just as a note: I will get ti the rest of the things you ask about also, I just started in an end to get more insight into this case.

    If the bootloader does not support the revert feature, can you try to use "confirm" instead of "test"?
    Then maybe you will no longer get the following error:

    optical said:
    This leads to bricking the device due to mcumgr not able to erase image marked as test and the update procedure will not unmark(test) the image in the secondary slot.

    For your question:

    optical said:
    I'm asking for application note or documentation, which exactly describes procedure for updating the MCUBoot Bootloader using Mcumgr. 

    It is unofficial, but I made a sample to test updatable bootloaders at Sample on how to use NSIB(b0) to update MCUBoot feat. SMP Server.

    Is this the kind of thing you are asking for, or do you want something more detailed?

    optical said:
    Do you experience this issue as well ?

    When I test my sample linked above, I am able to do v1(s0) -> v2(s1) -> v3(s0)->v4(s1)->v5(s0). I stopped there cause I guess that proves that it workes for me.
    This is what you wanted me to test right?

    Regards,
    Sigurd Hellesvik

Children
No Data
Related