nRF52832 UART Blocking mode and DWM1001

FormerMember
FormerMember

Hello,

I am using the DWM1001 board and would like to receive some bytes over UART to the nRF52832.

I want the device to wait for a certain number of bytes from UART and only then continue execution.

In the Documentation it says for the function  "nrf_drv_uart_rx":

If an event handler was provided in the nrf_drv_uart_init() call, this function returns immediately and the handler is called when the transfer is done. Otherwise, the transfer is performed in blocking mode, i.e. this function returns when the transfer is finished.

This seems to achieve what I am looking for. When calling nrf_drv_uart_init(), I provide no event handler (rather, I give '0' as parameter). This however does not work, nrf_drv_uart_rx() does not wait for UART data but instead continues execution. Is it wrong to provide '0' as parameter for event handler? How would I go about not providing an event handler to nrf_drv_uart_init()? 

I thought that something like this would work:

nrf_drv_uart_init(&app_uart_inst, &NRF_DEFAULT_CONFIG, 0);
nrf_drv_uart_rx_enable(&app_uart_inst);
nrf_drv_uart_rx(&app_uart_inst, rx_msg_check, UART_MSG_LEN);

while(!nrf_drv_uart_rx_ready(&app_uart_inst)){
nrf_drv_uart_rx(&app_uart_inst, rx_msg_check, UART_MSG_LEN);
}

However, the device never receives any data. I would appreciate any tips that might help.

Thank you.

 

 

Parents Reply Children
No Data
Related