navigationGo.pngQuick Navigation
allprojects32.pngAll projects
hardware32.pngHardware
links32.pngLinks

favoriteStar32.pngTop projects
Alan numitron clock
Clapclap 2313/1386
SNES Pi Webserver
USB Volume/USB toys
Smokey amp
Laser cutter
WordClock
ardReveil v3
SNES Arcade cabinet
Game boy projects
cameleon
Home Presence Detector

github32.pngGitHub
AlanFromJapan

navigationMail.pngContact me

alanfjmail.png
3flags.pngWho's Alan?


Akizukidenshi
Elec-lab
Rand Nerd Tut
EEVblog
SpritesMods
Switch-science
Sparkfun
Suzusho
Datasheet Lib
Reddit Elec
Ermicro
Carnet du maker (fr)
Marutsu
ATmel blog (defunct)

setup avr on linux

I moved this year to "Linux only" (Mint) and I have not yet had the occasion to setup the necessary tools to do AVR development on the PC. This is the occasion to start and document, so that I can do it the same way on all the PCs at home...

Presentation

Principle

I will go 2-flavor: the Arduino suite (for arduinos !) and the AVR toolchain (for all the other MCUs).

Arduino toolchain

Foreword

I'm using LInux Mint 19 (based on Ubunto 18.04 LTS). DO NOT USE THE PACKAGES THAT COME WITH MINT 19, they are totally outdated. It's a shame but that's how it is.
We need to take a detour for doing the install the right way.

Install

That one is easy: go to the arduino website and download the latest .tar.xz file. You can then tar -zxf it or just double click and put the insides somewhere. No need to run the installer unless you want to setup the icons. There, install completed!
Nota bene: regarding the where to install, I did in /usr/local/apps (which I created). Where to install software in Linux is an eternal debate, so I picked here, but it doesn't matter it will work anywhere.

Setup

AVR toolchain

Foreword

I'm using LInux Mint 19 (based on Ubunto 18.04 LTS). DO NOT USE THE PACKAGES THAT COME WITH MINT 19, they are totally outdated. It's a shame but that's how it is.
We need to take a detour for doing the install the right way.

Install

I followed this doc with minor editions/customizations. We'll use the AVR Eclipse plugin.
  • Get Eclipse, download the Eclipse IDE for C/C++ Developers, not the regular (Java).
  • Get some packages while it downloads sudo apt-get install gcc-avr binutils-avr gdb-avr avr-libc avrdude
  • Install Eclipse in your /opt folder, tar zxvf the file
  • In Eclipse, Help > Install new software ... > add this source "http://avr-eclipse.sourceforge.net/updatesite/" and install
  • Manual for a first build is here
  • (note that on Linux Mint 19 I didn't have to do the operations I described here to enable my mkII programmer, it worked out of the box)
  • Setup

    Well it just works, that's great. As this doc explains:
  • New "C Project"
  • Pick "AVR Cross Target Application"
  • Choose the mCU and F_CPU
  • Once project created, right-click > Properties
  • AVR > AVRDude pick your programmer
  • C/C++ Build > Settings: Set the optimization and make sure to generate the HEX for Flash in your Release config (and check AVRDude for update on the fly)
  • I tried 2 projects, one hello world and the USB keyboard sample: just worked like a breeze. No issue or none worth even mentionning. Linux rules! (^_^)b

    Pictures

    Links

    Helpful sources

    Inspiration

    All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated)
    electrogeek.cc ~ Formerly known as Kalshagar.wikispaces.com (AlanFromJapan [2009 - 2019])