AVR-Dragon Under Linux

From HBRC WIki

Jump to: navigation, search

With the Atmel AVR-Dragon, it is possible to have both an AVR programmer and an AVR ICE (In Circuit Emulator) for about $50 (US).

The Atmel AVR-Dragon is available from multiple sources. Both Mouser and Digi-Key carry them.

The AVR-Dragon runs under Mac, Linux, and Windows. This note is focused towards Linux.

Contents

Assembling the AVR-Dragon

The AVR-Dragon arrives in a box with a simple PCB board and not much else. In addition to the PCB, you will need the following:

  • USB-B cable connector. This is a cable with a standard flat connector on one end that is plugged into the host computer/hub and a squarish connector that is plugged into the AVR-Dragon.
  • a 40-pin ZIF (Zero Insertion Force) DIP connector. This allows to you to program a DIP version of an AVR part without have to resort to in-circuit programming.
  • A 2x20 .1" male header.
  • A 2x10 .1" male header.
  • 8-10 patch cables.

Solder the ZIF connector into AVR-Dragon with pin 1 facing down.

Solder the 2x20 and 2x10 male headers in.

Each patch cable is manufactured using:

  • 2 female .1" pins
  • 1 2" piece of 22 gauge standed wire
  • 2 .75" pieces of 1/8" heat shrink tubing.

Perform the following steps for each cable:

  1. Cut each cable to 2" in length,
  2. Strip 1/8" from the end of each 2" cable,
  3. Crimp a female header onto each end of the cable,
  4. Place heat shrink tubing on each end and use a candle to shrink the tubing into place.

AVR-Dragon Documentation

The AVR-Dragon documentation is only available as help files in the AVR-Studio product from Atmel. AVR-Studio is free. So you have to find a Windows machine and download AVR-Studio. After you fire up AVR-Studio, click on [Help] and find the AVR-Dragon section. Read the documentation and print out the pages you need. Of particular interest are the pages that explain how to hook up AVR-Dragon for each different chip that it supports.

Downloading the Linux AVR Toolset

Getting a consistent set of AVR tools is not as easy as it could be. For the AVR-Dragon, the following tools are required:

  • GCC (The Gnu C Compiler)
  • Bin Utils (The Binary Utilities)
  • AVR libC
  • Avarice (A the interface program for the AVR-Dragon)
  • GDB (The Gnu Debugger)
  • Insight (GUI for the Gnu Debugger) [optional, but recommended]

Getting these tools is done a three separate downloads.

Getting GCC/Bin Utils

There is a shell script that will fetch all of the relevant files from various servers to your machine, perform the configuration, and install everything. The script can be found by visiting the AVR Freaks web site. In particular, you need to visit the Script for building AVR-GCC 4.2.2 on Linux thread. You need to download the following script: build-avr-gcc-4.2.2-libc-1.6.1-makeinfo-fixed.zip. The instructions from the the message are:

  1. Make sure you are root (blushing)
  2. Make a working directory , where you extract the files from the archive.
  3. If desired edit the buildavr-no-insight.sh file , to change the prefix .. default is : prefix=/usr/local/avr
  4. Make sure that the prefix dir is empty or nonexisting
  5. Run : ./getfiles.sh
  6. Run : ./get-patches.sh
  7. Run: ./buildavr-no-insight.sh

Notes: Make sure that "makeinfo" is installed, this is stashed in

       the texinfo package.

Getting Avarice

Notes: Make sure libusb-dev is installed

Getting GDB/Insight

./configure --target=avr-elf --prefix=/usr/local/avr ./make sudo make install


Notes: Make sure libncurses5-dev is installed

       Make sure ncurses5 packages are installed
Personal tools