s32d: How to disable interrupts while single step debugging?

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

s32d: How to disable interrupts while single step debugging?

Jump to solution
3,322 Views
yulianmatev
Contributor III

Hi,

 

This is my configuration:

 

  • IDE: S32 Design Studio (Version 1.0)
  • Debugger: PE micro
  • Device: MPC5748G

 

I am trying to debug a simple application which has a timer interrupt configured inside. Single step debugging is possible for this project only before interrupts are enabled. After interrupts are enabled single stepping is only possible inside interrupt service routine.

 

I am not able to see an option inside project debug configuration that will allow me to disable interrupts while single stepping. Is there a GDB command which I need to set inside Debugger→GDB Client Settings → Commands in order to disable interrupts during debugging ?

 

 

Best regards,

Yulian

Labels (1)
0 Kudos
1 Solution
2,604 Views
martin_kovar
NXP Employee
NXP Employee

Hi Yulian,

there is no option for disable interrupts while single stepping in debugger options. The only way is to disable EE bit directly in MSR register.

But from my point of view, your problem is following (please correct me, if I am wrong). You have PIT timer which generates some time period and then interrupt is called. So before you are able to single step code in the interrupt, another interrupt is occurs. This causes, you are still in the interrupt handler. If this is your issue, there is simple solution. You can set freeze bit in PIT MCR register. This cases, that timer is stopped in debug mode.

Please let me know, if this solution is suitable for you.

Regards,

Martin

View solution in original post

3 Replies
2,605 Views
martin_kovar
NXP Employee
NXP Employee

Hi Yulian,

there is no option for disable interrupts while single stepping in debugger options. The only way is to disable EE bit directly in MSR register.

But from my point of view, your problem is following (please correct me, if I am wrong). You have PIT timer which generates some time period and then interrupt is called. So before you are able to single step code in the interrupt, another interrupt is occurs. This causes, you are still in the interrupt handler. If this is your issue, there is simple solution. You can set freeze bit in PIT MCR register. This cases, that timer is stopped in debug mode.

Please let me know, if this solution is suitable for you.

Regards,

Martin

2,604 Views
yulianmatev
Contributor III

Hello Martin,

Thank you for your reply. Your solution:

     Setting the freeze bit (FRZ) inside the Periodic Interrupt Timer Module Configuration Register (PIT.MCR) is what I was looking for. Timer interrupt is no more generated during a debug session so single stepping is possible.

Best regards,

Yulian

0 Kudos
2,604 Views
martin_kovar
NXP Employee
NXP Employee

Hello Yulian,

I am glad that my previous answer solves you problem, but I forgot about one important point. There is defect in S32DS about this freeze bit. After PIT timer overflow and TIF bit has to be done, this does not occur in S32DS. It means, that interrupt will never occur while freeze bit is set, because TIF will never be set. Please keep this in your mind.

Regards,

Martin

PS: If you have enabled Instruction Stepping Mode during the debugging, try to disable this feature. This should also solve your problem.

pastedImage_1.png