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

Cannot communicate over UART

Hello,

I have some problems with UART communication with my nRF51 DK. When I connect it through USB cable, all is ok. But when I connect pins: P0.09(TXD), P0.11(RXD) to my USB/UART converter, nothing happens on terminal. I have also custom board with nRF51822 and the same problem. I tried to use:

app_uart_put();
printf();

Below is my uart config:

void uart_init(void)
{
uint32_t err_code;

const app_uart_comm_params_t comm_params =
  {
    .rx_pin_no    = RX_PIN_NUMBER,
    .tx_pin_no    = TX_PIN_NUMBER, 
    .rts_pin_no   = RTS_PIN_NUMBER, 
    .cts_pin_no   = CTS_PIN_NUMBER,
    .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
    .use_parity   = false,
    .baud_rate    = UART_BAUDRATE_BAUDRATE_Baud115200
  };

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

APP_ERROR_CHECK(err_code);

uart_rx_buffer.p_data = malloc(UART_RX_BUF_SIZE * sizeof(uint8_t));
memset(uart_rx_buffer.p_data, 0, UART_RX_BUF_SIZE*sizeof(uint8_t));
uart_rx_buffer.size = 0;
}

EDIT

I tried also set uart flow control enabled and use additional pins: CTS and RTS. Still I can't communicate with nRF51422 on my nRF51DK by connecting those four pins with USB/UART converter. My program works fine when I set default RX,TX, RTS and CTS pins and connect nRF51DK to my computer directly throught USB cable.

Parents
  • Thank you for your answer, RK. I tried other pins(P0.12-P0.16), but result is the same - nothing on terminal. Any other clues?

    Below I paste my post from deleted topic:

    Hello,

    Could somebody tell me how to proper use UART pins located on my nRF51DK board?

    I connected RX(P0.11), CTS(P0.10), TX(P0.09), RTS(P0.08) and GND to the relevant pins on my USB/UART converter connected to the PC. DK is powered throught USB cable connected to the PC. I tested ble_app_uart example and these are the results:

    In terminal I connected to port COM of USB/UART and nothing happens, even after i restarted board. After that i connected to port COM of USB cable connected directly to the DK and program works well.

    So, how should I use these UART pins on my board?

Reply
  • Thank you for your answer, RK. I tried other pins(P0.12-P0.16), but result is the same - nothing on terminal. Any other clues?

    Below I paste my post from deleted topic:

    Hello,

    Could somebody tell me how to proper use UART pins located on my nRF51DK board?

    I connected RX(P0.11), CTS(P0.10), TX(P0.09), RTS(P0.08) and GND to the relevant pins on my USB/UART converter connected to the PC. DK is powered throught USB cable connected to the PC. I tested ble_app_uart example and these are the results:

    In terminal I connected to port COM of USB/UART and nothing happens, even after i restarted board. After that i connected to port COM of USB cable connected directly to the DK and program works well.

    So, how should I use these UART pins on my board?

Children
No Data
Related