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.
if (p_event->evt_type == APP_UART_DATA_READY){ app_uart_get(&rx); NRF_LOG_RAW_INFO("%c", rx); NRF_LOG_FLUSH(); }
Howeve, if i try to store it in an external string and then print it , it returns APP_UART_COMMUNICATION_ERROR during reception.
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; } }