cancel
Showing results for 
Search instead for 
Did you mean: 

Hal_init() never returns when TIM is selected (nucleo H755)

GCanc.1
Associate II

Hi Everyone!

I just received 10 STM32H755 nucleo boards to use in a project in the company I work for. However, I haven`t been able to use them.

I`m facing a problem with Hal_init(). When I select any timer as the Timebase Source Hal_init() never returns. However, when I select Systick, Hal_init() return just fine.

One more thing: I`m using the internal RC oscillator as the clock source.

Thanks a lot

Guilherme

11 REPLIES 11

Do you have an IRQHandler for the TIM you're using?

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

Yes. It is automatically generated by the STM32Cube IDE. It also generates a callback that calls HAL_IncTick()

TDK
Guru

Where within Hal_init does it get stuck? The more info the better.

If you feel a post has answered your question, please click "Accept as Solution".
GCanc.1
Associate II

Within the Hal_init(), it breaks at HAL_InitTick(TICK_INT_PRIORITY)

WIthin HAL_InitTick(TICK_INT_PRIORITY), it breaks at HAL_NVIC_EnableIRQ(TIM1_UP_IRQN)

GCanc.1
Associate II

Do I need an external crystal to use any timer as timebase source?

No

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

Put a break-point in TIM1_UP_IRQHandler()

Make sure you don't have a weak handler or C++ file with the handler in it.

Check the Map and Listing files to assure that the linker has bound the right routine, and make sure all pending sources are cleared prior to trying to exit the handler, otherwise it will simply reenter.

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

Hi guys. I found out that the problem is clock related. I changed a few clock parameters and things started to work. For some reason the CubeIDE didn`t complain about any clock values. I guess there must be a bug in some place.

I also realized that if I enable the PLL, the generated code fail to configure the clock.

I`m almost 100% sure that there must be a bug in Cube IDE

>>I'm almost 100% sure that there must be a bug in Cube IDE

It's an opportunity rich environment for them..

Is there some perceived advantage to using a TIM over SysTick for an interrupt driven timebase?

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