EmbeddedRelated.com
Forums

Crossworks - breakpoint in ISR?

Started by Markus Zingg February 8, 2008
Hi all,

I'm new to crosswork and ARM, so please bear with me if this is a dumb
question.

I'm trying to debug code which uses an interrupt service routine. I use
ctl_set_isr() which hopefully should let me set the IRQ vector so as it
points to the interrupt routine within my code. I also set a breakpoint
in that routine. However, the code does not seem to be called, well, the
breakpoint (on the entry of the fuction) is never hit. Now, is this
because setting breakpoints in an ISR routine is not possible (don't
laugh, I used to work with environements where this is the case) or can
I asume I screwed something up? I figure the latter is the case, but I
thought I ask bevore I spend much time on this just to find out my
envireonement does not allow me to debug this. I may have to add I'm
using the amontec JTAG tiny. Anything else that I could/should check?

TIA

Markus

An Engineer's Guide to the LPC2100 Series

You enable VIC int and IRQ or FIQ?

Marcelo

----- Original Message -----
From: "Markus Zingg"
To:
Sent: Friday, February 08, 2008 10:54 AM
Subject: [lpc2000] Crossworks - breakpoint in ISR?
> Hi all,
>
> I'm new to crosswork and ARM, so please bear with me if this is a dumb
> question.
>
> I'm trying to debug code which uses an interrupt service routine. I use
> ctl_set_isr() which hopefully should let me set the IRQ vector so as it
> points to the interrupt routine within my code. I also set a breakpoint
> in that routine. However, the code does not seem to be called, well, the
> breakpoint (on the entry of the fuction) is never hit. Now, is this
> because setting breakpoints in an ISR routine is not possible (don't
> laugh, I used to work with environements where this is the case) or can
> I asume I screwed something up? I figure the latter is the case, but I
> thought I ask bevore I spend much time on this just to find out my
> envireonement does not allow me to debug this. I may have to add I'm
> using the amontec JTAG tiny. Anything else that I could/should check?
>
> TIA
>
> Markus
>
> From: l... [mailto:l...] On
> Behalf Of Markus Zingg
> Sent: 08 February 2008 13:54
> To: l...
> Subject: [lpc2000] Crossworks - breakpoint in ISR?
>
> Hi all,
>
> I'm new to crosswork and ARM, so please bear with me if this is a dumb
> question.
>
> I'm trying to debug code which uses an interrupt service routine. I use
> ctl_set_isr() which hopefully should let me set the IRQ vector so as it
> points to the interrupt routine within my code. I also set a breakpoint
> in that routine. However, the code does not seem to be called, well,
> the breakpoint (on the entry of the fuction) is never hit.

Have you called ctl_global_interrupts_enable(), for instance?

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
Hi Paul,

Thanks for your prompt reply. I first didn't, added this now, but
unfortunately still no joy.

So, am I correct that

- It should be possible to debug an isr routine?

The generall way to set up an isr is to:

- declare and code it (that was yesterdays topic :-)
- setup the hardware (setting register values etc. pp.)
- set the vector using ctl_set_isr()
- then call ctl_global_interrupts_enable()

Anything else I missed?

Markus
Paul Curtis schrieb:
>
> > From: l...
> [mailto:l... ] On
> > Behalf Of Markus Zingg
> > Sent: 08 February 2008 13:54
> > To: l...
> > Subject: [lpc2000] Crossworks - breakpoint in ISR?
> >
> > Hi all,
> >
> > I'm new to crosswork and ARM, so please bear with me if this is a dumb
> > question.
> >
> > I'm trying to debug code which uses an interrupt service routine. I use
> > ctl_set_isr() which hopefully should let me set the IRQ vector so as it
> > points to the interrupt routine within my code. I also set a breakpoint
> > in that routine. However, the code does not seem to be called, well,
> > the breakpoint (on the entry of the fuction) is never hit.
>
> Have you called ctl_global_interrupts_enable(), for instance?
>
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
>
> CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
>
>
Hi,

> So, am I correct that
>
> - It should be possible to debug an isr routine?

Yes. I breakpoint in ISRs pretty routinely.

> The generall way to set up an isr is to:
>
> - declare and code it (that was yesterdays topic :-)
> - setup the hardware (setting register values etc. pp.)
> - set the vector using ctl_set_isr()
> - then call ctl_global_interrupts_enable()
>
> Anything else I missed?

You need to unmask the interrupt source to allow it through the interrupt
controller,

ctl_unmask_isr

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
Apologies for butting in here guys but the other thing to check when setting
up LPC peripherals is that the are 'powered up' via an appropriate setting
in the PCONP Register (sorry, I lot track as to which device you are talking
about PCNPO is for LPC 2368)

HTH
Ivan Vernot
> -----Original Message-----
> From: l... [mailto:l...] On Behalf
> Of Paul Curtis
> Sent: Saturday, 9 February 2008 2:51 AM
> To: l...
> Subject: RE: [lpc2000] Crossworks - breakpoint in ISR?
>
> Hi,
>
> > So, am I correct that
> >
> > - It should be possible to debug an isr routine?
>
> Yes. I breakpoint in ISRs pretty routinely.
>
> > The generall way to set up an isr is to:
> >
> > - declare and code it (that was yesterdays topic :-)
> > - setup the hardware (setting register values etc. pp.)
> > - set the vector using ctl_set_isr()
> > - then call ctl_global_interrupts_enable()
> >
> > Anything else I missed?
>
> You need to unmask the interrupt source to allow it through the interrupt
> controller,
>
> ctl_unmask_isr
>
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors