Setting breakpoints in atxmega devices

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

Hi folks,
I'm trying to figure out how to set a breakpoint through avr-gdb + avarice with my mkII jtag ice, on a atxmega256a3 mcu.
By reading doc avr067 I see I should use the "CMND_SET_BREAK" command message; basically a sequence like the following should work things out:

11 01 XX E7 01 00 00 03

Note that the 3rd byte can be set to one of the following:

0x00 --> SW BP
[0x01:0x04] --> (HW?) BP number

What I've experienced is that with the 3rd byte set to 0x00 the break works while with all the others (0x01, 0x02, 0x03, 0x04) it doesn't break at all; do you know the reason why?

MOREOVER, By ispecting the USB bus communication of avr-studio with mkII under windows, I've seen that the first 2 breakpoints are set by physically writing the Flash memory with the following command:

For 2 breakpoints at 0x191 and 0x1BC:

 04 B7 37 00 00 00 20 00
 00 00 91 01 00 00 BC 01 00 00 F0 02 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 11 00 00

For 1 breakpoint at 0x190:

 04 B7 37 00 00 00 20 00   
 00 00 90 01 00 00 00 00 00 00 C0 01 00 00 00 00   
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
 00 00 00 00 00 00 01 00 00

I don't know where to look in order to decode the format of these messages.. I know that bytes 18,19 and 62 do metter but I can't find how to read them.

I'd like you to point me out some useful information to read.

Thankx in advance,
R

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

I'm pretty sure someone posted an avarice patch recently for just this requirement - try searching it out.

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

I had a very brief view to the patches posted on sourceforge avarice project but couldn't find the patch.. Apparently the micro supports well the breakpoints set through CMND_WRITE_MEMORY commands, but does not respond well to the one generated by CMND_SET_BREAK commands (at least when those are mixed together with the others). I'm probably doing something wrong but the lack of information doesn't help in guessing what it is.

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

No the patches were an attachment to a thread on this board.

EDIT: just tried to search for the thread but hit this so maybe I was mistaken:

https://www.avrfreaks.net/index.p...

EDIT2: But then I found this:

https://www.avrfreaks.net/index.p...

which is YOUR thread - seems like YOU are at the "bleedin edge" of this one! ;-)

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

I'll probably be stuck to use 2 breaks only (which is not bad anyway).. or I'll need to dig on what happens in avr studio to map it into avarice.