2017-03-01 11:49 PM
Hello,
I am working on STM32F302RC. I want to use the USART1 with parity enabled both odd/even which is configurable through command.
I am using
USART1
withbaudrate 115200,
data length8 bit , parity none with this configuration it works fine.
stop bit 1,
When I change the configuration of
USART1
to odd or even parity it doesn't work I get junk character on serial termina as shown below.sƒß2ØL<DC3> ›'šÚšQM¸·»'¹bé·-Hl?S<RS> <DC2> å¹7™JC1<SUB> œî<SO> ƒÃé4 ]\V<SYN> åßóöX-<ETX> ‚, Ø-Hl<HT> <HT> c<STX> �?<CR>
Š Rn-EEº�£{Zª^<SYN> kênæzVH<FF>•åÓIâQ7$<DC4> <SI> KUad¨�?ËégC1¨Ên-EEº�£{Zª^<SYN> kênæzVH<FF>•åÓIâQ7$<DC4> <SI> KUad¨�?ËégC1¨Ên-EEº�£{Zª^<SYN> kênæzVH<FF>•åÓIâQ7$<DC4> <SI> KUad¨�?ËégC1¨Ü]N<ETX> š�?éô<-Rë�•m ._<SYN> å ÔLJHüWhat could be the issue? Kindly suggest.
Thank you.
Solved! Go to Solution.
2017-03-02 05:07 AM
... so that we can unambiguously see which one is the startbit?
I agree.
Have a testcode on your stm32, send two test bytes with the parity bit set respectively not set, spaced by at least one frame length idle time.
2017-03-02 05:08 AM
It worked.
Why are we required to do this work around?
Is this an errata?
Thank you Waclawek.jan & Ava Tar for your support.
2017-03-02 05:32 AM
Ah, you've been caught by the rather non-conventional 'parity is last data bit' of the STM32 UART implementation...
On the waveform above, you've transmitted 0x40 0x0D 0x0A with 7 data bits and odd parity. Set the terminal to 7O1 and you'll see your transmitted data OK. Please do this just for the fun of it.
Then change the STM32 setting to 9 bits and you'll receive what you intended originally.
JW
2017-03-02 05:59 AM
Thank you Ava Tar..
2017-03-02 06:57 AM
Is this an errata?
No, rather a misleading implementation and documentation on ST's side.