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

Cannot Receive data using UARTE with nRF52832

Hi everyone,

I'm now using nRF52832 to communicate with a device using UARTE.

In my application, i need to constantly send a control packet to the device, to keep it responsive to the control (~15ms between each data).

I don't want my application to be blocked, so i decide to use UARTE to do it automatically, and the TX part is working perfectly.

But the RX part is just not working at all, there are two issues:

1. With a valid waveform observed on the oscilloscope, the UARTE library returns framing error.

The RX buffer is filled with the data, while the RX byte count in i) p_event->data.error.rxtx.bytes and ii) p_event->data.rxtx.bytes are zero.

2. With a valid waveform observed on the oscilloscope, the UARTE library will not returns any event. The RX buffer receives nothing.

Here is the setting of the UARTE:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Init UART */
nrf_drv_uart_config_t config =
{
.pseltxd = TX_PIN,
.pselrxd = RX_PIN,
.pselcts = NRF_UART_PSEL_DISCONNECTED,
.pselrts = NRF_UART_PSEL_DISCONNECTED,
.p_context = NULL,
.hwfc = NRF_UART_HWFC_DISABLED,
.parity = NRF_UART_PARITY_EXCLUDED,
.baudrate = NRF_UART_BAUDRATE_250000,
.interrupt_priority = UART_DEFAULT_CONFIG_IRQ_PRIORITY,
};
err_code = nrf_drv_uart_init(&uart_inst, &config, uart_event_handler);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Here is how i start the RX task:

Fullscreen
1
nrf_drv_uart_rx(&uart_inst, rev_handler.rev_buf, rev_handler.rx_len);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Here is the SDK config setting:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// <e> NRFX_PRS_ENABLED - nrfx_prs - Peripheral Resource Sharing module
//==========================================================
#ifndef NRFX_PRS_ENABLED
#define NRFX_PRS_ENABLED 1
#endif
// <q> NRFX_PRS_BOX_0_ENABLED - Enables box 0 in the module.
#ifndef NRFX_PRS_BOX_0_ENABLED
#define NRFX_PRS_BOX_0_ENABLED 0
#endif
// <q> NRFX_PRS_BOX_1_ENABLED - Enables box 1 in the module.
#ifndef NRFX_PRS_BOX_1_ENABLED
#define NRFX_PRS_BOX_1_ENABLED 0
#endif
// <q> NRFX_PRS_BOX_2_ENABLED - Enables box 2 in the module.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Please share your experience if you had the same issues to me, thank you!!

BR,

Jonathan