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.
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.
Hello,
I am not sure how you check the SWT but by default is it set:
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
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