Stopping interrupts at breakpoint - debugging problem

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Probably been asked many times before- apologies.
Using JTAG ICE - under DebugWire.

At a program breakpoint - all I get when stepping through are calls to my interrupt which is happening regularly.

How can I debug a target - and prevent this - i.e correct cycle by debugging?

Thanks
Rob

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Err don't enable the interrupt perhaps?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If the interrupt isn't enabled - the program doesnt work properly!!!

Straightforward question I would have thought, but hey - there's always a smart guy.

The interrupt runs the timer routine - which needs to be running or else the program sits and does nothing, but when the code hits a breakpoint it seems that the timers / and hence interrupts just keep on plowing through, and at each step of the code - the interrupt is getting set - so the code jumps to the interrupt routine.

Is this a shortcoming of the debugging. I cant belive I am the only one who is debugging like this.

Sensible advice only please!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, then for the purpose of debugging set a much larger pre-scale on the timer so the interrupts don't occur so often

(my suggestion above WAS serious - I wasn't trying to be smart - if there's something keeps interrupting preventing you debugging another area then turning off that interrupt source is a way to get round it)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I assume that the interrupts are continuing in real time - so no matter what prescalar I use - and we're talking even several seconds between interrupt - then before I step on and see the new line of code ( allow for thinking time ) the hardware will have generated the interrupt flag, an hey presto - off we go to the interrupt routine.

Now I admit - if this WERE the case, then I guess I would NEVER be able to step through code at all without the interrupt getting in the way - ( my interrupts are every second btw ) But 'sometimes' it seems that I can get through a few lines - sometimes quite a few - before the ISR gets 'debugged'.

I assume that there must be many people using real time regular interrupts - and either I am doing something daft - or its a shortcoming of using AVR studio etc in so much as the peripherals keep on running ( generating interrupts etc ) whilst single stepping code.

This makes it REALLY hard work going round loops with the interrupt routine popping up every second or so.

Today - I've been fighting the tools rather than my code - although I still think I might be doing something wrong :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IIRC there is an option in Sudio to let the timers continue to run or not when you hit a breakpoint. (Haven't got the stuff connected to the PC right now, so can't check this out.)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
there is an option in Sudio to let the timers continue to run or not when you hit a breakpoint
It's in the Debug>AVR Dragon Options> Debug page (yours would be JTAG Options??)

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try the run to cursor button.

Mats