2024-01-11 06:58 PM
Hello everyone in the community.
■What you want to do
I want to check the waveform of the signal output using "Master Clock Output1" of "RCC"
■Problems occurring:
I tried to check the operation using "Master Clock Output1" of "RCC", but a timeout occurred at the position below and the process could not proceed.
Please help us resolve the issue.
〇main.c:void SystemClock_Config(void)
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.LSEState = RCC_LSE_BYPASS;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
// ↓↓↓Timeout occurs here↓↓↓
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
〇stm32f2xx_hal_rcc.c:void SystemClock_Config(void)
/* Set the new LSE configuration -----------------------------------------*/
__HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState);
/* Check the LSE State */
if((RCC_OscInitStruct->LSEState) != RCC_LSE_OFF)
{
/* Get Start Tick */
tickstart = HAL_GetTick();
/* Wait till LSE is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET)
{
if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT; ←here
}
}
}
■Environment:
・Windows
・STM32CubeIDE_1.12.1
・nucleo-f207zgt6
・C language
■Settings made
・RCC
・RTC
・Clock Configuration
Solved! Go to Solution.
2024-01-11 07:35 PM
If LSE fails to start, perhaps your hardware doesn't have a crystal, or has the wrong crystal, or incorrect load capacitors. What hardware is this?
See AN2867 for help choosing an oscillator:
2024-01-11 07:35 PM
If LSE fails to start, perhaps your hardware doesn't have a crystal, or has the wrong crystal, or incorrect load capacitors. What hardware is this?
See AN2867 for help choosing an oscillator:
2024-01-15 04:16 PM
thank you,
As you pointed out, the cause was selecting the wrong crystal oscillator.
Thanks to you, I was able to resolve the issue successfully.