cancel
Showing results for 
Search instead for 
Did you mean: 

I can't get the HRTIM interrupt to trigger when setting the Interrupt request source in STM32CubeMX/5.0.0/5.1.0.

WTom
Associate III

I’ve attached a screen capture of the STCubeMX HRTIME configuration , and one showing the HETIME PWM capture on the oscilloscope. The code generation created a global interrupt for HRTIME. I inserted a toggle call �? HAL_GPIO_TogglePin(GPIOB,5);�? as the first statement in the interrupt to see if the interrupt gets triggered. It does not get triggered, and I have verified the pin toggle works when inserted in the while(1) loop.0690X0000088bypQAA.png

 pTimerCfg.InterruptRequests = HRTIM_MASTER_IT_NONE;
  pTimerCfg.DMASrcAddress = 0x0000;
  pTimerCfg.DMADstAddress = 0x0000;
  pTimerCfg.DMASize = 0x1;
  pTimerCfg.HalfModeEnable = HRTIM_HALFMODE_DISABLED;
  pTimerCfg.PreloadEnable = HRTIM_PRELOAD_DISABLED;
  pTimerCfg.RepetitionUpdate = HRTIM_UPDATEONREPETITION_DISABLED;
  pTimerCfg.DelayedProtectionMode = HRTIM_TIMER_D_E_DELAYEDPROTECTION_DISABLED;
  pTimerCfg.UpdateTrigger = HRTIM_TIMUPDATETRIGGER_TIMER_E;
  if (HAL_HRTIM_WaveformTimerConfig(&hhrtim1, HRTIM_TIMERINDEX_TIMER_E, &pTimerCfg) != HAL_OK)
  {
    Error_Handler();
  }

0690X0000088c3kQAA.bmp

1 REPLY 1
WTom
Associate III

Just to let anyone working on the HRTIM on the interrupt problem, I got the interrupt working by patching it with the inline assembler C statement to change the "pTimerCfg.InterruptRequests = proper interrupt;" until it gets fixed in the next release of SW4STM32. With all the bugs, if you can't wait for the fix, you'll have to patch it with the "assembler" C statements to modify the registers as needed (read up reference manual for register function as needed).