This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf_serial driver error

I am using the nrf_serial library SDK 15.2.0. I have implemented the solution suggested in Case ID: 216973 for recovering from driver errors. This helped me get over errors that were caused by the receive signal not being driven high at power-on. However, I occasionally get driver errors while receiving UART data at about 6 bytes every 200mS at 4800bps. When this happens, the code in the UART event handler performs a nrf_serial_uninit and then a nrf_serial_init. I occasionally get a NRF_ERROR_MODULE_ALREADY_INITIALIZED error then. Can you help me overcome this issue?

Parents
  • Hi,

    I would recommend you to consider moving to the libUARTE library, as the nrf_serial library is not maintained and have some issues like you are experiencing. In the latest SDK versions, the nrf_serial library is removed completely. libUARTE is only available in a experimental version in nRF SDK v15.2.0, but it may be possible to backport the production variant from a later SDK version if you are not able to migrate to a newer SDK version.

    Best regards,
    Jørgen

Reply
  • Hi,

    I would recommend you to consider moving to the libUARTE library, as the nrf_serial library is not maintained and have some issues like you are experiencing. In the latest SDK versions, the nrf_serial library is removed completely. libUARTE is only available in a experimental version in nRF SDK v15.2.0, but it may be possible to backport the production variant from a later SDK version if you are not able to migrate to a newer SDK version.

    Best regards,
    Jørgen

Children
  • I successfully completed the backport of the libuarte library to SDK 15.2.0. This has solved my issues.

    I have a question though.

    With NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 4, 0, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);

    If I set the buffer size to anything above 255, I get [Unknown error code] in nrf_libuarte_drv.c at ASSERT(len <= MAX_DMA_XFER_LEN); when debugging.

    This is because MAX_DMA_XFER_LEN is defined by ((1UL << UARTE0_EASYDMA_MAXCNT_SIZE) - 1) in  nrf_libuarte_drv.c and UARTE0_EASYDMA_MAXCNT_SIZE is defined in nrf52832_peripherals.h which are all within the SDK files.

    Why is MAX_DMA_XFER_LEN defined in nrf_libuarte_drv.c rather than allowing it to be defined in the user application?

  • Hi,

    MAX_DMA_XFER_LEN is limited by the HW. In nRF52832, the UARTE peripheral has a 8-bit wide MAXCNT registers, which only allows you to perform transfers up to 255 bytes. Later chip versions have larger MAXCNT registers (up to 16-bit width in nRF52833/nRF52840), see the overview in nRF52 Series.

    Best regards,
    Jørgen

Related