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

APP_UART_COMMUNICATION_ERROR on handle

I'm having troubles parsing the received data stream form an UART device. If i just print whatever i received from the datastream, everything works just fine.

Fullscreen
1
2
3
4
5
if (p_event->evt_type == APP_UART_DATA_READY){
app_uart_get(&rx);
NRF_LOG_RAW_INFO("%c", rx);
NRF_LOG_FLUSH();
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Howeve, if i try to store it in an external string and then print it , it returns APP_UART_COMMUNICATION_ERROR during reception.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
if (p_event->evt_type == APP_UART_DATA_READY){
app_uart_get(&rx);
if(rx == 0xD){
buff[i] = (uint8_t)'\0';
i = 0;
NRF_LOG_RAW_INFO("%s", NRF_LOG_PUSH((char *)buff));
NRF_LOG_FLUSH();
}else{
buff[i++] = rx;
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX