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

Parents
  • Hi Rytis,

    Am I right to understand that:

    1. The mobile phone app can connect to all devices in your topology, even though the image doesn't show that.
    2. You want the DFU process to run over your own protocol

    If so then I am afraid we don't have an out of the box solution in the nRF5 SDK, but it's solely due to point 2.

    However, the nRF Connect SDK's DFU solution works exactly as you want. Is changing to this SDK an option for you? We recommend NCS for all new projects anyway, as the nRF5 SDK is in maintenance mode.

    If you must stay with the nRF5 SDK, could you please elaborate why you need the image encapsulated in your protocol, so that we can help you look for solutions?

    Please keep in mind that the nRF5 SDK solution already supports encryption of the image, as well as encryption of the connection via BLE bonding.

    Hieu

  • Hello,

    1. Only one device(peripheral) is advertising, other devices(mobile phone + central1 and central2 devices) connects to this peripheral, so mobile phone connects to only one device directly.

    2. Preferably yes.

    We are woried about porting whole project to nRF Connect SDK. We do not have much experience with this SDK and Zephyr OS, so we would like to stick with nRF5 SDK + freeRTOS.

    New FW image encapsulated to our own protocol looked like easiest solution, but now I can see that is is wrong assumption :) 

    According information i found there are three ways: 

    * Adopt system to use nRF5 SDK DFU procedure. Am I right what this solution is älmost ready to use in iOS and Android?

    * Try to understand and adopt background DFU project from this post (not easy to find this ticket)

    * Write our own custom solution + custom bootloader.

    Rytis 

Reply
  • Hello,

    1. Only one device(peripheral) is advertising, other devices(mobile phone + central1 and central2 devices) connects to this peripheral, so mobile phone connects to only one device directly.

    2. Preferably yes.

    We are woried about porting whole project to nRF Connect SDK. We do not have much experience with this SDK and Zephyr OS, so we would like to stick with nRF5 SDK + freeRTOS.

    New FW image encapsulated to our own protocol looked like easiest solution, but now I can see that is is wrong assumption :) 

    According information i found there are three ways: 

    * Adopt system to use nRF5 SDK DFU procedure. Am I right what this solution is älmost ready to use in iOS and Android?

    * Try to understand and adopt background DFU project from this post (not easy to find this ticket)

    * Write our own custom solution + custom bootloader.

    Rytis 

Children
No Data
Related