[CubeMX BUG/REQUEST] add USER CODE to HAL_TIM_PeriodElapsedCallback if a timer is used for timebase (freertos)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-17 4:20 PM
Posted on May 18, 2016 at 01:20
The title says it all.
I'm using the freertos middleware and configured CubeMX to use tim7 as timebase. As a result, CubeMX generates the stm32f3xx_hal_timebase_TIM.c file and in there defines the IRQ Callback void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { HAL_IncTick(); } This is rather unfortunate, though, as without user code I cannot modify it to use other timers as well. Suggestion, change it to: void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { /* USER CODE START 1 */ /* USER CODE END 1 */ if (htim->Instance == TIMxx) { HAL_IncTick(); } /* USER CODE START 2 */ /* USER CODE END 2 */ } And place this at the bottom of the main.c file. Otherwise I cannot include needed headers etc. NOTE: TIMxx is the timer which was selected as timebase. Thanks!
This discussion is locked. Please start a new topic to ask your question.
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-18 6:53 AM
Posted on May 18, 2016 at 15:53
Hi Valentin,
I will communicate your feedback to our CubeMx team .-Hannibal-Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-06-06 7:41 PM
Posted on June 07, 2016 at 04:41
Thanks a lot!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-10-06 8:22 AM
Posted on October 06, 2016 at 17:22
Dear Valentin,
Issue fixed since STM32CubeMX release 4.15.
Best regards
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-10-24 1:35 PM
Posted on October 24, 2016 at 22:35
Great job!
Thanks for fixing that!