Associate II
February 15, 2017
Question
CubeMX, STM32L476, USART Parity problem
- February 15, 2017
- 4 replies
- 2276 views
Posted on February 15, 2017 at 12:22
Hello everybody,
I encountered the following problem when generating code from CubeMX for the USART peripheral of a STM32L476QEIx:
SETUP:
- STM32CubeMX 4.19.0
- CubeL4 Version 1.6.0
- CPU STM32L476QEIx
PROBLEM:
- USART1 is configured with Word length 9 bits (including parity) and Parity even (so I get 8 bits data and one parity-bit)
- But CubeMX does not set the parity information in the USART_InitTypeDef structure in the auto-generated function MX_USART1_Init()
- It sets the values of the structure-element for the parity options none and odd though - see the attached screenshots
- For even parity the USART-registers are not correctly initialized, i.e. the Parity-Enable bit is not set and therefore no parity generated -> so this really is a problem and leaves the USART incorrectly initialized!
Did anybody notice the same problem or knows how to solve it?
Thanks already and best regards
Markus
#uart/usart-parity-and-wordlengt #stm32l476 #cubemx