2024-10-17 04:13 AM
Hello,
I am using Nucleo-F401RE MB1136, want to run the board using the HSE, installed 8Mhz crystal on X3 with 22pf capacitors on C33 & C34 and 0 Ohm resistors on R35 & R37.
Using the CubeMx, configured the HSE pin as Crystal/Ceramic Resonator, set the clock in the Crystal Configuration for HSE as 8Mhz, tried both the ways, directly using HSE as System Clock and with using the PLL block.
Still not able to run the code as the code gets stuck in SystemClock_Config(void), no pulse is generated on the crystal.
Is there any step that i missed or some configuration, please guide me if possible. I am new into the Stm world. Provided the snippet of the CubeMx generated code.
Thank You
__weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
{
uint32_t tickstart;
uint32_t pll_config;
/* Check Null pointer */
if (RCC_OscInitStruct == NULL)
{
return HAL_ERROR;
}
/* Check the parameters */
assert_param(IS_RCC_OSCILLATORTYPE(RCC_OscInitStruct->OscillatorType));
/*------------------------------- HSE Configuration ------------------------*/
if (((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE)
{
/* Check the parameters */
assert_param(IS_RCC_HSE(RCC_OscInitStruct->HSEState));
/* When the HSE is used as system clock or clock source for PLL in these cases HSE will not disabled */
if ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSE) || \
((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE)))
{
if ((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF))
{
return HAL_ERROR;
}
}
else
{
/* Set the new HSE configuration ---------------------------------------*/
__HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState);
/* Check the HSE State */
if ((RCC_OscInitStruct->HSEState) != RCC_HSE_OFF)
{
/* Get Start Tick */
tickstart = HAL_GetTick();
/* Wait till HSE is ready */
while (__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET)
{
if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT;
}
}
}
Solved! Go to Solution.
2024-10-17 06:28 AM - edited 2024-10-17 06:33 AM
According to the board's schematics in this link, you need to remove SB50 (Solder bridge):
So search for SB50 on the board and unsolder it.
2024-10-30 01:40 AM
@SofLit wrote:search for SB50 on the board and unsolder it.
@AkshaySindal you don't even have to search - the User Manual shows you where it is: