2023-08-13 02:00 PM
LPUART1_TX - PA2
LPUART1_RX - PA3
I'm having trouble testing because I'm getting frame errors by UART1.
My PCB didn't design any circuit for PA2 and PA3 because the IC that connects to the MCU's UART pin uses 3.3V TTL communication.
However, using the HAL code, the HAL_UART_Init function automatically enters the HAL_UART_ErrorCallback function even if the IC is not connected.
Interrupt and DMA methods are the same.
I am not considering the Polling method because of the possibility of missing bits.
I also use UART2, but UART2 is not a problem.
Only UART1 is the problem.
My board might be the problem, so I tested it on the NUCLEO-L031K6 board, but the result is the same.
Is there any way to solve this problem?
I am attaching the code, which is very simple, but outputs an error.
In fact, there are only three functions in the code that need to be executed to see the same problem.
MX_LPUART1_UART_Init
HAL_UART_Receive_DMA or HAL_UART_Receive_IT
HAL_UART_ErrorCallback
Hopefully we can resolve this issue.
Solved! Go to Solution.
2023-08-13 02:13 PM
Enable PULL-UP on the RX pin so it's not floating and picking up noise.
Make sure boards are properly grounded. Check signal when getting framing. Could be issues with polarity, stop/start bits, or bit timing.
2023-08-13 02:13 PM
Enable PULL-UP on the RX pin so it's not floating and picking up noise.
Make sure boards are properly grounded. Check signal when getting framing. Could be issues with polarity, stop/start bits, or bit timing.
2023-08-14 03:50 AM
That solved it once and for all!
Thank you very much!