‎2022-02-02 05:38 AM
That's how it looks:
/* USER CODE BEGIN 2 */
HAL_TIM_Base_Start_IT(&htim4);
/* USER CODE END 2 */
/* 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 */
‎2022-02-02 06: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.
‎2022-02-03 01:08 AM
Thank you very much, TDK. :smiling_face_with_smiling_eyes: I will find another sotution then.
‎2022-11-26 01: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 .... :- (
‎2022-11-26 02: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
‎2022-11-26 05:03 AM
Which STM32 are we talking about? Not all STM32 are the same rspective to DMA
‎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 ....
‎2022-11-28 04: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.
‎2022-11-29 08: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.