breakpoints on JTAGICE mkII

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

Hi.

I´ve spent the last week or so trying to debug some code and finally decided to buy a JTAGICE mkII. Reading the manual prior to ordering, I stumbled over the breakpoints section in the introduction chapter:

Quote:
Breakpoints
The AVR OCD system distinguishes between two types of breakpoints; Software and Hardware breakpoints.

Software Breakpoints
A software breakpoint is a break instruction placed in Flash memory. When this instruction is executed, it will break the program execution. To continue execution a "start" command has to be given from the OCD logic. Note that ATmega128 has no support for the BREAK instruction. When placing a breakpoint on an instruction in AVR Studio, this instruction is physically rewritten as a break instruction in the AVR Flash memory. When reaching this instruction the operation is halted. When starting the execution, the "pending" instruction is executed before continuing to execute instructions from the Flash memory.

Hardware Breakpoints
In the JTAG OCD logic there are 4 registers capable of storing one memory address each. The JTAGICE mkII reserves one of these registers for internal use. The 3 others can be combined in different ways to generate valid break conditions. The Frontend Software chapter describes in detail the different ways of combining these registers.

Since a Software breakpoint requires a reprogramming of the entire page where it is located, hardware breakpoints are recommended for breakpoints that are often modified.


As luck would have it, I´m using the ATmega128 in my current project. At the same time, these would be my first attempts at using JTAG and in-circuit debugging at all.

The question is: Did this limitation of the ATmega128 not supporting the break instruction have effects on your debugging needs? Which ones? What were your workarounds/solutions?

Thanks,

Ingo

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

With JTAG ICE and mega128 I had no problem. It really saved a lot of time. In majority of the cases your debugging needs would be fulfilled.

As far as your eagerness go in finding the 'workarounds/solutions' you need to define the problem first.

Bottom line is, you have the right tool in hand to work with M128. You can get the help from the forum when you get stuck up. GET STARTED FIRST - All the best

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

Obviously it has. ;-) You have to take care to not have more than
three breakpoints active at the same time (as the fourth one is
reserved for the single-step feature of the ICE itself). OTOH, if
you always take care of not using more than three breakpoints, you
can be a bit faster (as hardware BPs don't require reprogramming
the flash). In theory, software BPs also contribute to flash ROM
wearout.

Don't know about AVR Studio, in GDB, you can temporarily disable the
breakpoints you currently don't need, so that makes it fairly easy to
abide to the no more than three BPs restriction.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

thakkarhimanshu wrote:
As far as your eagerness go in finding the 'workarounds/solutions' you need to define the problem first.

I was rather going for: "Did you encounter situations where the three available hardware breakpoints in the 128 were not sufficient". Sorry for being unclear about that.
dl8dtl wrote:
OTOH, if you always take care of not using more than three breakpoints, you can be a bit faster (as hardware BPs don't require reprogramming
the flash).

Aah, didn´t think about that (though my self-teaching approach at C programming probably adds much more to the overall project time than can be saved by not having to reprogram the microcontroller :wink: ).
dl8dtl wrote:
Don't know about AVR Studio, in GDB, you can temporarily disable the breakpoints you currently don't need, so that makes it fairly easy to abide to the no more than three BPs restriction.
I´ll have to look into that.

Ingo