Author Topic: where is jtag  (Read 5303 times)

0 Members and 1 Guest are viewing this topic.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
where is jtag
« on: August 04, 2008, 10:08:53 PM »
Admin,

As you know there are rprintf statements everywhere, but not reaching some rprintf in misc.c
Not sure where the break occured.

It stops after

System Warming Up.................Initialization Complete

System Warming Up.................Initialization Complete

System Warming Up.................Initialization Complete

System Warming Up.................Initialization Complete

System Warming Up.................Initialization Complete

System Warming Up.................Initialization Complete

System Warming Up.................Initialization Complete

System Warming Up.................Initialization Complete

System Warming Up.................Initialization Complete



Does the Axon have JTAG, so I can step through the code by setting breakpoints and make sure that it reaches that part of the code.

Thanks,


Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: where is jtag
« Reply #1 on: August 05, 2008, 07:53:04 AM »
Does the ISP have these pins necessary for JTAG?

Thanks!

CONNECT | Pin 1
GND         | Pin 2
TCK         | Pin 4
TDO         | Pin 5
TDI          | Pin 6
TMS         | Pin 7

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: where is jtag
« Reply #2 on: August 05, 2008, 09:33:37 AM »
so you'll need to re-enable the JTAG fuse.
all the I/O pins are accessible on the Axon right? so i'm guessing the pins are no problem.

is Admin allowed to say "told you so" now?
http://www.societyofrobots.com/robotforum/index.php?topic=4628.0

dunk.
(ducking out of path of flying Axon...)

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: where is jtag
« Reply #3 on: August 05, 2008, 09:04:02 PM »
The pins for jtagice mkII are on the axon schematic http://www.societyofrobots.com/axon/downloads/axon_schematic.pdf

To summarize it the schematic:

TDI connects to ADC 7

TDO connects to ADC 6

TMS connects to ADC 5

TCK connects to ADC 4

nTRST connects to ISP pin 5 IRST

GND connects to ADC 0 GND

Vsupply connects to ADC +5V

I already verified that the fuse JTAGEN is enabled. A check mark appears in the box in AVR Studio.

Then I try to connect to Axon using JTAGICE mkII in ISP mode but I get an error:

A problem occurred when executing the command. Make sure you are using the correct programming method. Current mode is ISP.
« Last Edit: August 05, 2008, 09:05:54 PM by vidam »

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: where is jtag
« Reply #4 on: August 05, 2008, 09:13:57 PM »
Apparently I fixed the problem by changing the option from ISP mode to JTAG mode. However I get a new error:
Now JTAG can read the signature of the board and print out the address.
So it's working.

However now when I try to debug the program I get this error:

Coordinator. Error loading object file.


Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: where is jtag
« Reply #5 on: August 06, 2008, 09:14:19 AM »
I posted this same question to another forum where I also have luck getting right answers.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: where is jtag
« Reply #6 on: August 06, 2008, 12:04:53 PM »
Which version Axon software are you using? Is it the newest unreleased beta I sent you?

I haven't had time to fully test it out, and I made a lot of changes to the timer code. I suspect that's where the problem is.

You can still use misc.c for the Sabertooth code, but use the older code for everything else for now.

Also, a great way to debug would be to add:

Code: [Select]
rprintf("error location A /n/r");//output to USB
//some code here
rprintf("error location B /n/r");//output to USB
//more suspicious code here
rprintf("error location C /n/r");//output to USB

in your code in various locations. This will tell you exactly where the code is failing.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: where is jtag
« Reply #7 on: August 06, 2008, 12:18:00 PM »
Thanks for the reply.

The point of using JTAG which is not mentioned anywhere is so I can step through your source code. So I can fix the problem code or at least verify/identify the problem code.

I don't want to debug code with hundreds of rprintf statements as that can be painstakingly slow assuming JTAG works.


Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: where is jtag
« Reply #8 on: August 06, 2008, 07:36:10 PM »
For anyone who is interested. JTAG is working.

under debug menu set the debug platform and device to JTAGICE mkii.


Then change the following lines in Admin's makefile:

# Debugging format.
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
DEBUG = dwarf-2

The option DEBUG='stabs' must be changed to 'dwarf-2' so that the object file can be used by the debugger.

AND

In configuration properties you have to set up the location where the object file (i.e. Axon.elf) is located in the filesystem if you use Admin's makefile.

'clean' before you build your object file.


And then you build and debug away with jtag.


« Last Edit: August 06, 2008, 07:36:59 PM by vidam »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: where is jtag
« Reply #9 on: August 06, 2008, 08:09:26 PM »
Thanks Melanie for writing the JTAG instructions! :)

I paraphrased you in the Axon FAQ:
http://www.societyofrobots.com/axon/axon_FAQ.shtml#jtag

And a side note for you . . .

Warning: When finished using JTAG, disable the JTAG fuse before attaching sensors to ADC 4-7! Otherwise, you could potentially damage those pins (and maybe your sensors) permanently.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: where is jtag
« Reply #10 on: August 07, 2008, 10:44:35 AM »
Thanks Melanie for writing the JTAG instructions! :)

I paraphrased you in the Axon FAQ:
http://www.societyofrobots.com/axon/axon_FAQ.shtml#jtag

And a side note for you . . .

Warning: When finished using JTAG, disable the JTAG fuse before attaching sensors to ADC 4-7! Otherwise, you could potentially damage those pins (and maybe your sensors) permanently.


Thank you for the warning. Thank GOD I did not attach any sensors yet.

Brijesh another SoR forum member helped find the JTAG pins on the Axon schematic as well as helped debug the Sabertooth code with JTAG.

For simplified serial mode you only send a byte of data to control the motors. See page 13 on the Sabertooth 2x10 manual.

I will upload pictures of the JTAG to Axon connection soon if you want to use them.

 


Get Your Ad Here

data_list