AVR Dragon Linux Drivers

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

Hi all,

 

I've recently purchased and received an avr dragon, and have noticed that people have been able to program and debug applications with it on Linux. I've been trying to, but have not succeeded. 

 

What I've tried to do so far:

 

On windows10, using atmel studio 7, updated firmware to 7.XX

- have successfully used it to debug an atmega2560

 

So I believe that the actual board works, but not on linux mint sarah.

 

 

Please, if any one can help.

 

Best,

Senor 

Last Edited: Wed. Nov 8, 2017 - 05:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

UPDATE:

 

Also tried with a powered usb hub (which doesnt help).

 

 

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

What have you tried on Linux to "drive" the Dragon? AVRDUDE? AVaRICE?

 

 

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Fri. Nov 10, 2017 - 07:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I pulled out a STK600 w/ mega2560, and a Dragon. Wired the JTAG headers together (making sure I used the correct header on the STK600 - that gets me 50% of the time..).

 

With nothing else than that and AVRDUDE:

 

johan@Mint-Latitude-E6330 ~ $ avrdude -p m2560 -c dragon_jtag

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9801 (probably m2560)

avrdude: safemode: Fuses OK (E:FF, H:11, L:E2)

avrdude done.  Thank you.

 

So programming should be no problem. What have you tried, and how far did you get?

 


 

When it comes to debugging the game gets more complicated.

 

First piece of software "above" the Dragon is AVaRICE. Then on top of that goes GDB. With that you can do command-line-style debugging. E.g. to step you actually type "step" or some such. Everything (free-running, inspecting variables, setting breakpoints...) is done through the command-line interface (no windows, buttons etc).

 

If you want a better UI you need additional software on top of GDB. This could be anything from DDD (a "free-standing" client doing nothing but debugging) to complex IDEs (Eclipse, NetBeans, Insight, CodeBlocks...).

 

To get the whole shebang running, and all parts talking to another, some configuration and initialization scripts are needed.

 

It will not be the smooth plug-and-play ride it is using Atmel Studio on Windoze. Unless you are prepared to take some frustration, and is a reasonably experienced user when it comes to Linux, command lines etc I would advice against going for it if you have a Windows system up and running.

 

Yes, you can find tutorials, how-to's and the like on the Web. You will fins tidbits of the solution on your machine in them, but it will not all be in one such howto. Problem is that they all differ because the systems they where done on differ. There will be no cook-book recipe to follow to "just make it work". You will need to tinker, do detective work etc. (I've been on and off this for a few months, must have spent 40 to 80 hours, and am still not all the way with this..).

 

If you do go down this route then please report back with your experiences!

 

Advice: Keep meticulous notes of everything you do. You will need to back out and re-do things, and notes are essential!

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Hello JohanEkdahl! Thank you for your kind advice, it seems that I've solved my issue!

 

It turns out on linux, avr dragon requires libbfd.a. Whats strange is that I've been able to program, compile, more or less do what is required without that lib, which leads me to believe that its needed for whatever avr dragon uses to communicate.  I've tested this with other linux machines, so I'm fairly confident in my reasoning. 

 

 

Best,

Senor

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

But libbfd.a is a static library, so why would the Dragon "require" that?

 

A quick search seems to indicate that libbfd is a part of binutils, so that would have nothing to do with Dragon communication, I suppose.

 

What software are you using to program the flash of the AVR using the Dragon?

 


 

In your first post you mentioned "debugging". Have you had progress on this, using the Dragon? If so I would be interested in any experiences or results since I am (slowly) trying to put together some kind of HowTo for on-chip debugging of AVRs, using e.g. the Dragon, hosted by Linux.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Fri. Nov 10, 2017 - 03:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The only reason you'd need libbfd.a is if you are trying to BUILD a copy of avrdude. I think (like most programs that read HEX, ELF, etc) it uses BFD. But if you have a prebuilt copy of avrdude then the executable already will have the bits from libbfd.a it needs built in. If a running copy of avrdude need functions that were not built it it would be looking to load libbfd.so which is a dynamic library in Linux. But not the .a file, which as Johan says, is a static library.

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

Ya your both right, also it doesnt look like avrdude loads libbfd.so either, so im not sure what made the difference. 

 

linux-vdso.so.1 =>  

libftdi.so.1 => /usr/lib/x86_64-linux-gnu/libftdi.so.1 

libusb-0.1.so.4 => /lib/x86_64-linux-gnu/libusb-0.1.so.4

libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 

libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 

libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 

libreadline.so.6 => /lib/x86_64-linux-gnu/libreadline.so.6 

libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 

libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 

/lib64/ld-linux-x86-64.so.2 

libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5