cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 device uart is not working after changing core clock

sarun
Associate III

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 */

}

sarun_0-1721621910331.png

sarun_1-1721622434813.png

 

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.

 

0 REPLIES 0