SWT1_IRQHandler is executing even after internal software watchdog is disabled

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SWT1_IRQHandler is executing even after internal software watchdog is disabled

365 Views
krishnaduriseti
Contributor I

Hello Team,

I am running FreeRTOS on MPC5777C and i have some problem with SWT_IRQ.

I have disabled the SWT but still my code jumps toSWT1_IRQHandler() when it executes__asm__ ("se_illegal \n\t se_nop "); assembly instruction.

This assembly instruction i have added for debug purposes to pause the execution when running in debug mode and that works fine. But when I disconnect the debugger and run the code SW jumps to SWT1_IRQHandler().

I couldn't understand why the SWT1 IRQ is being executed though I have disabled SWT1 Module and interrupts. Is this a common handler for some other exception

Any suggestions or ideas would be greatly appreciated.

Thank you very much.

Regards,

Krishna.

Labels (1)
Tags (1)
0 Kudos
3 Replies

348 Views
krishnaduriseti
Contributor I

Hello Peter,

 

Thank you very much for reply. But i have checked my entire code and I am not enabling the SWT in entire code and its disabled always. I have also checked the SWT registers both A and B CR.WEN bit and its 0 always.

Then how come this SWT1 ISR is executing not clear for me. Is this ISR used for some other exceptions?

Best regards,

Krishna.

0 Kudos

337 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I am not sure how you check the SWT but by default is it set:

petervlna_0-1699001451007.png

Not sure what represents your IRQ handler as this device has 2 SWT (SWT_A and SWT_B).

In your IRQ, do you see the TIF flag for SWT set on module A or B?

Then how come this SWT1 ISR is executing not clear for me. Is this ISR used for some other exceptions?

Because your SWT is enabled and has expired. No big magic here. HW will set TIF flag, which will trigger IVOR4, where the offset points to SWT interrupt.

If the SWT is not enabled, TIF is not set, and no IVOR4 is called.

Debugging SWT is tricky as as soon as you attached debugger will disable it. So you will see WEN =0.

You better use SW to store the SWT CR register value in ISR when it is called and read that variable by debugger.

Best regards,

Peter

0 Kudos

352 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I have disabled the SWT but still my code jumps toSWT1_IRQHandler() when it executes__asm__ ("se_illegal \n\t se_nop "); assembly instruction.

Hmm, this is not related. Your SWT TIF flag is just set and once you execute any instruction it will jump ISR.

But when I disconnect the debugger and run the code SW jumps to SWT1_IRQHandler().

In debug mode, majority of debuggers automatically disable SWT to be able step trough code. So what you see is most probably correct.

I couldn't understand why the SWT1 IRQ is being executed though I have disabled SWT1 Module and interrupts.

Well, make sure you disable it in your SW. As in debug mode you will see it disabled all the time until you enable SWT in debug mode in your debug interface.

Best regards,

Peter

 

0 Kudos