Run time control of MCU Manager

We are looking to do DFU over UART to the Application as described in DevAcademy nRF Connect SDK Intermediate, Lesson 8, Exercise 1, Step 5. However, we have only one UART available external to our product and it is used for other communications in normal operation (i.e., when not doing SW updates).

So, our use case is not to start MCU Manager at power up and keep it disabled so the UART can be used by another thread for normal communications. Then, when the app decides it wants to go into DFU over UART mode it will terminate the normal communications, cease using the UART, and then invoke the MCU Manager to begin its communications over the UART for the purpose of uploading a new SW image to slot 1.

Is this possible? Can you provide some insight as to how we can prevent the MCU Manager from staring at power up, and how the app can start it later when it is needed?

Parents
  • Hi,

    What you describe is possible. You can see the two processes as two individual procedures; one where you're booting up and entering your application, and one where you're in serial recovery mode. In each of these two modes, you can use the same UART in those two separated modes. 

    Kind regards,
    Andreas

  • Hello Andreas,
     
    This doesn't really address our use case. The way you described it, one boot up entering the app and one boot up in MCUBoot serial recovery mode, is how DevAcademy nRF Connect SDK Intermediate, Lesson 8, Exercise 1, Step 3/4 works, with a single application slot.
     
    In our use case we want to operate as described in Step 5 with two application slot and MCUMGR (not MCUBOOT) using a UART to load the new image into the second slot (slot 1). And then at next start up, if the second image is tagged for test, MCUBoot will swap slot 1 and slot 0, then run the new image.
     
    Again, this is exactly how Lesson 8, Exercise 1, Step 5 works. And we have this working.
     
    The difference for our use case is, we want to use the UART for other purposes most the time and have control when MCUMGR takes over and uses the UART. So, my question remain; can you provide some insight as to how we can prevent the MCUMGR from starting when the App runs, and how the App can start it later when it is needed?
     
    Thanks for your help,
    Brad
  • bbbakke said:
    In our use case we want to operate as described in Step 5 with two application slot and MCUMGR (not MCUBOOT) using a UART to load the new image into the second slot (slot 1). And then at next start up, if the second image is tagged for test, MCUBoot will swap slot 1 and slot 0, then run the new image.

    Ah, I see. Thank you for elaborating. In other words the approach will be to change the UART without entering serial recovery i.e while performing DFU over UART from the application itself, which section 5 in the exercise describes. Could you also verify one more thing: Do you intend to have two versions of the firmware that you swap between, or do you intend to remove the contents of slot 1 after it's been moved to slot 0 and verified as the new image?

    I will spend some more time looking into this tomorrow, hopefully with a resolution.

    Kind regards,
    Andreas

Reply
  • bbbakke said:
    In our use case we want to operate as described in Step 5 with two application slot and MCUMGR (not MCUBOOT) using a UART to load the new image into the second slot (slot 1). And then at next start up, if the second image is tagged for test, MCUBoot will swap slot 1 and slot 0, then run the new image.

    Ah, I see. Thank you for elaborating. In other words the approach will be to change the UART without entering serial recovery i.e while performing DFU over UART from the application itself, which section 5 in the exercise describes. Could you also verify one more thing: Do you intend to have two versions of the firmware that you swap between, or do you intend to remove the contents of slot 1 after it's been moved to slot 0 and verified as the new image?

    I will spend some more time looking into this tomorrow, hopefully with a resolution.

    Kind regards,
    Andreas

Children
Related