cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX counts USART parity as data? A bug in CubeMX

LMI2
Lead

Actually it says it counts parity bit in USART word lenght. I'm pretty sure that is not so and perhaps even not what they would actually do, and what is word in this contekst anyway.

0693W000000WnX8QAK.png

5 REPLIES 5
TDK
Guru

It counts it in the word length. Whether or not you consider it data is up to you. CubeMX is just following what the chip does. Start bit + word + stop bit(s).

If you feel a post has answered your question, please click "Accept as Solution".

ST has done this forever.

8E1 would be 9-bit with Even Parity in the 9th bit, advisable to mask the read of the data register

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
LMI2
Lead

Has anyone ever user parity bit.

Yes.
Used by the bootloader as well.
If you feel a post has answered your question, please click "Accept as Solution".
MarcV
Associate II

Programming the usart was about the very first thing I did with STM32 and CubeMX and I immediately ran into a CubeMX bug. I had to setup a communication using 8 databits, even parity, one stopbit and couldn't get it to work. After a bit of frustration I tried the same program but I modified the code on both ends to use 8 databits and NO parity and it worked right away. It turned out that, when using 8E1 parameters, CubeMX has to set the usart to 9 databits but instead it set 8 databits, causing the communication to fail. So whenever I make a modification to the project in MX and regenerate the code, I have to remember to manually correct the generated output.