Probably it will, but it's equivalent to:Thank you for all your answers and clarifications. If I understand correctly this code snippet should do the trick ?Code:
hw_set_bits (&uart_get_hw(uart1)->rsr, UART_UARTRSR_BITS)
Code:
uart_get_hw(uart1)->rsr = UART_UARTRSR_BITS;
Is your target device continually spewing data at maximum rate (no pauses)? If so, this is a fundamentally impossible problem to solve: the UART can't tell the difference between start/stop bits and character data bits unless there is a pause of several bit times (or you get lucky with the particular byte values).I added this to my test code and it clears the register but the data stream is still corrupted.
If that is the problem, and the baudrate isn't too high, you could maybe write a simple PIO program to capture the data as a stream of bits and apply your own heuristic (knowledge of the expected data content) to find the character boundaries in software.
Statistics: Posted by arg001 — Fri Dec 13, 2024 3:19 pm