MCU BOOT - Possible to use second partition as temporary data storage?

Hi there,

My compiled image size in ROM is ~200kb.

I have 2 MCUboot partiitons, each 228kB.

I wanted to ask- is it possible for the application to use the second (non active) MCUboot partition to store some data (~150kB) for the user application.

It is acceptable that this data is lost during OTA.

Thanks!

Parents
  • Hello,

    MCUboot uses the secondary slot to store the new firmware during an OTA update. However, the bootloader only checks the secondary slot when performing an upgrade. It doesn't check every byte of the secondary slot at boot, which means it doesn’t monitor or control the secondary partition unless an OTA is being processed. If the firmware in the secondary slot is invalid, the bootloader may erase the entire secondary slot, depending on how it's configured. This could lead to the data stored there being erased during a boot or upgrade process. 

    So technically it is possible to use the secondary slot to store the user data. Since you said it's okay to lose this data during an OTA update, the main risk is accidentally deleting it when the bootloader checks the backup slot.

    Kind Regards,

    Abhijith

  • Great thanks that helps answer my question.

    Another question I have- does MCUboot alternate which slot it uses?

    As an example, the chip is first flashed with the firmware on slot 1. An OTA is started, and it downloads the new firmware to slot 2. It then boots the app from slot 2. Is that correct?

    If that is the case, is there a way for my application to track which slot it’s running in and determine the flash address for the unused slot accordingly?

    Thanks

Reply
  • Great thanks that helps answer my question.

    Another question I have- does MCUboot alternate which slot it uses?

    As an example, the chip is first flashed with the firmware on slot 1. An OTA is started, and it downloads the new firmware to slot 2. It then boots the app from slot 2. Is that correct?

    If that is the case, is there a way for my application to track which slot it’s running in and determine the flash address for the unused slot accordingly?

    Thanks

Children
No Data
Related