2021-06-09 12:52 AM
A board with STM32L071CBT6 and another with STM32L476RGT6. The former transmit 18 bytes data {02 6E 9B 3B 41 41 00 00 E7 41 96 83 C9 42 00 03 24 97} to the latter. the latter received {02 6E 9B 3B 41 41 00 00 E7 41 96 83 D9 42 00 03 24 97}, that's the 13th byte is wrong, C9 -> D9. The problem occurs randomly. When these two boards commnicate with PC by CH340, the problem above disappear.
2021-06-09 06:34 AM
I would look at the signal on a scope to see if edges are okay. Try a different baud rate.
2021-06-09 07:34 AM
Paul
2021-06-09 11:31 AM
While generally TDK and Paul gave clues, I'd guess its this https://community.st.com/s/question/0D53W00000W77UN/stm32l071-mcu-lpuart-use-lse-to-configure-baudrate-9600-actual-baudrate-is-8300-or-11000error-islarge-lse-is-32768khz-one-cycle-is-30517-usone-cycle-of-baudrate-9600-is-34-times-of-lsebut-lse-frequency-division-can-only-be-an-integral-multiple
i.e. 9600baud while clocking from 32.768kHz LSE. This is marginal, and prone exactly to this sort of errors, even if ST gives this as a working combinationi with no warning in the DS/RM. Without changing clock source, the only real soluion is to decrease baudrate (maybe to one, which is "nonstandard" i.e. not the usual 1200/2400/4800/9600, but which results in integer number of periods per bit).
JW