View previous topic :: View next topic |
Author |
Message |
aboutin33
Joined: 12 Nov 2009 Posts: 3
|
Code enter ISR prologue while stepping over a C function |
Posted: Thu Nov 12, 2009 9:08 am |
|
|
PIC18F97J60 with ethernet MAC
PCWH V 4.098
ICD-U40
When single stepping over a C function, the debugger instead service the next interrupt pending starting addr 0x0008. This is annoying because once this ISR is serviced, there is another pending interrupt that cause the debugger to go again at addr 0x0008. I never get to single step over my code.
Is there a way to disable interrupts during single stepping or tell the debugger not to step in interrupts ?
I tried to disable the interrupts manually by writing directly in INTCON in the SFR debug window when single stepping, but the debugger won't allow me to overwrite this register.
Alain Boutin |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 12, 2009 2:45 pm |
|
|
Just comment the line in your program for
Code: | enable_interrupts(GLOBAL); |
and re-compile. Then debug it without interrupts active. |
|
|
aboutin33
Joined: 12 Nov 2009 Posts: 3
|
|
Posted: Thu Nov 12, 2009 6:57 pm |
|
|
I did disable global interrupts like you said, but the TCP stack want the timer interrupt to function, the UART is also serviced by an ISR and must function also.
Most of the ICD for other microcontroller have a feature to disable interrupts servicing during singlestepping.
Where is this functionnality in the PCWH ?
And how do we change INTCON under debugger control ?
Thanks in advance...
Alain B |
|
|
Wayne_
Joined: 10 Oct 2007 Posts: 681
|
|
Posted: Fri Nov 13, 2009 2:49 am |
|
|
I would set a break point at the next instruction and then use run. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Nov 13, 2009 3:47 am |
|
|
With PIC24 and MPLAB, I disabled global or specific (depends on the debugging purpose) interrupts manually in SFR. I don't know, if it works with PIC18. Curiously, one interrupt was still performed after disabling it globally, most likely because the old interrupt status was popped from the stack by the ICD stub.
You're right, that this functionalilty should be offered by MPLAB or CCS debugger as an automatic feature. |
|
|
aboutin33
Joined: 12 Nov 2009 Posts: 3
|
|
Posted: Fri Nov 13, 2009 10:14 pm |
|
|
Yes Wayne, moving a breakpoint down, line by line works, but tedious.
CCS should implement interrupts disable during single stepping.
AB |
|
|
|