cancel
Showing results for 
Search instead for 
Did you mean: 

Unable To Activate PLL64M on STM32WB05TZ/BlueNRG-LPS

DCMilla
Associate II

I'm building an application for a BlueNRG-LPS (332), now rebranded as STM32WB05TZ (WLCSP-36 Package) by starting with a simply Blinky project testing the clock signals of my device. I need to enable the PLL64M clock source to use the radio peripherals, and the generated configuration fails. Maybe I'm missing to add or properly set up something here?

Context:
I'm using STM32CubeIDE 1.16.0 with STM32Cube FW_WB0 V1.0.0 to generate some basic code.
Initially, all the Radio Peripherals are OFF, I'm using a 32MHz external crystal for the HSE, and do not have an LSE installed on my PCB (planning to have one, but for now, using the LSI). 
In my particular case, I added external 12pF capacitors to my HSE crystal, and set the chip's internal tuning capacitors to 0. (Ignore the inductor symbol, this is only a 0ohm resistor)

DCMilla_3-1725992152306.png

 


The PCB has the hardware to not work on SMPS mode (no Inductor), tried 2.4V and 3.3V as the VDD source with similar results.

My clock tree initially looked like following image, checking the MCO pin with an oscilloscope tells me that indeed the HSE signal looked proper. (1MHz as expected after the 32x division on the pin itself).

DCMilla_1-1725990045903.png


DCMilla_0-1725989851102.png

Using the exact same settings, but changing the RC64MPLL from using HSI RC to PLL64M input, fails with the following error:

DCMilla_2-1725990496445.png

 

// main.c

void SystemClock_Config(void)
{
  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

  /** Initializes the RCC Oscillators according to the specified parameters
  * in the RCC_OscInitTypeDef structure.
  */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.LSIState = RCC_LSI_ON;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }

  /** Configure the SYSCLKSource and SYSCLKDivider
  */
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_RC64MPLL;
  RCC_ClkInitStruct.SYSCLKDivider = RCC_RC64MPLL_DIV2;

  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_WAIT_STATES_0) != HAL_OK)
  {
    Error_Handler(); // <-------------------------------------------------- FAILS HERE 
  }
  HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_32);
  HAL_RCCEx_EnableLSCO(RCC_LSCO1, RCC_LSCOSOURCE_LSI);
}

 

Stepping further within "HAL_RCC_ClockConfig":

 

//stm32wb0x_hal_rcc.c

/* RC64MPLL is selected as System Clock Source */
  if (RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_RC64MPLL)
  {
    /* Check the HSI ready flag */
    if (LL_RCC_HSI_IsReady() == 0U)
    {
      return HAL_ERROR;
    }

    /* Check the HSE ready flag */
    if (LL_RCC_HSE_IsReady() == 0U)
    {
      return HAL_ERROR;
    }

    /* Enable the RC64MPLL*/
    __HAL_RCC_RC64MPLL_ENABLE();

    /* Get Start Tick*/
    tickstart = HAL_GetTick();

    /* Wait till RC64MPLL is ready */
    while (LL_RCC_RC64MPLL_IsReady() == 0)
    {
      if ((HAL_GetTick() - tickstart) > PLL_TIMEOUT_VALUE)
      {
        return HAL_TIMEOUT; // <---------------------------------------- FAILS HERE
      }
    }

    /* Configure the RC64MPLL multiplication factor */
    __HAL_RCC_RC64MPLL_PRESC_CONFIG(RCC_ClkInitStruct->SYSCLKDivider);
  }

 

Other notes: 
While loop only has GPIO toggle function and nothing else. 

Any hints as to why the LL_RCC_RC64MPLL_IsReady() would constantly fail? 

Thanks,
DC.

 

 

3 REPLIES 3
STTwo-32
ST Employee

Hello @DCMilla 

Could you share the error that you are having. For me, the only error I can see is that the "GPIO_InitStruct.Alternate = GPIO_AF3_SYS;" on the MCO pin Configuration should be changed to "GPIO_InitStruct.Alternate = GPIO_AF3_MCO;" and I've escalate it to the concerned team for correction (under internal ticket number 190852)

Best Regards.

STTwo-32

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.

DCMilla
Associate II

Hi @STTwo-32 , 

Aside from what you mentioned I get no error while compiling the code. 
It's when executing it that the codes gets halted timing out for the PLL to respond on the line I showed above, which makes the generated code get into the error handler with a forever while loop (as it should when it fails).

I found in one of the application notes for the STM32WB series (AN5042) that the tunning capacitors can only be modulated between 12pF and 16pF, perhaps my problem is to have external capacitors in the chip, thinking that setting the HSE tunning capacitors to 0 meant "0pF" of load added. I see the STEVAL-IDB013V1 schematic does not have external capacitors.

DCMilla_0-1726074676136.png


This application note doesn't seem to be linked on neither the BlueNRG-LPS nor the STM32WB05 ST Pages, and could not find it between it's linked documents. Could you help me confirm if this applies to the STM32WB05TZ chip?

Best regards,
David C.

DCMilla
Associate II

Hi, 
An update here:

I have tested removing my external load capacitors for the HSE Resonator (C412 and C413 from my initial picture), and adjusting the Tuning Capacitor values under the "RCC" STM32Cube section. 
The resulting frequency of the clock is indeed closer to the expected value (checked using the MCO pin), but the PLL continues to not work. 

I saw on a different post that some chips such as the STM32L4 series often need mandatorily an LSE source to calibrate the PLL mode on some of the clocks, but could not find any comment about it in the reference manual. 

Can anyone confirm if this is the case for the STM32WB05/BlueNRG-LPS? 
 
Thanks,
David C.