This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf52840 and s140, using sdk14, UART Example Problem ..

Hello,

I am trying to communicate urart with nrf52840 and other devices.

But there was a problem. You can transfer data from the nrf52840 to another device, but if you transfer data to the nrf52840 from another device, it will not be received from the nrf52840.

The pins are connected properly, and HW_FLOW is being used, and CTS and RTS are also connected.

Why can not I receive data from nrf52840? When I checked the other device TX pin with the program Logic, I confirmed that the output is normal. But what's wrong, nrf52840 is not receiving rx.

"app_uart_get (& recv_data)" to output data when it comes in, but it is not printing.

I'm not using 'app_uart.c', but I'm using 'app_uart_fifo.c'.

Can you help me?

    1. Can you edit your question and add the relevant code?
    2. Have you double checked that you have connected everything correctly? RX-TX, TX-RX, CTS-RTS, RTS-CTS?
    3. Have you connect both devices to common ground?
    4. Are both devices using the same supply voltage?
  • Hi, Martin.

    I solved the problem. I was aiming to get data using APP_UART_GET () in the body (main.c).

    However, it was my problem that I could print on other devices but not read on that device. It turns out that this is due to the "UART_EVENT_HANDLE" set in uart_init. "uart_event_handle" has no data to read in main (main.c) because it already reads data through APP_UART_GET in case APP_UART_DATA_READY when data comes in.

    So I commented out the APP_UART_GET part in APP_UART_DATA_READY Case and found that it works properly.

    I'm not sure why this code was configured. Do you know?

  • I'm not sure if I understand what code you are referring to. If it is the peripheral uart example in our SDKs the uart handler function is there to register possible UART errors. You can also chose to read out the data in the handler or by polling the app_uart_get() function over and over in your main context.

Related