2025-03-11 11:43 AM - last edited on 2025-03-12 3:40 AM by mƎALLEm
I am working on STM32L051R8, which is set to use Stop mode, which wakes up on the start bit.
I have a situation where the MCU wakes up on an unwanted start bit, and UART extracts unwanted data. The expected action is to ignore the unwanted data and enable it to wake up again when it is supposed to.
I have tried to use
2025-03-11 12:44 PM
How do you know that the start bit is unwanted and does not indicate valid data?
2025-03-11 1:23 PM
When you receive "unwanted data", ignore it and go back to sleep. As far as the UART is concerned, A start bit indicates valid data.
2025-03-12 2:29 AM
i know by parity check one way and the other way is the data is wrong.
2025-03-12 2:35 AM
@prudhvichitturi wrote:i know by parity check one way and the other way is the data is wrong.
But you can't know that in advance - only after you have received the full frame!
As @TDK said, just ignore it and go back to sleep.
2025-03-12 2:39 AM
Ignoring is the part I am working on. I have to use the above lines in my code. so I have restarted the uart and started again from start, which is what is needed.
2025-03-12 2:40 AM
Maybe look at the Multiprocessor communication mode?
2025-03-12 2:58 AM
how to enable multi processor mode and how to deal with unwanted data
2025-03-12 3:15 AM
You'll need to study the Reference Manual - RM0377 Ultra-low-power STM32L0x1 advanced Arm®-based 32-bit MCUs:
I've not used it on STM32, but the general principle is that the UART doesn't interrupt unless it gets a valid address byte.
2025-03-12 6:02 AM - edited 2025-03-12 6:02 AM
If the byte has a parity error, it will trigger the UART ErrorHandler callback and you can ignore it there.