2019-03-22 09:04 PM
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.
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();
}
2019-03-27 03:54 PM
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).