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

nRF52 merging UART and blinky

Hi. I'm using nRF52832 with my external board. (SDK 15.0.0)

I want to merge UART, blinky and timer. I merged UART and timer example, and it worked.

Now, I want to merge blinky and UART(merged with timer) but it's not working.

I know how to merge different examples.( Enable necessary defined code)

So, I found that uart_init() function is not working. Particularly in APP_UART_FIFO_INIT part. 

When I use this code, I even can't connect with the phone through bluetooth.

However, when I delete APP_UART_FIFO_INIT part, I can connect with the phone through bluetooth but of course, I can't receive UART data.

static void uart_init(void)
{
    uint32_t                     err_code;
    app_uart_comm_params_t const 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,
#if defined (UART_PRESENT)
        .baud_rate    = NRF_UART_BAUDRATE_9600
#else
        .baud_rate    = NRF_UARTE_BAUDRATE_115200
#endif
    };

    APP_UART_FIFO_INIT(&comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_event_handle,
                       APP_IRQ_PRIORITY_LOWEST,
                       err_code);
    APP_ERROR_CHECK(err_code); 
}

So I don't know how to fix it and what is the problem.

Please  help.

Thanks

(p.s  I'm not living in english speaking country. So I'm not good at writing english. Sorry)

Related