cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_GetTick() freezes MCU ???

MHantke_001
Associate II

Hello Community,

i have an empty project with STM32L051R8 MCU.

Project was created with

CubeIDE Version: 1.8.0

Build: 11526_20211125_0815

Only the OscillatorPins for external 8MHz crystal, RCC_MCO and SWDIO+SWCLK have been configured.

HSE is used for PLL Source and PLLCLK for SYSCLK.

Now i see that in function HAL_RCC_ClockConfig(...)

in functionality:

  else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK)

  {

   while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLCLK)

   {

    if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE)

    {

     return HAL_TIMEOUT;

    }

   }

  }

The MCY calls signal Handler 0xffffffff9

and 0xffffff1

Are there any information how to get the programm running?

Many thanks in advance

BR's

martin

6 REPLIES 6
Mike_ST
ST Employee

Hello,

It seems like you can't switch to the PLL as system clock source, for some reason.

Most of the time it is because of improper PLL parameters or because the oscillator driving the external XTAL (HSE) can't start.

Freezes the MCU, or gets stuck in the HardFault_Handler, or some other IRQ Handler, or SysTick, etc.

When you stop in the debugger, where is it?

Does it get stuck in the loop because the tick doesn't advance?

HSE starts and clocks?

Flash wait states consistent with the speed you're attempting to clock the MCU when it switches to the PLL speed?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

0693W00000KaZhCQAV.pngExternal XTAL works as expected. and configuration is as in the picture shown.

MHantke_001
Associate II

I will check Flash wait states...

HSE starts and SysTickTimer is counting. it seems no SysTickInterrupt is thrown?

see picture below

0693W00000KaZmqQAF.png

MHantke_001
Associate II

OK Finally failure found.

reason was a floating level @boot0-Pin

many thanks for the help

BR's

Martin

So mapping of zero address space, and vector table.

Would explain the 0x1FFFxxxx address in the stack-dump

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..