2024-07-21 09:31 PM
Why the uart stops working on stm32h755 device once the core clock has been modified and code has been generated using cubemx. It comes with a BSP code for serial communication (which i tried seperately) , that is also not working once the core clock has been modified.
by defualt the core clock is in 64Mhz, if i switch the core to HSI with core running at 400Mhz the uart is giving garabage on the terminal in a fresh project.
This is the initilization function generated by cubemx
void MX_USART3_UART_Init(void)
{
/* USER CODE BEGIN USART3_Init 0 */
/* USER CODE END USART3_Init 0 */
/* USER CODE BEGIN USART3_Init 1 */
/* USER CODE END USART3_Init 1 */
huart3.Instance = USART3;
huart3.Init.BaudRate = 115200;
huart3.Init.WordLength = UART_WORDLENGTH_8B;
huart3.Init.StopBits = UART_STOPBITS_1;
huart3.Init.Parity = UART_PARITY_NONE;
huart3.Init.Mode = UART_MODE_TX_RX;
huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart3.Init.OverSampling = UART_OVERSAMPLING_16;
huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart3.Init.ClockPrescaler = UART_PRESCALER_DIV1;
huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&huart3) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetTxFifoThreshold(&huart3, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetRxFifoThreshold(&huart3, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_DisableFifoMode(&huart3) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN USART3_Init 2 */
/* USER CODE END USART3_Init 2 */
}
The reason I am posting this here is that I have access to a couple of other STM32 devices where I have done the same but haven't faced such an issue.
I am currently using the 1.11.2 STM32H7 package.
Solved! Go to Solution.
2024-07-22 01:43 AM
Hello,
I didn't reproduce the issue @400Mhz (attached the modified ioc file). "Welcome to STM32 world !" is well displayed.
Are you using the latest version of CubeMx 6.12.0 ?
Check also your cable.
2024-07-22 01:14 AM
Hello,
. It comes with a BSP code for serial communication (which i tried seperately)
Which board are you using?
Could you please share your ioc file?
2024-07-22 01:28 AM
2024-07-22 01:43 AM
Hello,
I didn't reproduce the issue @400Mhz (attached the modified ioc file). "Welcome to STM32 world !" is well displayed.
Are you using the latest version of CubeMx 6.12.0 ?
Check also your cable.
2024-07-22 01:54 AM
No, i was not using the latest version of CubeMX. updated and now it is working. Thank you @SofLit