Disable SMP server n seconds after MCU booting

Hello!

We have an application with an nRF52832 connected through an UART to another MCU. We want to have the possibility to update the nRF FW, but as nrF52832 only has 1 UART, there is no straightforward way to share it with APP and SMP server at the same time.

Is it possible to do the following?

1- Boot with SMP server and wait a few seconds for an incoming image upload command.

2- If no SMP communication is received after n seconds, disable SMP server until next reboot and start APP which can use UART without problems.

Thanks in advance!

Regards.

  • Hi,

    Due to summer vacation there will be some delays in response time, sorry forthe inconvneince.


    As for the two questions, i am not able to fully confirmt this but i belive both should be doable, (expert on vacation), it is possibel to change UARt during runtime so should also work for the sitatuion described.

    Link to ticket with UART runtime change

    Regards,
    Jonathan

  • Hi Jonathan,

    Thanks for your answer. What I need to know is if it's possible to disable MCUmgr SMP server after a few seconds without communicating with it.

    I'm thinking I can also use MCUboot serial recovery (So no SMP server in APP) but, as it is intended for recovery purposes, Will I loose the 2 images partitions functionality of MCUboot? 

    Regards,

    Pedro.

  • Hi Pedro,

    I will continue working on this case.

    The way Zephyr works, it is generally hard to disable features set in Kconfig (prj.conf) during runtime.
    When looking at the SMP Server code, I can not find any functions for deactivation.

    From your explanation, I would say that Serial Recovery is the solution you need.
    The only requirement for this would be one pin from the other MCU to one of the nRF pins to initiate the Serial Recovery.

    You say you need dual slot on your nRF with serial recovery. This is usually not needed, since you can always do serial recovery again if it fails the first try.
    If you explain why you want dual slots, I think I will be better able to help you find a good solution.

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    Thanks for your answer! I also think Serial Recovery is the best option in this case. 

    I do not need dual slot having serial recovery. In fact, the current .bin size is close to the assigned slot space if dual slot is used, so if I delete second slot I will not have to worry about FW size.

    Thanks again and have a nice day.

    Pedro.

Related