This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU at the Application level

Hi

I want to move DFU at the application level. Is this possible? I want to move DFU at the application level because of my project requirement. 

1. In my project, I have two controllers one is nRF for BLE functionality, other is STM for other applications.

2. nRF is responsible for transferring the FW image of the STM controller.

3. I can go with any BLE DFU or Serial DFU.

4. So the nRF controller will get the FW image of the STM controller.

5. Using Proprietary protocol nRF will send the firmware of STM to the STM controller. We cannot move our proprietory protocol to the nRF bootloader. Bootloader should not contain and application-level logic.

6. Here is the SW flow which I want. serial nrfutils --> nRF DFU --> Proprietary protocol for FW transfer --> Ack from STM( Proprietary protocol)--> Ack to nRF utils.

I want to hold my acknowledgment to serial nrfutil till I get acknowledgment from STM.

Is it possible or not? 

Parents
  • Hi,

    It should definitely be possible, but I suggest you spend some time figuring out how you can best do it. Also, depending on what is available for the STM it might involve quite a bit of work.

    I think we need to split this into two problems. If you want to program the nRF via DFU which is handled mostly by the application in the background, this is supported by the nRF5 SDK since SDK 15.3. However, there is no example, but Vidar made an example here, which uses a serial protocol. I suspect that can be used as a basis for you as well if that is your use case. See this thread for details.

    However, in most of the question describes how to update the STM from the nRF. Then you need a DFU bootloader mechanism on the STM, and the nRF would have to act as a DFU master for it. I do not know what they provide in that regard. Then you need some code to run on the nRF to handle this, including a way to transfer the data to the nRF etc.

    I suspect it may be better to split this problem in the two above since the update of the nRF itself and STM should not be directly linked. And in that case, maybe you can keep the normal (non-backround) DFU for updating the nRF, and just implement support for updating the STM in the application in the nRF. How you do this is up to you and will be tightly coupled with the STM DFU system which I have no knowledge about.

Reply
  • Hi,

    It should definitely be possible, but I suggest you spend some time figuring out how you can best do it. Also, depending on what is available for the STM it might involve quite a bit of work.

    I think we need to split this into two problems. If you want to program the nRF via DFU which is handled mostly by the application in the background, this is supported by the nRF5 SDK since SDK 15.3. However, there is no example, but Vidar made an example here, which uses a serial protocol. I suspect that can be used as a basis for you as well if that is your use case. See this thread for details.

    However, in most of the question describes how to update the STM from the nRF. Then you need a DFU bootloader mechanism on the STM, and the nRF would have to act as a DFU master for it. I do not know what they provide in that regard. Then you need some code to run on the nRF to handle this, including a way to transfer the data to the nRF etc.

    I suspect it may be better to split this problem in the two above since the update of the nRF itself and STM should not be directly linked. And in that case, maybe you can keep the normal (non-backround) DFU for updating the nRF, and just implement support for updating the STM in the application in the nRF. How you do this is up to you and will be tightly coupled with the STM DFU system which I have no knowledge about.

Children
  • Hey Einar 

    Thank you so much for your response.

    First, let me clear some of the requirements of my project. It looks like you are confused with my original post.

    In my system, there are 2 controllers. One is nRF and the other one is STM. STM controller will always act as a master. I want to download the STM application using nRF DFU. Currently, I don't want to update nRF. 

    Using serial or BLE transport medium, nRF should get a firmware package of STM. The DFU should not write it in an internal staging area. Instead of that, the nRF application has to transfer that data to STM using a proprietary serial protocol. The nRF application must have to hold acknowledgment to DFU host until the nRF application gets the ACK from the STM controller for proprietary message transfer.

    Once the nRF application gets the ACK from STM for their proprietory message then the nRF application will send ACK to DFU host. STM application will handle everything. The nRF application should not worry about the STM upgrade.

    nRF application just has to get data using nRF DFU and then transfer the received data to STM using a proprietary protocol. Because of this, I want to move the DFU to the application.

     

    I hope you get more clarity with this answer. 

  • Kaival said:
    I want to download the STM application using nRF DFU. Currently, I don't want to update nRF. 

    OK, now I see. I don't understand why you want to use the nRF DFU protocol in this case, though. But if you want to reuse it, I do not see a problem with it, other than that you have to mimic the bootloader behavior if you want to use an unmodified DFU master. Alternatively, you could use your own simple protocol for handling the image transfer over BLE. I suspect this may be both more elegant and less work than reusing the nRF DFU protocol in this case, but it is up to you. In any case, you can refer tot he nRF5 SDK and reuse whatever you chose.

  • Are there any guidelines available to move DFU in the application space? I want to use DFU over simple protocol for image transfer because the nRF DFU is checking lots of errors. I want to reuse it.

  • Hi,

    No, there are no guides nor examples. I think the best is to look at this thread that I linked to earlier and the example that is included there. Note that this uses UART as a transport layer rather than BLE so it is not exactly what you need, but you should get some pointers. Alternatively, you can look at the IoT DFU documentation since the intention there is to provide transport in the application.

  • Is it using UART as a transport medium? It looks like it is using TFTP as the transport medium. Please correct me if I am wrong.

Related