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?

2 REPLIES 2
db16122
Associate II

How about the HSE failing rate? It seems some board can working from your description...

FYI for AN5042 Application note
How to calibrate the HSE clock for RF applications on STM32 wireless MCUs

Peter BENSCH
ST Employee

@Kai_Giner 

Typically, with other STM32, the load capacitors for the HSE are indeed connected externally - however, this is not necessary for the STM32WB and STM32WBA, as you can read in:

  • for STM32WB in AN5165, section 3.4
  • for STM32WBA in AN5948, section 4.4

Therefore please remove C43 and C44.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.