cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WBA Can't Initialize HSE

Kai_Giner
Visitor

The problem I am facing is that I can't seem to get passed the SystemClock_Config() function call, more specifically, the HAL_RCC_OscConfig() function returns HAL_TIMEOUT in this part indicating that the HSE is not getting ready.

        /* Wait till HSE is ready */
        while (READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U)
        {
          if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE)
          {
            return HAL_TIMEOUT;
          }
        }
      }

 

I checked the load capacitance of the external crystal and tried to trim the clock using the registers on the STM32 by using HAL_RCCEx_HSESetTrimming() but I was unable to find how the value in the register maps to a specific capacitance. This led me trying every single possible value (0-0x3F) but that made no difference. I have already resoldered a new crystal and a new STM32 so I am now believing the I have a layout issue in my PCB that's causing the crystal to not start. I have checked the Power to VDDRF as well

Kai_Giner_4-1780545221710.png

crystal: ECS-320-CDX-2152

Kai_Giner_5-1780545236351.pngKai_Giner_6-1780545249462.pngKai_Giner_7-1780545291789.png

 

Any idea what the issue could be?

0 REPLIES 0