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

libuarte issue: nrf_balloc_alloc retuns NULL after a while.

Hi.

I'm having an issue with the libuarte library. It seems to work perfectly but after some hours of running the program crashes because nrf_balloc_alloc returns NULL inside the rx_buffer_scheduile function which is called from the uart_evt_handler under the NRF_LIBUARTE_DRV_EVT_RX_BUF_REQ event.

I tried enabling the RX pullup. Increasing the RX buffer (count 16, size 250) but still getting the NULL pointer. I receive very little data @ 1125200 (it's an AT command module so there's not much being sent/received).

Any idea on how I can debug or fix this? Maybe increasing the ISR priority?? 


Thanks a lot.

  • Thanks Øyvind,

    More information (probably useful). The received data from the UART is fine, I connected a logic analyzer and there were no framing errors and also there was no data overrun, less than 200 bytes were received between the last successful receptions and when the libuarte overrun gets triggered. 

    I configured the libuarte with (5) 255 byte buffers so we should have enough space.

    Somehow I think this is either DMA related or a timer related issue, where it's counting more bytes than it actually received. 

    Any additional idea on what I can test?

    Thanks.

  • Hi, 

    I could not see what SDK you are using. Can you please provide some details on how I can reproduce this issue?

    Thanks!

    -Øyvind

  • Hi,

    It's SDK 16.0

    I do not have the steps to reproduce this. The project is kind of complex (lots of code) and the issue happens once every 2-4 hours randomly. 

    I disabled (commented) many parts of the project to start narrowing the issue. I now think it's related to other parts of the project, probably a timer.

    I left it running all the night and the issue never happened. So now I'm uncommenting (enabling) other modules in the project to see if it happens again and probably narrow it. 

    But probably I won't be able to tell you an exact way to reproduce so we might just need to deduce what is happening with the evidence I'm getting.

    Thanks.

  • I think it's related to the ESB library. I'm also using that in the project. Probably a timer or PPI channel?? 

    Øyvind, what parts of the ESB library do you think can conflict with the Libuarte library?

    Thanks.

  • I'm sorry for not answering your ticket. We are currently swamped with tickets, and I have not had the time to reproduce errors. I will need to start looking at this on Monday when more of our resources are back. 

    Sorry for the inconvenience this may cause. 

    Kind regards,
    Øyvind

Related