Debugging with Dragon in Eclipse under Debian 8

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

Hi all,

 

After developing with AVRStudio (4, 5, 6 and now 7) under windows, I see myself now compelled to develop under linux.  The project involves armhf devices communicating with several AVR mcu's.

 

The problem is I don't know how to setup/configure Eclipse (avr-gdb ?  avarice? AVRDude?) to talk to my dragon.  I'm sure the dragon is connected correctly, this is the output of avarice on the command line :

(I hide the Dragon's serial number)

 

paul@debian64:~$ sudo avarice -g
[sudo] password for paul: 
AVaRICE version 2.11, Dec 22 2013 18:22:47

Defaulting JTAG bitrate to 250 kHz.

JTAG config starting.
Found a device: AVRDRAGON
Serial number:  xx:xx:xx:xx:xx:xx
Reported JTAG device ID: 0x9587
Configured for device ID: 0x9587 atmega32u4
JTAG config complete.
paul@debian64:~$ 

first, If running the command without sudo the usb device (dragon) isn't found, so this has something to do with access rights I suppose....

 

second, I installed AVR Eclipse Plugin (Version 2.4.1), but the only option I see is using avrdude....

 

I Googled around but to no avail....

 

Any Help is very welcome.

 

My setup:

 

Host OS = Windows 10 Pro 64bit

VirtualBox 5.0

Guest OS = Debian 8 64bit

 

Thanks in advance,

 

Paul

"As simple as possible, but not simpler"

GUI Framework for Atmel Xplained Pro

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

PaulVdBergh wrote:
first, If running the command without sudo the usb device (dragon) isn't found, so this has something to do with access rights I suppose....

I know about Ubuntu not Debian but as the former is just a variant of the latter I assume the situation is the same. What you need are "udev rules". When a device like a USB debugger is inserted the kernel calls out to user space and checks to see of there is a Udev rule to match the identity (VID/PID) of the device just inserted it will then create a /dev/something allowing access to the device and the ownership rights of that /dev/something will be set according to the rule you give. So you will want a rule to set 0666 (rw to everyone) permission to the device entry created for the Atmel device. You will then be able to run avarice at normal privilege level and it will be able to access the debugger.

 

You may not find so much about setting udev rules for avrarice but as avrdude in Linux faces the same issues with "seeing" the programmers it can control a Google for "avrdude udev rules" should give you all you need to know about how to write such rules and where to place them an so on. Again a lot of it will be about Ubuntu but I assume that the operational policy is the same for Debian.

 

As for actually using the debugger. The fact is that with avarice running as a separate process ("daemon" if you like?) the actual debugging is done by running avr-gdb then telling it to connect to avarice. I'm pretty sure you will find internet tutorials about setting up Eclipse to debug with avr-gdb.

 

(because I'm a luddite and perhaps because it was the first debugger I ever used on Linux I'm actually a fan of the far more simple ddd which acts as a GUI front end for gdb (and so should work equally for avr-gdb too). It doesn't bring the overwhelming IDE baggage of Eclipse as it isn't so much an "IDE" as just a "D" ;-)

 

Oh and as you mentioned Linux in a VB guest you are going to face issues with connecting out from it to USB 2.0 debugging peripherals. I've had some success with Ubuntu in a VirtualBox on Windows and connecting out to my aged JTAGICEmkII but that works because the ICEmkII is USB 1.1. I have never had much success getting a virtual machine to connect out to a USB 2.0 debugger such as Dragon or Atmel-ICE. In fact I had so little success that I bought a Win10 laptop so I can run AS7 natively.

 

Given that you still have a licensed Windows acting as your host the simple answer here IS to use AS7. If you prefer to build/edit in Linux then that's fine but set up a shared folder/directory structure that both Windows and Linux can see and consider using AS7 for your debugging at least.

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

Hi Cliff,

 

Thanks for your reply.

 

I know AS7 under Windows is the best way to develop for Atmel, but in this case there are other mcu's involved in the system at hand.  To compile their architecture under windows is way to complicated for me.  Otoh, debugging the AVR in AS7 and ARMhf in a Virtual box isn't handy.  It would be fine if both targets could be debugged from the same platform (in this case Eclipse under linux).

 

Btw, what did you mean with

clawson wrote:
you are going to face issues with connecting out from it to USB 2.0 debugging peripherals
?

 

I'll have a look at your other suggestions.

 

Paul.

"As simple as possible, but not simpler"

GUI Framework for Atmel Xplained Pro

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

PaulVdBergh wrote:
To compile their architecture under windows is way to complicated for me.

What says you have to build them all in the same environment? I often do stuff where I'm building some of the code for one flavour of micro in Linux and for another in Windows.

PaulVdBergh wrote:
Btw, what did you mean with
As I say there are two flavours of USB. They are 1.1 and 2.0 (well now 3.0 as well but that doesn't apply here). Virtualbox does the USB1.1 thing very well and drivers it installs into the host captures the USB1.1 traffic and passes it (if you have "captured" the item) to the virtual machine. With that I have had no problem in the past using AS4 in a Windows guest on top of a Linux host from having a fruitful dialog with a JTAGICEmkII. But the world has moved on and flavour of the month these days is Atmel-ICE which uses USB 2.0 for its communications. Try as I might (and that includes in VirtualBox electing to add the additional USB 2.0 support - I don't mean just "Guest Additions" - this is another download you then enable) i could never get AS4 or AS6 inside a Windows guest to "talk out" to an Atmel USB2.0 programmer/debugger with any success. In the end I gave in and got a laptop that naively runs Windows (Windows 10 in fact which may be another issue!).

 

Now you are reversed - you have Windows as the host and Debian as the guest and maybe Linux guest->windows host in Virtualbox works to allow the guest to have a USB 2.0 chat with devices connected to the Windows host. But I'm just saying don't be surprised if that brings you a whole new set of issues.

 

As far as I know AVRISPmkII and JTAGICEmkII were the last Atmel devices using USB 1.1 and from Dragon onwards I think they are USB 2.0. So if there is an issue with getting USB 2.0 traffic into your guest operating system you are going to be bitten as I was.

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

PaulVdBergh wrote:
The problem is I don't know how to setup/configure Eclipse (avr-gdb ?  avarice? AVRDude?) to talk to my dragon.

GitHub

Lahorde/arduino_avr_template_avr_plugin: Arduino uno atmega328p Eclipse project with debug for AVR Dragon settings

https://github.com/Lahorde/arduino_avr_template_avr_plugin

An alternate way is via PlatformIO (packages the toolchain, glued with Python) :

"Creativity comes from talent and never from knowledge"

Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO

http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio

"Dare to be naïve." - Buckminster Fuller

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

PaulVdBergh wrote:
... but in this case there are other mcu's involved in the system at hand.  To compile their architecture under windows is way to complicated for me.  Otoh, debugging the AVR in AS7 and ARMhf in a Virtual box isn't handy.  It would be fine if both targets could be debugged from the same platform (in this case Eclipse under linux).
An alternate way is to stay on Windows by using Visual Studio Community with a low-priced GDB client VisualGDB.

The ones who created that GDB client also created zero-price GCC toolchains on Windows (ARM, MSP430, 68000, etc.)


Sysprogs

VisualGDB - Serious cross-platform support for Visual Studio

http://visualgdb.com/

Note : SAM7S did not make it into Atmel Studio 7 BUT is in VisualGDB.

Sysprogs

Prebuilt GNU Toolchains for Windows

http://gnutoolchains.com/

Edit : SAM7

"Dare to be naïve." - Buckminster Fuller

Last Edited: Thu. Mar 3, 2016 - 11:48 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your suggestions.  But atm the first problem I have to solve is making the JTag device visible to ordinary users.  I posted a question on the Debian forum and am keen to see the answers ;)

"As simple as possible, but not simpler"

GUI Framework for Atmel Xplained Pro

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

I have used used visualgdb in the past...  Will give it another try :)

"As simple as possible, but not simpler"

GUI Framework for Atmel Xplained Pro

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

clawson wrote:
If you prefer to build/edit in Linux then that's fine but set up a shared folder/directory structure that both Windows and Linux can see and ...

The Ganssle Group logo

The Embedded Muse 300

Issue Number 300, March 1, 2016

by Jack Ganssle

...

More on VMs

http://www.ganssle.com/tem/tem300.html#article3

...

Another tool which is really useful is Vagrant (https://www.vagrantup.com/).

It's kind of like a wrapper for VirtualBox or VMWare, ...

...

And, it automatically creates a shared folder between the VM and your host machine.

...

About Vagrant

https://www.vagrantup.com/about.html

Vagrant is a tool for building complete development environments.

...

"Dare to be naïve." - Buckminster Fuller