Hal_init() never returns when TIM is selected (nucleo H755)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 10:40 AM
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
- Labels:
-
STM32CubeIDE
-
STM32H7 series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 10:50 AM
Do you have an IRQHandler for the TIM you're using?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 10:52 AM
Yes. It is automatically generated by the STM32Cube IDE. It also generates a callback that calls HAL_IncTick()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 11:12 AM
Where within Hal_init does it get stuck? The more info the better.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 11:23 AM
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 11:25 AM
Do I need an external crystal to use any timer as timebase source?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 11:36 AM
No
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 11:40 AM
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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 12:27 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-03 12:54 PM
>>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?
Up vote any posts that you find helpful, it shows what's working..
