Skip to main content
MHantke_001
Associate II
February 25, 2022
Question

HAL_GetTick() freezes MCU ???

  • February 25, 2022
  • 6 replies
  • 1791 views

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

This topic has been closed for replies.

6 replies

Mike_ST
ST Technical Moderator
February 25, 2022

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.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
MHantke_001
Associate II
February 25, 2022

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

Tesla DeLorean
Guru
February 25, 2022

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
MHantke_001
Associate II
February 25, 2022

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
February 25, 2022

OK Finally failure found.

reason was a floating level @boot0-Pin

many thanks for the help

BR's

Martin

Tesla DeLorean
Guru
February 25, 2022

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..