8
\$\begingroup\$

I am looking for some input into getting a good integrated development environment set up for AVR programming under Linux (Assembly and C).

My studies gave me some limited practical experience with AVRs but I fear I am getting a bit rusty so want to get busy with some projects but also want to persist in performing all development under Linux.

I use Ladyada's USBtinyISP and have been programming my chips using AVRdude but have yet to find an IDE that works as I like under Linux so have been compiling and building via my Windows lappie and AVRstudio. (This is why I love Arduino, good IDE & works straight away!)

So, does anyone have any first hand experience using an IDE with Linux that they have successfully developed their AVR projects with start to finish?

\$\endgroup\$
8
\$\begingroup\$

The thing about linux based developers is that they usually have their own unique workflow (vim vs emacs, etc). In my opinion, linux is one big IDE that you add your own parts to. With that in mind:

If you are using a debian-based distro, run this in your command line: sudo apt-get install build-essential avr-gcc avrdude

Then find a text editor you like (google is your friend but here are a few: vim/gvim, emacs, geany, kate, jedit) and write some C. When you are ready to compile, jump onto avrfreaks and have a look at other peoples makefiles. You can probably just steal a makefile from someone else's project and modify the target device, XTAL frequency and source filenames. After you run make and have a .hex file, use avrdude to program your chip.

To go into detail would take much more space than I have, but that is the basic process. When you are comfortable with the process you can do extra cool stuff in the makefile like having a single command that compiles and downloads your code. Some text editors (like geany) let you set custom make commands to GUI menu options so you could have a compile+download button like I do.

Also, the fantastic thing about this process is that it is pretty much the same whether you are building for ARM, AVR, x86, SPARC, whatever. Once you have makefiles and gcc down, the rest of linux development is a piece of cake!

\$\endgroup\$
  • \$\begingroup\$ HEHE, so simple. I was unnecessarily daunted by this approach. Until it was explained so simply I didn't know how to go about constructing the makefile. Thanks for the direction :) \$\endgroup\$ – BrianMcK Dec 27 '09 at 3:01
  • \$\begingroup\$ This is what I do too. EMACS and a Makefile. You can also compile Arduino stuff this way too. (* jcl *) \$\endgroup\$ – jluciani Dec 27 '09 at 4:06
  • \$\begingroup\$ You can also use Eclipse as the IDE/editor and use the makefile for compile and download. With OpenOCD and ARM it is even possible to debug via JTAG (I don't know whether this works with AVR). \$\endgroup\$ – starblue Dec 27 '09 at 11:49
3
\$\begingroup\$

There is an Eclipse module for the AVR, but I used it and it seemed to be much more trouble than it was worth. (Like the majority of other Eclipse modules I've used)

\$\endgroup\$
  • \$\begingroup\$ Cheers for the lead, but as you don't sound all that convinced I wont trouble myself too much :) \$\endgroup\$ – BrianMcK Dec 28 '09 at 0:41
  • \$\begingroup\$ I would just like to add that I have to use eclipse at work (not for avrs though) and i do not reccommend it. For microcontrollers you can do without all that bloat. \$\endgroup\$ – jeremy Dec 28 '09 at 1:37
2
\$\begingroup\$

I haven't got any first-hand experience with it, but KontrollerLab sounds interesting.

\$\endgroup\$
  • \$\begingroup\$ Yes, I have tried to get KontrollerLab working before but my PC recently crashed very badly and I have only just been setting everything up again. It looks to be from the same crew that made Ktechlab which I have found to be a very useful for schematic and circuit design. Thanks for the input. \$\endgroup\$ – BrianMcK Dec 28 '09 at 0:40
2
\$\begingroup\$

As the makefile approach seems to deal with the C side of my question I did a little more experimenting here (such as it was) and found that I had the resources to build assembly code also.

Using AVRA, a command line assembler, I have tested the building of an old school project of mine and output an identical *.hex file comparing it to my original AVRstudio output. While I haven't actually programmed the AVR micro, based on the output alone I am happy to say I have firsthand xp now, albeit limited :)

\$\endgroup\$
  • \$\begingroup\$ Don't forget that avr-gcc also includes a perfectly good assembler. It has a slightly different syntax to AVRA and Atmel's assembler, but it works just as well. \$\endgroup\$ – Tim Apr 12 '10 at 7:47
0
\$\begingroup\$

ECLIPSE is working fine on an EeePC with the AVR patch... But it is a little slow.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.