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

Common serial interface over UART and USB

Hi,

I am developing firmware for both nRF52832 and nRF52840 chips. For serial communication, I would like to have a common interface for both chips, which means sending binary data over UART (nRF52832) or over USB (nRF52840). The only solution that I found having the same interface is the command line interface (CLI) module. But unfortunately I did not find any way to send/receive raw data (in binary) with this module.

Could you please suggest me what would be the best way to implement that?

Thank you in advance,

Javier

Parents Reply
  • Sorry, your description was clear, but I realize now that CLI probably isn't the best choice for what you want to do. It should be up to your application to interpret the data passed as arguments to your custom command (doesn't have to be a string), but I forgot the fact that the module will still need to parse incoming data to detect newlines <\n or \r> (end of command), backspace <0x08> (new argument), and NULL termination in order for the interface to work. I guess it could have worked better if there were an option to use TLV encoded command arguments. 

    Maybe the CLI implementation can be more useful as a reference to implement your own abstraction layer. nrf_cli_cdc_acm.c and nrf_cli_uart.c how we've created the "serial port" API. 

    Best regards,

    Vidar

Children
No Data
Related