AnsweredAssumed Answered

STM32F429 Cannot set baud rate less then 9600

Question asked by EGol on Jan 8, 2016
Latest reply on Jan 9, 2016 by EGol
I have a target board that is based on the STM324x9I_EVAL, I need to use 2 UARTS, I set up UART4 and USART1 both at 1200 BAUD, my clock is 180MHz with HSE of 25MHz.

The strange thing I'm facing is that (from application reason) I need to use 1200 BAUD on those UARTs, the UART4 is set and working as expected but the USART1 when setting to baud rate higher then 9600 worked fine and if I try to use lower baud rates the output is 9600 for setup of 1200, 4800 for setup of 600, 2400 for 300 and when I tried 150 I got unreadable data.
What is going on? What am I'm doing wrong?
This is my setup code:
OperationalUartHandle.Instance = USART1;
OperationalUartHandle.Init.BaudRate = 1200;
OperationalUartHandle.Init.WordLength = UART_WORDLENGTH_8B;
OperationalUartHandle.Init.StopBits = UART_STOPBITS_1;
OperationalUartHandle.Init.Parity = UART_PARITY_NONE;
OperationalUartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
OperationalUartHandle.Init.Mode = UART_MODE_TX_RX;
OperationalUartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
if(HAL_UART_Init(&OperationalUartHandle) != HAL_OK){
And the MSP:
GPIO_InitStruct.Pin       = USARTx_TX_PIN;
GPIO_InitStruct.Mode      = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull      = GPIO_PULLUP;
GPIO_InitStruct.Speed     = GPIO_SPEED_HIGH;
GPIO_InitStruct.Alternate = USARTx_TX_AF;
GPIO_InitStruct.Pin = USARTx_RX_PIN;
GPIO_InitStruct.Alternate = USARTx_RX_AF;