This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1312R: Contiki-NG: UART with binary mode

Part Number: CC1312R

Hi,

I have a customer who is trying to use CC1312R with Contiki-NG.
Contiki-NG source codes are available here;
https://github.com/contiki-ng/contiki-ng

Customer wants to connect CC1312R as slave to host MCU using UART.
There is UART source code available in Contiki-NG.
C:\contiki-ng\arch\cpu\simplelink-cc13xx-cc26xx\dev\uart0-arch.c

Customer found if 0x00 is sent from host, CC1312R cannot receive the data.
No UART receive interrupt is generated.
It seems the default UART mode is “text mode”. 0x00 is treated as NULL with “text mode”, so probably this is the reason.
Now customer tried to change the mode to “binary mode”

void

uart0_init(void)

{

  if(initialized) {

    return;

  }

 

//  UART_Params uart_params;

  UART_Params_init(&uart_params);

 

  uart_params.baudRate = TI_UART_CONF_BAUD_RATE;

  uart_params.readMode = UART_MODE_CALLBACK;

  uart_params.writeMode = UART_MODE_BLOCKING;

  uart_params.readCallback = uart0_cb;

  uart_params.readDataMode = UART_DATA_BINARY;

  uart_params.readReturnMode = UART_RETURN_FULL;

  uart_params.readEcho = UART_ECHO_OFF;

  uart_params.readTimeout = 5000;

//  uart_params.readDataMode = UART_DATA_TEXT;

//  uart_params.readReturnMode = UART_RETURN_NEWLINE;

 

  /* No error handling. */

  uart_handle = UART_open(Board_UART0, &uart_params);

 

  initialized = true;

}


But it did not work.
Customer confirmed the mode (“readDataMode” parameter) was correctly changed.
(see attached CCS window snapshots)





What else needs to be done for UART binary mode?

Thanks and regards,
KoT