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

getting NRF_LIBUARTE_ASYNC_EVT_OVERRUN_ERROR after long time of use

Hello,

im using nrf52840 with sd140 and sdk17.0.1

in my project i have implemented a libuarte communication that works well usually, but rarely, and usually after days of running i get this error:

NRF_LIBUARTE_ASYNC_EVT_OVERRUN_ERROR

i do nothing to handle this error and continue regularly and after this i start getting jumbled strings from the libuarte.

meaning if i send something like this:

"

123456789

123456789

123456789

123456789

abcdefghijklmnopqrstvuwxyz

"

i might get something like this:

"

123456789\n

123456789\n

123456789\n

123456789\n

abcdefghijklm123456789\n

nopqrstvuwxyz

"

i have seen a similar question in the following link:

https://devzone.nordicsemi.com/f/nordic-q-a/63905/libuarte-issue-nrf_balloc_alloc-retuns-null-after-a-while

and it ended up in saying that it got resolved somehow with the timers, which i kind of suspected,  but still don't know how to resolve.

i init the libuarte by:

NRF_LIBUARTE_ASYNC_DEFINE(xxxxx_libuarte0, 0, 1, 2, NRF_LIBUARTE_PERIPHERAL_NOT_USED, ATCMD_LIBUARTE0_RX_BUF_SIZE, ATCMD_LIBUARTE0_RX_BUF_CNT);    // using uart0 ; TIMER1; RTC2

this problem is very rare which makes it difficult to debug. 

please advise,

Regards,

Roy Barak

TechPack Lab

Parents
  • Hi

    I'm guessing the HWFC might be "stalling" the error for some time, but that it does not solve the problem. The only other suggestions I have is that this is likely caused either by the buffer_size or the timeout of your libuarte implementation. Can you try tweaking these somewhat to see if that helps?

    As a back-up plan, I guess you can try just disabling and enabling the libuarte peripheral, but you should test this to make sure it works.

    Best regards,

    Simon

  • Hi,

    yes, i figured that this is the next step and modified the libuarte init.

    from:

    #define ATCMD_LIBUARTE0_RX_BUF_CNT 3

    #define ATCMD_LIBUARTE0_RX_BUF_SIZE 255

    NRF_LIBUARTE_ASYNC_DEFINE(atcmd_libuarte0, 0, 2, NRF_LIBUARTE_PERIPHERAL_NOT_USED , 3 , ATCMD_LIBUARTE0_RX_BUF_SIZE, ATCMD_LIBUARTE0_RX_BUF_CNT); // using uart0 ; TIMER2; TIMER3

    to:

    #define ATCMD_LIBUARTE0_RX_BUF_CNT 9

    though i believe that this is more avoiding the issue then handle it, since i just increased the buffer so it will probably never (or much more rarely) will get overflowed.

    it is running for several days now, will update regarding results.

    Regards,

    Roy

Reply
  • Hi,

    yes, i figured that this is the next step and modified the libuarte init.

    from:

    #define ATCMD_LIBUARTE0_RX_BUF_CNT 3

    #define ATCMD_LIBUARTE0_RX_BUF_SIZE 255

    NRF_LIBUARTE_ASYNC_DEFINE(atcmd_libuarte0, 0, 2, NRF_LIBUARTE_PERIPHERAL_NOT_USED , 3 , ATCMD_LIBUARTE0_RX_BUF_SIZE, ATCMD_LIBUARTE0_RX_BUF_CNT); // using uart0 ; TIMER2; TIMER3

    to:

    #define ATCMD_LIBUARTE0_RX_BUF_CNT 9

    though i believe that this is more avoiding the issue then handle it, since i just increased the buffer so it will probably never (or much more rarely) will get overflowed.

    it is running for several days now, will update regarding results.

    Regards,

    Roy

Children
No Data
Related