libuarte rx start after stop

After executing nrf_libuarte_drv_rx_stop(), nrf_libuarte_drv_rx_start() will produce an error.

In nrf_libuarte_drv_rx_start() this line in nrf_libuarte_drv.c (Line 625 in SDK 17.1.0) tries to enable the timer but fails:

nrfx_timer_enable(&p_libuarte->timer);

What would be the preferred way of starting and stopping rx, if not using nrf_libuarte_drv_rx_stop() and nrf_libuarte_drv_rx_start()? My goal is put the device to sleep when there are no more RX bytes to receive.

Parents Reply
  • I tried creating a minimal working example of the error. Please see the attached zip file below. I used the libuarte example in SDK 17.1.0

    The error occurs the second time nrf_libuarte_drv_rx_start() is executed (line 206 in main.c in the zip file):

      err_code = nrf_libuarte_drv_rx_start(&libuarte, rx_buffer, sizeof(rx_buffer), 0);
      APP_ERROR_CHECK(err_code);
      
      nrf_libuarte_drv_rx_stop(&libuarte);
    
    // The error is on the following line:
      err_code = nrf_libuarte_drv_rx_start(&libuarte, rx_buffer, sizeof(rx_buffer), 0);
      APP_ERROR_CHECK(err_code);

    libuarte_start_stop_8a31e13a09.zip

Children
Related