OTA from application layer

Hello,

We develop system with BLE topology as shown in Figure 1. SDK17.1.0 is used.

Figure 1.

Mobile phone sends various commands to peripheral device over custom BLE service. Comands are encapsulated in our protocol. Peripheral device decides if command is for peripheral or for central 1 or for central 2(could be more than 2 centrals) and forwards commands to coresponding central device. We develop both central and peripheral devices and use NRF52840. In this topology mobile phone is connected to only one peripheral device but could communicate with all devices.

We are looking for way how to perform OTA of application in this connection tolopogy. It seems to me that most simple way is to use dual bank memory layout as shown in Figure 2.

Figure 2.

Usind dual bank layout application running in bank 0 could receive encapsulated image and write it to bank 1. When the whole image is received, application tell bootloader to run bank 1 and reboot. This methot is tested and works great with other MCU's family(NXP, ESP32). Is there any example or instructions how to achieve this kind of OTA in NRF52 MCU? Default DFU with secure bootloader is not very suitable because we want to send image encapsulated in our protocol to any of devices(from figure 1) from mobile phone so OTA must be done in application layer. Encryption with public and priavte keys is wanted feature.

My question: is there any API or solution or example or tutorial how to achieve this kind of OTA sequence?

Have a nice day,

Rytis

Related