Debuging Problem

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

Hey all,

When I try to debug the code I wrote, sometimes in different places, the debugging process stuck. When I pause the operation I see that program memory is empty (the program memory is 0xFF for all cells). In this situation I got message "Error stepping over".
After I do "stop" and "play", the program loaded again to the program memory.

1. What can be a reason for this problem?
2. How can I solve this problem?

I use JTAGICE mkII and Atmega2561.

Thanks ahead

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

Either the code isn't being programmed in the first place or pages are being erased after it starts running. Does the image include SPM bootloading code?

If you use ISP to read out the image does it confirm that the pages the debugger shows as 0xFF actually contain that?

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

after pause I can see now that program is running but not in debugging mode. it seems like there is no connection between JTAGICE mkII and chip.

can anyone help me?

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

It looks like something going wrong with sync between uC and JTAGICE mkII.

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

Since you are posting in the AVR Studio forum, I assume you are using the latest AVR Studio (4.18 SP3).

First, before programming the chip, pick the Main tab and make sure you have the right processor type selected (ATmega2560). Also make sure that JTAG mode is selected, not ISP. Then click "Verify signature". If you cannot read the chip signature, your JTAG connection is bad.

When the connection is good and the chip signature is verified, go to the Fuses page. Make sure that the proper clock has been selected for your application. If you have an external crystal or oscillator feeding the chip, make sure you select the proper fuses. Also make sure that JTAGEN is turned on.

Finally, go to the Program page. Make sure you have selected the proper output file (usually MyApp.hex where MyApp is the name of your application). Click on "Program". Then click "Verify". If you cannot Program or Verify, figure out the problem.

You should now be ready to debug.

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

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

Hey,
I am using:
AVR Studio 4.15.623
GUI Version 4, 15, 0, 623

Operating System
Major 5
Minor 1
PlatformID 2
Build 2600
Service Pack 3

Plugins:

AvrPluginAvrAsmObject 1, 0, 0, 47
AvrPluginavrgccplugin 1, 0, 0, 10
Stk500Dll 1, 0, 1, 10

I selected ATmega2561 I can read/write fuses and program the chip.

The problem is only the debug mode. I am using crystal of 4MHz. I tried to define JTAG clock as 4MHz/1MHz/500KHz. It doesn't work correctly. I even have pull-up on JTAG pins.

How can I solve the problem?

best regards

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

:)

OK, thanks to all.

I updated AVR studio to 4.18
and updated JTAGICE mkII

Now it works perfect.

Thanks :)