Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

CC2642R: Device getting hanged on receiving data from UART

Part Number: CC2642R

Hi,

I am using sdk simplelink_cc26x2_sdk_2_30_00_34 simplePeripheral code. As per my use case, device will receive continuous data from UART ( packet of 200 bytes in every 10 ms) and send it to connected central device using notification.

Below is my UART_INIT code.

bool UART_Configuration(void)
{
  UART_init();
  UART_Params_init(&SbpUartParams);
  SbpUartParams.readMode = UART_MODE_CALLBACK;
  SbpUartParams.writeMode = UART_MODE_BLOCKING;
  SbpUartParams.readCallback = &uart_readcallback;

  SbpUartHandle = UART_open(Board_UART0, &SbpUartParams);
  if( SbpUartHandle == NULL ) {
      return false;
  }

  UART_read(SbpUartHandle, read_buff, rx_data_len);

  return true;
}

Baudrate rate is 115200. In uart_readcallback function, i am coping data received from UART to a buffer and sending that buffer through notification.

But while receiving data from UART device is hanged, i debugged the code and checked device is getting HWI exception somehow. I tried with just receiving data from UART without notify data but still same issue. Can anybody help me how to resolve this issue?

  • Hi Aditya,

    If you open up the Runtime Object Viewer (ROV: Tools->Runtime Object View in CCS) and look at the Hwi exception view, what information do you get (if the information is slim, try disabling optimization as this will give you better call stacks)?

    Could you also share the read callback function implementation?
  • Hi M-W,

    Thanks for the delay reply.

    I have solved the issue through debugging i have found we are calling UART_write in UART_read callback function which causing device hanged. As per our requirement we need to write some data after receiving some command on UART.

    To resolve this i have disabled the POWER_SAVING macros in the code and for UART_writing we made a seperate event. In the UartRead_callback function instead of calling UART_write directly we are calling it through that event. This resolved my issue.