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

UART input interrupt

Hello,

I'm new to Nordic nRF52 and trying to send commands via termial to nRF52. After receiving commands, nRF52 will use these commands to do i2c communication with other peripherals. My project is based on nRF5_SDK_11.0.0\examples\peripheral\uart. Here are what I've done and encountered:

1.Modify uart_event_handle() of APP_UART_FIFO_INIT() to receive example commands as in uart_recv_command.c,

=> The problem is if I input :0200FA, I got "CMD 1 Received", and then I input :100456g011, I still got "CMD 1 Received".

Uart data received and stored in RX FIFO buffer should be fetched when calling app_uart_get(), but data stored in RX FIFO buffer seems always the same one as first input, why??

2.Add func() to process the command stored in data_array as in func_process_command.c.

=> The problem is if I input :0200FA or other commands, I got nothing from terminal. Do I need any other configurations (e.g. IRQ_Handler, timer configuration etc.) for UART??

Sorry if I'm missing something obvious, but I'm really bewildered by these problems. Any suggestion would be great great appreciated! Thanks!

Related