Peripheral UART missing bytes

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am using the peripheral UART on the BCM920732 and seem to be missing some bytes

I have followed the sample code put on github and I can read 1 byte easily, I receive the interrupt and can read back the byte. But why I try read a buffer of bytes (say around 7 bytes) sometimes I am missing 3 bytes and sometimes I can read only 2.

I have set the watermark to interrupt after every byte, are there are anymore settings I should be adjusting for this to work? I am currently using the latest IDE for this chip (1.1.0).

Any help would be much appreciated.

Thanks,

Paul

0 Likes
1 Solution

PUART does not function when the chip enters sleep mode (which it will quite aggressively). And if the MCU sends data over when the device is asleep, these bytes will not be received. Did you try with sleep disabled?

As an optimization, you can disable sleep only for the duration when you send/receive the multi-byte message over PUART and let the system sleep when TX/RX is not going to be actively used by the app (P_UART_RX_FIFO_NOT_EMPTY() and P_UART_TX_FIFO_IS_EMPTY() from puart.h will be helpful in addition to your other logic that determines message boundaries).

View solution in original post

6 Replies