Debugging no longer working

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

Hi folks,

 

Pretty frustrated after several hours of experiments and research I'm running out of ideas what I could try.

Hope someone on this great forum can help or give me a hint.

 

Trying to do debugging on my atmega32U4 target using the AVR-dragon board and JTAG.

I have sucessfully done debugging on this project earlier, same configuration, except that it might have been with Atmel Studio 6 when I did the last debugging.

Now I'm using Atmel studio 7.

It's a C language Project.

 

Both, debug and release versions build without problem and a bunch of files are generated in the respective directories, including the elf file which I program into the target via Dragon/JTAG.

I can start the debugger, look at memory areas, but strange things happen:

1.) It does not break at the first instruction in main, it stops several lines before main in the middle of a comment block.

2.) Single stepping from there, it is advancing line by line in that comment text block.

3.) I can set Halt points but either it does not stopn there or it stops a places that should not be reached.

4.) In the watch window I can see some older variables, which have been used in the project for quite a while, but they do not always show the right values. I cannot see content of recently added variables ("unknown identifier")

 

It looks like something is messed up or no configured right in the project. Maybe the debugger works with old/previous symbol or mapping or linker information?

Any help is appreciated and I'd be happy to provide project and compiler setting etc.

 

Thank you

 

 

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

If this was an older AS6_x project, when you opened it in AS7 did a window appear telling you that the project needed to be 'upgraded' to AS7?

 

One thing you could also try doing is making a completely new project and copy the source file into the new project and see what happens

 

Just guessing from past experiences. 

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Use only -Og optimization for debugging as the compiler will do much strange things to your code! 

 

Jim

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

I did what JIm suggested and set up a new project from scratch. Now debugging with AVR-Dragon/JTAG is working smiley

Many thanks to JIm for this suggestion.yes

 

But I must say that this is a painfully slow! It takes seconds for the debugger to get ready.

There seems to be communication with the target all the time, LEDs are always flashing.

JTAG frequency is set to 200 kHz. Can I go higher? Will it speed up debugging?

 

Didn't try the -Og optimization yet.

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

Pirmin wrote:
But I must say that this is a painfully slow! It takes seconds for the debugger to get ready.

You're impatient

 

Pirmin wrote:
There seems to be communication with the target all the time, LEDs are always flashing.

Ok, thats what its supposed to do.

 

Pirmin wrote:
JTAG frequency is set to 200 kHz. Can I go higher? Will it speed up debugging?

Yes, but dont go too high.  2Mhz is all I ever need

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user