AVaRICE gives bad address error

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

Hi

I have some trouble having avarice working on LinuxMint 10
When issuing the following command, the output are as shown

Quote:
$avarice -p -fZ003.elf -Pm644p -jusb :4242
AVaRICE version 2.10, Oct 27 2010 11:26:49

Defaulting JTAG bitrate to 250 kHz.

JTAG config starting.
JTAG ICE communication failed: Bad address

When command is issued, the green usb activity led flash once on my jtag-mk2, the goes steady green. USing avrdude with device usb to flash the device works perfectly (almost, beeing a bit slow).

This is the forst time I intend to make avarice working and the tutorial I followed did not discuss problem solving. Googleing only learned me this about AVaRICE...

Quote:
Definition of AVARICE
: excessive or insatiable desire for wealth or gain : greediness, cupidity

Hmmmm, I do not know what to say...

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

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

I'd almost bet that "bad address" means bad device ID bytes.

MIght be that the processor in the socket is different than the programmer is expecting. Or, maybe the processor has no power. Or, the biggie - its oscillator is not running. This most often happens when the fuse bytes are programmed for external oscillator and you really have a crystal, or programmed for a crystal but none installed.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

> I'd almost bet that "bad address" means bad device ID bytes.

Nope, it's a system error message, basically the translation of the
last error number the library stored in errno. There's, of course,
a slight chance this error code is actually a stale one (e. g. from the
time when the dynamic linker arranged all the shared libraries during
application startup), in case no other library function ever updated
errno again later on.

The error message printed is a rather generic one, to quote AVaRICE's
"src/jtag.h":

// A generic error message when nothing good comes to mind
#define JTAG_CAUSE "JTAG ICE communication failed"

Vidar, is this really an old version 1 JTAG ICE as your commandline
suggest, or are you rather using a JTAGICE mkII device? In that
case, you forgot the option -2, and the communication attempt simply
never got answered.

Note that in the JTAGICE mkII code path of AVaRICE, for reasons I never
really investigated, flash loading doesn't really work very well. I
suggest you program the flash through AVRDUDE instead, and then
start AVaRICE using just:

avarice -2 -j usb :4242

You might also consider bumping the JTAG clock rate using the -B option, or
applying the -I option to make it not stop within ISRs.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Hi and thanks for the advices. The -2 option was missing. As soon it was added I had it up running.

By using avr-gdb commandline I was soon able to debug etc. and it seemd to be stable. Lovely...

However, when using insight or other gui based tools I found the tool chain to be rather unstable and avarice got out of synch many times, closing down. Lowering the bitrate did not help on performance.

I have struggled quite a bit to have a stable environment loosing a lot of time on the tool set (avarice, avr-gdb, avr-insight). I considered the problem beeing unstable HW since this is a prototype board, but when moving to an windows environment and using avr-studio things worked smoothly and out of the box. Hard to admit that.

I followed this tutorial, by the way
AVR-GDB_and_AVaRICE_Guide.pdf

We would however like to have a stable and simple tool-set on linux as this is the main platform used here. It seems that the biggest issues is the GUIs interaction with gdb, beeing slow and irrational in its behaviour Relaying on command line debugging only is not wanted but may be used for a while, if for no other reason, just to become more familiar with command line debugging.

People familiar with using GUI based debugging towards avr-dbg+avarice tools, on linux that is, are welcome to give advice. I already mentioned insight, but preferably we would like to use codelite or code::blocks as GUI front-end as development is done in these environment. Don't mention eclipse please ;)

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

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

code::blocks comes with gdb integration. Did you try it?

Stealing Proteus doesn't make you an engineer.

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

Quote:
Don't mention eclipse please
What's so bad about Eclipse ?

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

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

DDD?

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

EDIT:

Hm. I no longer think that my other problems are related to gui interfacing gdb I remove the post since the rest of my post was not really related to this topic.

New post may be followed her: viewtopic&t=100563

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"