NICLA SENSE ME (nRF52832) UART RX Issue

Hello All,

I have ported the UART example (<InstallFolder>\examples\peripheral\uart) on top of blinky in nicla sense hardware. The TX is working only when rx pin is set as "UART_PIN_DISCONNECTED". 

The TX is also working if I comment out the below code portion.

// Turn on receiver if RX pin is connected
if (p_comm_params->rx_pin_no != UART_PIN_DISCONNECTED)
{
return nrf_drv_uart_rx(&app_uart_inst, rx_buffer,1);
}

Also I am not able to use the on chip debugger, if uart module enabled/initialized.

I assume the code is entering into app_error_fault_handler() when RX is enabled. 

I have also verified the PIN_CFN.

Following are the configurations used for reference:

const app_uart_comm_params_t comm_params =
{
RX_PIN_NUMBER_NICLA,          /* GPIO2 = p9 */
TX_PIN_NUMBER_NICLA,          /* GPIO1 = p20 */
RTS_PIN_NOT_CONNECTED,
CTS_PIN_NOT_CONNECTED,
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_nicla,
APP_IRQ_PRIORITY_LOWEST,
err_code);

APP_ERROR_CHECK(err_code);

------------------------------------------------------------------------------------------

Relevant sdk_config:

#define RETARGET_ENABLED 1

#define UART_ENABLED 1

#define NRFX_UARTE_ENABLED 0

#define APP_FIFO_ENABLED 1

Please let me know if you need any further information. Any support would be really appreciated. Thank you

-

ijf1

Parents
  • Hello,

    Please try to comment the "APP_ERROR_HANDLER(p_event->data.error_communication);" line in uart_error_handle() and see if that allows you to run the program with RX enabled.

    The APP_UART_COMMUNICATION_ERROR is often triggered if the UART RX pin is left floating.

    Best regards,

    Vidar

  • Hi Vidar,

    The program runs with RX enabled on commenting "APP_ERROR_HANDLER(p_event->data.error_communication);".

    But RX does not seem to work. 

    I tried the below code to receive from PC terminal. 

    while (true)
    {
    uint8_t cr;
    while (app_uart_get(&cr) != NRF_SUCCESS);
    while (app_uart_put(cr) != NRF_SUCCESS);

    if (cr == 'q' || cr == 'Q')
    {
    printf(" \r\nExit!\r\n");

    while (true)
    {
    // Do nothing.
    }
    }
    }

    Also can you please clarify the expected UART RX pin state. Has it to be handled in the schematics ? I tried configuring the RX pin as input and pulldown before UART init. It does not work.

    Regards

    Ijaz

Reply
  • Hi Vidar,

    The program runs with RX enabled on commenting "APP_ERROR_HANDLER(p_event->data.error_communication);".

    But RX does not seem to work. 

    I tried the below code to receive from PC terminal. 

    while (true)
    {
    uint8_t cr;
    while (app_uart_get(&cr) != NRF_SUCCESS);
    while (app_uart_put(cr) != NRF_SUCCESS);

    if (cr == 'q' || cr == 'Q')
    {
    printf(" \r\nExit!\r\n");

    while (true)
    {
    // Do nothing.
    }
    }
    }

    Also can you please clarify the expected UART RX pin state. Has it to be handled in the schematics ? I tried configuring the RX pin as input and pulldown before UART init. It does not work.

    Regards

    Ijaz

Children
No Data
Related