cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4P5G-DK SystemClock_Config error

JKim.2
Senior

Hello,

 

I configured the STM32L4P5G-DK project with STM32CubeIDE according to the AN5050 for Octal-SPI PSRAM. At debugging state, the process was halt at SystemClock_Config. The infinite loop looks caused by while(READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U) after __HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState); step. The ioc file and main c-code is attached. Please help me to solve this issue.

 

Thanks.

3 REPLIES 3
TDK
Guru

> STM32L4P5G-DK

This board does not have an HSE crystal loaded. It is also disconnected from the 8 MHz clock signal from the ST-Link chip. So you can only use the internal HSI by default. Otherwise, you can bridge R49 and use the st-link clock, or load X3 and related caps/resistors to use the HSE crystal.

TDK_0-1742476249049.png

TDK_1-1742476403660.png

 

CubeMX really shouldn't be configuring X3 on this board by default, but it is, and this is the result.

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

Hello @TDK ,

 

Thank you for the comment. Is it possible to avoid the problem with modifying the source code? If so, could you show me the code snippet for the change? 

 

Thanks. 

Disable HSE in the IOC file and regenerate code.

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