2024-05-10 12:46 AM
I designed a circuit board with the STM32f765vgt6 chip following ST's hardware recommendations (two 2.2uF ceramic capacitors with low ESR connected to Vcap1, Vcap2).
I'm having the following issues: When I initialize the CPU clock frequency to 216MHz, there's a chance that the MCU initialization of the clock fails (the program is stuck at the SystemClock_Config()). If the clock initialization is successful, the main program runs for a while then runs into hardfault. However, with the same program, when I initialize the CPU frequency to 180MHz, everything works normally. All the clock initialization code were generated by using STM32CubeMX Ver6.10.0.
Is the STM32f765vgt6 chip supposed to operate well at 216MHz or did I make a mistake somewhere? When I measure the waveform on the VCAP pin of the MCU, as shown in the picture. Is there anything unusual about that waveform?
My clock initialization code:
void SystemClock_Config(void)
{
LL_FLASH_SetLatency(LL_FLASH_LATENCY_7);
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_7)
{
}
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
LL_PWR_EnableOverDriveMode();
LL_RCC_HSI_SetCalibTrimming(16);
LL_RCC_HSI_Enable();
/* Wait till HSI is ready */
while(LL_RCC_HSI_IsReady() != 1)
{
}
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI, LL_RCC_PLLM_DIV_8, 216, LL_RCC_PLLP_DIV_2);
LL_RCC_PLL_Enable();
/* Wait till PLL is ready */
while(LL_RCC_PLL_IsReady() != 1)
{
}
while (LL_PWR_IsActiveFlag_VOS() == 0)
{
}
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_4);
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_2);
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
/* Wait till System clock is ready */
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
{
}
LL_SetSystemCoreClock(216000000);
/* Update the time base */
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
{
Error_Handler();
}
}
2024-05-10 12:54 AM
Hello,
Is the STM32f765vgt6 chip supposed to operate well at 216MHz or did I make a mistake somewhere?
STM32F765 MCU could reach 216MHz (refer to the datasheet).
When I measure the waveform on the VCAP pin of the MCU, as shown in the picture. Is there anything unusual about that waveform?
VCAP and power supplies are not supposed to oscillate.
You need to check your power supply source. What about VDD?
2024-05-10 01:07 AM
VDD is stable 3.3V. Its OK
2024-05-10 01:18 AM
>Is there anything unusual about that waveform?
See the 2MHz oscillation ? :)
What shows scope on Vcap 1+2 at 180M ?
How far the 2u2 are away from cpu ? + ground plane on your board ?
Check capacity of the 2u2 caps . Is real 2u2 ?
2024-05-10 01:29 AM
+1 Yes and not from a 2n2 reel, stockroom or BoM issue