The HAL_TIM_PeriodElapsedHalfCpltCallback function doesn't generate an interrupt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-02 5:38 AM
That's how it looks:
- Started the TIM4 interrupt mode:
/* USER CODE BEGIN 2 */
HAL_TIM_Base_Start_IT(&htim4);
/* USER CODE END 2 */
- The counter values should be incremented in the middle and in the end of the period, however it doesn't happen. There is a problem with the HAL_TIM_PeriodElapsedHalfCpltCallback function. The half_elapsed variable is not inctemented during debugging.
/* USER CODE BEGIN 4 */
void HAL_TIM_PeriodElapsedHalfCpltCallback(TIM_HandleTypeDef *htim)
{
half_elapsed++;
}
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
elapsed++;
}
/* USER CODE END 4 */
- These are my Cube settings:
- Labels:
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-02 6:42 AM
HAL_TIM_PeriodElapsedHalfCpltCallback is not called in most scenarios, including this one. It's used during certain DMA transfers and is called when the DMA's HT interrupt kicks off.
Despite the name, and despite the poor documentation of this function, there is no timer interrupt option for half of the period elapsed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-03 1:08 AM
Thank you very much, TDK. :smiling_face_with_smiling_eyes: I will find another sotution then.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-26 1:45 AM
"HAL_TIM_PeriodElapsedHalfCpltCallback is not called in most scenarios, including this one. It's used during certain DMA transfers and is called when the DMA's HT interrupt kicks off."
"Certain DMA" ... but in DMA2 I use I have no call at HalfCplt .... :- (
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-26 2:16 AM
Start a new thread, stating what's your hardware and software, what are the expectations and how are the symptoms different from them.
Read out and check TIM and relevant DMA registers content. If you see the respective DMA status bit being set but still no interrupt, some generic "interrupt does not fire" troubleshooting hints here.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-26 5:03 AM
Which STM32 are we talking about? Not all STM32 are the same rspective to DMA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-27 11:58 AM
I was tryng a simple example on a Ncucleo STM32F401RE: read and convert on ADC1 internal temperature sensor and VCal (for calibration), cotrolling the start conversion via TIM3 (each 1000 mSec) and tranferring data on a buffer via DMA2. At half time I need toggle a led (is more clear) . But ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-28 4:34 PM
The previously mentioned callback is for half of the DMA items. If you need half of the timer period, just use an output compare channel to toggle a pin and/or get an interrupt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-29 8:49 AM
Many thanks. I'd changed the structure and resolved the problem. I use the timer at a higer Tim3 pulse frequency (100 times higer) and I set DMA to complete the transfers on 100 lectures.
In this way i can control the pulse number ( olso in this way there is no half time call from DMA).
Many thanks.
