Make mcuboot select recovery app

Hello

We are planning to build a product without physical pins and currently evaluating different recovery options. For that we want to use OTA via BLE/SMP in a dedicated recovery app. Following this thread it is not advised to add the BLE stack to the mcuboot itself so we thought about writing a regular Zephyr app that is loaded when a bootstrapping pin is active or something similar.

The documentation of mcuboot here describes the capabilities of mcuboot to have multiple application images but it sound like these are only intended as library/soft-device type of dependencies for the application in use.

What we are thinking of would look like the following:

+-------------------+
|       NSIB        |
+-------------------+
|   mcuboot 0       |
+--------------------+
|   mcuboot 1        |
+--------------------+
|    app primary     |
+--------------------+
|    app secondary   |
+--------------------+
| recovery primary   |
+--------------------+
| recovery secondary |
+--------------------+

and when the bootstrap pin condition (or something similar) is given mcuboot boots the recovery app (execute in place) or deletes the primary app and copies the recovery app before booting it.

The question now is: Is this possible with stock mcuboot? Would a modification of it be reasonable to do? Is there maybe another, more elegant way of handling the situation?

Thanks in advance

Patrick

Related