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

UART example not working

Hi

I have development kit nrf51 PCA 10028 and try to run uart example example with loopback (RX connected to TX, RTS connected to CTS). Unfortunately, after sending, I don't get anything from uart. Has anyone any idea why? I use SDK 11.0.0

Here is the code (almost the same as in example):

 const app_uart_comm_params_t comm_params =
      {
          RX_PIN_NUMBER,
          TX_PIN_NUMBER,
          RTS_PIN_NUMBER,
          CTS_PIN_NUMBER,
          APP_UART_FLOW_CONTROL_DISABLED,
          false,
          UART_BAUDRATE_BAUDRATE_Baud115200
      };

    APP_UART_FIFO_INIT(&comm_params,
                         UART_RX_BUF_SIZE,
                         UART_TX_BUF_SIZE,
                         uart_error_handle,
                         APP_IRQ_PRIORITY_LOW,
                         err_code);

    APP_ERROR_CHECK(err_code);

    while (true)
    {
        uint8_t * tx_data = (uint8_t *)("\n\rLOOPBACK_TEST\n\r");
        uint8_t   rx_data;

        // Start sending one byte and see if you get the same
        for (uint32_t i = 0; i < MAX_TEST_DATA_BYTES; i++)
        {
            uint32_t err_code;
            while(app_uart_put(tx_data[i]) != NRF_SUCCESS);

            nrf_delay_ms(10);
            err_code = app_uart_get(&rx_data);

            if ((rx_data != tx_data[i]) || (err_code != NRF_SUCCESS))
            {
                show_error();
            }
       }
    }
Related