UART API uart_rx_enable() timeout parameter issue under heavy load

Hi all,

we are using UART uart_rx_enable() to define a timeout of 500. Most of the time, event UART_RX_RDY
is raised as it should be after a timeout. If, for example, we test the device under a heavy load,
in both directions as fast as possible then this event is no longer raised. UART behavior is
similar if UART timeout is configured as SYS_FOREVER_US, since it waits until the buffer is full.

Any idea, why timer is "blocked-not functional" at some point of data transfer?

regards,

DM

  • Hi Drago

    How do you handle the UART_RX_RDY event? 

    Are you using one of the standard examples as a starting point, or have you implemented the event handling from scratch?

    What is your UART configuration?

    When testing the UART under load I assume you get some RX_RDY events with the length set to the maximum (meaning the buffers fill up before the timeout occurs). Have you tried to check how many events you get before it crashes?

    Best regards
    Torbjørn

  • Hi Torbjørn,

    thanks for quick reply. I have taken some UART example from samples. Event is handled by proposed callback. and nothing is done inside any interrupt handler. 

    Received data is shorter length then set up buffer length (48 bytes). In most cases reception is around 26 bytes and then after timeout RY_RDY event should happen to parse incoming data. The reason why is done in such way is, because some of the messages are longer and some shorter, so 48 bytes is quite enough. The problem is, when received messages are only around 6 bytes, then 48 bytes of reception data is filled up prior event is raised. But this stored messages can't be parsed, since host already close active connection due "silence".

    Number of fired events are not the same at every data transmission. From last 5 attempts I get 6, 12, 7, 37, 20 events. When this happens data reception from Phone -> nrf52832 is working without any data loss. The problem is only data reception from UART side.

    regards,

    DM    

  • Hi Drago

    Would you be able to share your code with me so I can have a look at it? 

    If you don't want to share your code in a public case I can make the case private (just let me know before you share it). 

    Drago Matt said:
    But this stored messages can't be parsed, since host already close active connection due "silence".

    Can you give a bit more information about this mechanism?

    I assume this is something you have implemented in the application?

    By the way, how do you handle the situation where one message might be split in two callbacks, if the buffer fills up in the middle of a message?

    Best regards
    Torbjørn

Related