UART suddenly stops receiving data in interrupt mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UART suddenly stops receiving data in interrupt mode

Jump to solution
823 Views
panpwr
Contributor IV

Hello,

I am using UART3 (ittyd) in interrupt mode (rate of 115200, and buffer size 64 bytes) - K60 and TWR-K60D100M evy board.

I am sampling the port periodically, using fgetc to read the chars and performing _io_fflush at the end of each round.

It works great for a while (around ~50 seconds), and then suddenly stops - nothing comes through.

I've tried increasing the buffer size from 64 bytes to 128 (by changing the BSPCFG_SCI3_QUEUE_SIZE variable in twrk60d100m.h), and it seems that now it works for a longer period - however eventually it still stops receiving data.

What can be the cause for this issue, and how can I approach / debug it?

Thanks,
Lior.

0 Kudos
1 Solution
484 Views
panpwr
Contributor IV

OK, it seems that I've figured it out - it was my SW issue (I've been spending too much time in delays rather than in constant UART buffer polling..).

View solution in original post

0 Kudos
2 Replies
484 Views
panpwr
Contributor IV

More information:

When debugging with uVision4, the task that uses the UART state is: "Task Queue Blocked".


I have a suspicion:

Can a bursty traffic fill up the entire buffer, or is it a cyclic buffer? Do I need to clear the buffer each time I finish reading it (how?), or does the new packet runs over the old data in the buffer?

Please, I am desperate here....:smileyconfused:

0 Kudos
485 Views
panpwr
Contributor IV

OK, it seems that I've figured it out - it was my SW issue (I've been spending too much time in delays rather than in constant UART buffer polling..).

0 Kudos