Can't debug xmega bootloader with jtag

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

I'm trying to debug xboot on an atmega128a3 platform. The jtagmkii loads the code, but avrstudio does not seem to 'connect' with the program. The debug window menu still only shows "start debugging", I can't break, set breakpoints, etc. I have the bootstrap fuse set. I can attach my "lss", "lst", or "map" file (which one would be best) for more info.
I CAN debug application code so I know the jtag is working. (using winavr btw).
Any ideas?

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

Is the code linked to the booloader section address? Is the bootsize correct?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Here's the build output:
IDcommBootloader.elf :
section size addr
.text 0xd26 0x20000
.BOOT 0x3a 0x20d26
.bss 0x5 0x802000
.stab 0x2f04 0x0
.stabstr 0xb592 0x0
Total 0xf1fb

IDcommBootloader.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000d26 00020000 00020000 00000074 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .BOOT 0000003a 00020d26 00020d26 00000d9a 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .bss 00000005 00802000 00802000 00000dd4 2**0
ALLOC
3 .stab 00002f04 00000000 00000000 00000dd4 2**2
CONTENTS, READONLY, DEBUGGING
4 .stabstr 0000b592 00000000 00000000 00003cd8 2**0
CONTENTS, READONLY, DEBUGGING
Allocating common symbols
Common symbol size file

comm_mode 0x1 IDcommBootloader.o

Memory Configuration

Name Origin Length Attributes
text 0x00000000 0x00100000 xr
data 0x00802000 0x0000ffa0 rw !x
eeprom 0x00810000 0x00010000 rw !x
fuse 0x00820000 0x00000400 rw !x
lock 0x00830000 0x00000400 rw !x
signature 0x00840000 0x00000400 rw !x
*default* 0x00000000 0xffffffff

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

I found the problem. G_D make file specified -gstabs,
it should have been -gdwarf-2

I did not create this makefile, it came with xboot.

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

That makefile was actually inherited from a different project. What is the difference between -gstabs and -gdwarf-2 and do you think the makefile should be changed to make -gdwarf-2 the default?

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

alex.forencich wrote:
That makefile was actually inherited from a different project. What is the difference between -gstabs and -gdwarf-2 and do you think the makefile should be changed to make -gdwarf-2 the default?

I don't know what the difference is between gstabs and gdwarf-2, but it seems that the avrstudio debugger is not compatible with gstabs.

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

Hmm. Perhaps I will have to put a heads up in the readme about that.

Just out of curiosity, why were you debugging xboot? Was something not working correctly?

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

stabs is the symbolic info of choice for GDB debugging (mainly) on Linux. Dwarf2 is the symbolic info of choice for debugging in AVR Studio.