Uart based user interface: Shell?, McuMgr?

I have a device that needs to do the following:

  1. Communicate with a program running on a computer.
  2. Send sensor data over UART when polled by the host computer.
  3. Accept commands from a host computer (update setting, turn on led ...etc.)
  4. Perform a DFU when the host computer has a firmware available.

I have read a lot of different forum posts that have "work arounds" for custom protocols for delivering data while also supporting MCUMGR . I suppose a custom protocol isn't strictly necessary in my use case (but I did start this way). I am mostly interested in the Nordic/Zephyr best practice for accomplishing the three objectives above. It seems like MCUMGR can coexist with the shell, but I'm not sure if a shell is appropriate for talking with other programs (its more for a user terminal). Any suggestions on the high level design here?

I am using NCS 2.3.0 and currently working on an NRF52840 (although I will most likely reuse the agreed upon paradigm on other SOC's like the NRF9160 and NRF53). 

Parents Reply Children
  • There is a lot of content out there for accomplishing DFU over serial. The problem is that MCUMGR takes full control of the physical interface (UART) which inhibits your ability to use the interface for other things (Like exchanging sensor data). I'm trying to figure out how to support firmware updates AND exchanging sensor information/sending commands back and forth.

Related