cancel
Showing results for 
Search instead for 
Did you mean: 

I tried to check the operation using "Master Clock Output1" of "RCC", but a timeout occurred and the

t-oka
Associate III

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

toka_1-1705027706388.png

・RTC

toka_2-1705027775016.png

・Clock Configuration

toka_3-1705027828466.png

toka_4-1705027923134.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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:

https://www.st.com/resource/en/application_note/an2867-oscillator-design-guide-for-stm8afals-stm32-mcus-and-mpus-stmicroelectronics.pdf

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

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:

https://www.st.com/resource/en/application_note/an2867-oscillator-design-guide-for-stm8afals-stm32-mcus-and-mpus-stmicroelectronics.pdf

 

If you feel a post has answered your question, please click "Accept as Solution".
t-oka
Associate III

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.