cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G474 discovery kit HRTIM ISR (HRTIM1_TIMA_IRQHandler) not hit for channel set Interrupt(SETx1) and channel reset interrupt(RSTx1).

vchilapu
Associate II

Hi,

I have enabled the interrupts for channel set (SETx1) and channel reset (RSTx1) by setting bits RSTx1IE and SET1xIE. I am trying to drive the outputs to active-inactive state via software by writing to SST and RST bits of the TIMERA.

Inside the TIMAISR register I can see the SETx1 and RSTx1 interrupt event flags are set. This indicates the fact that output active-inactive state changes are driving the interrupts.

But I cannot see the respective ISR HRTIM1_TIMA_IRQHandler getting hit. While other interrupts are working fine and I can see the ISR gets executed in those situations, it is only for the SETx1 and RSTx1/SETx2 and RSTx2 I see this problem.

Is there any settings I could me missing that might cause this issue?

1 ACCEPTED SOLUTION

Accepted Solutions
Vincent Onde
ST Employee

Hi,

No, I meant that having RSTxIE and SETxIE set is not enough. The DIER register is duplicated , with a preload register (written by the CPU) and an active register (which actually controls the interrupt enable signal). To have the interrupt enabled, the content of the DIER_Preload must be transferred into the DIER_Active. There are multiple means to do this transfer (so called update), usually on counter roll-over. For a quick trial, you can force this update by software writing the TASWU bit in the HRTIM_CR2 register.

Best regards,

Vincent

View solution in original post

4 REPLIES 4
Vincent Onde
ST Employee

Hi,

Was the HRTIM_TIMADIER register updated after you've set the RSTxIE and SETxIE bits? This could explain the situation (interrupt enable bit set in preload register but not transferred into the active register). You can force an update without starting the timer with the TASWU bit in the HRTIM_CR2 register.

Hi Vincent,

You mean to say the below bits?

They are indeed set.

0693W00000QKuw0QAD.jpgAlso, please note the below flags are set that tell interrupt occurred:

0693W00000QKuwKQAT.jpg 

Vincent Onde
ST Employee

Hi,

No, I meant that having RSTxIE and SETxIE set is not enough. The DIER register is duplicated , with a preload register (written by the CPU) and an active register (which actually controls the interrupt enable signal). To have the interrupt enabled, the content of the DIER_Preload must be transferred into the DIER_Active. There are multiple means to do this transfer (so called update), usually on counter roll-over. For a quick trial, you can force this update by software writing the TASWU bit in the HRTIM_CR2 register.

Best regards,

Vincent

Yes! This works.. Either I can configure the preload settings in the CubeMX to write to active register directly and it works, or if preload settings are set to write to preload register, then an update event does the job.