Table of Contents
Linux microcontroller development options
This page is under development.
When it comes to microcontroller development platforms, Windows gets almost all the love. There are tons of commercial, gratis, and FOSS tools for Windows to support microcontroller development as well as the peripherals often associated with embedded design (e.g., Xbee cards).
In spite of this, there are some FOSS options available for Linux, and I will try here to summarize what I've found so far. I won't deal with physical computing/rapid prototyping platforms such as Arduino, Netduino, Pinguino (and this), and Jaluino. Those are some awesome projects better served in a separate discussion.
8051
The main advantage of the 8051-family of devices seems to be that unlike the other devices discussed here they are not single-sourced.
A fairly comprehensive package for 8051-family devices is available in the MCU 8051 IDE. It provides a simulator, source code editor, assembler, programmer and other tools. It uses SDCC for C language support.
Debian packages
A list of packages in Debian relevant to 8051 includes:
- as31: Intel 8031/8051 assembler
- cycfx2prog: Cypress EZ-USB FX2 (LP) programmer
- dis51: Disassembler for 8051 code in Intel Hex format
- emu8051: Emulator and simulator for 8051 microcontrollers
- mcu8051: Integrated development enviroment for MCS-51 based microcontrollers
- s51dude: In-System Programmer for 8051 MCUs using usbtiny
Programmer hardware
Programmers supported by the MCU 8051 IDE include a DIY serial ISP programmer for AT89Sx microcontrollers. A USB programmer appears to be under development but not available.
The s51dude project (possibly here) appears to support the USBtinyISP (and may also work with Lady Ada's kit based on this design with some modifications). However, development on s51dude seems have ceased (the last update was in 2008) and the number of supported devices may be small.
Atmel AVR
Arguably, the microcontrollers with the best Linux support are the Atmel AVR series.
Atmel provides a toolchain for Linux where, “Most of these tools are based on efforts from GNU (www.gnu.org), and some are developed by Atmel.” Source code for this appears to be available, but I have not yet looked at the licensing terms to see if it's actually FOSS.
An alternative to the bundle provided by Atmel is a “classic” toolchain that is made up of:1)
- avr-libc: standard C libraries for AVR development, documentation about the whole AVR toolchain
- binutils-avr: assembler, linker, other utilities
- gcc-avr: C, C++, and Ada compilers
- avrdude: programmer s/w
with optional extras:
The exact differences between the toolchain provided by Atmel and the “classic” toolchain are astoundingly opaque. Very little information on the Atmel-provided set is available outside of the Atmel site, suggesting that it may not be used that much in the wild.
An AVR Eclipse Plugin supporting the above is also available if you want an IDE experience. Best part: “With this Plugin you don't have to hassle with makefiles any more. The makefiles for building your application are automatically created.”
AVR on Linux's biggest issue may be simulation support. The simulavr project seems to be in a state of limbo, transition and/or chaos at the moment. While there has been some recent activity in the project, there have been no new releases in years and AFAICT the most recently available sources (from 2005) may not actually be the most recent release! Also, the available release(s) seem to support a fairly narrow range of microcontrollers.
Debian packages
A list of packages in Debian relevant to Atmel and/or AVR inlcudes:
- avarice: use GDB with Atmel's JTAG ICE for the AVR
- avr-libc: Standard C library for Atmel AVR development
- avra: Assembler for Atmel AVR microcontrollers
- avrdude: software for programming Atmel AVR microcontrollers
- avrp: Programmer for Atmel AVR microcontrollers
- avrprog: Programmer for Atmel AVR microcontrollers
- binutils-avr: Binary utilities supporting Atmel's AVR targets
- dfu-programmer: device firmware update (DFU) based USB programmer for Atmel chips
- gcc-avr: The GNU C compiler (cross compiler for avr)
- openocd: Open on-chip JTAG debug solution for ARM and MIPS systems
- simulavr: Atmel AVR simulator
- uisp: Micro In-System Programmer for Atmel's AVR MCUs
Programmer hardware
There are several commercial and DIY implementations of AVR programmers available. However, I see little reason not to use the official USB-based AVRISP mkII programmer—at least as a starting point. It's inexpensive and is supported by avrdude. Another AVR-sourced alternative to consider is the AVR Dragon—which appears to be both a programmer and an ICE interface for debugging.
To maximize the FOSS spirit, you may prefer an open-hardware design. The USBtinyISP is one such alternative, and Lady Ada packages a promising kit based on this design with some modifications. My biggest concerns with using a third-party programmer are that it introduces a layer of uncertainty in the development process (“Does it not work because my code is foobared or because the programmer isn't working?”) and compatibility for new target devices will be less likely than with the official AVRISP mkII programmer.
ARM
I sense there is a lot of potential for ARM programming on Linux, but it is difficult to actualize because of inadequate documentation.
ARM microcontrollers appear to be supported by GNU tools, discussions of which can be found at IBM and by Uwe Hermann.
Precompiled tools are available from the GNU ARM project. In addition, “A good precompiled GCC toolchain comes from CodeSourcery.”2) It's unclear whether the toolchain provided by the no-cost “Lite” version of CodeSourcery supports all ARM microcontrollers of interest; it's also not clear what the licensing terms are.
Debian packages
A list of packages in Debian relevant to ARM inlcudes:
- diet libc: a libc optimized for small size
- openocd: Open on-chip JTAG debug solution for ARM and MIPS systems
- qemu: fast processor emulator
- skyeye: Embedded Hardware Simulation
- uboot: A boot loader for embedded systems
Programmer hardware
TODO
MIPS
Debian packages
A list of packages in Debian relevant to MIPS inlcudes:
- diet libc: a libc optimized for small size
- openocd: Open on-chip JTAG debug solution for ARM and MIPS systems
- qemu: fast processor emulator
- spim: MIPS R2000/R3000 emulator
- uboot: A boot loader for embedded systems
Programmer hardware
TODO
PIC
High-level language support is probably PIC's biggest issue when using Linux and FOSS for development as it seems to be limited to JAL or (for a small number of devices) SDCC. However, simulation of PICs on Linux seems to be handled pretty well by gpsim.
JAL
JAL is an acronym for Just Another Language—a Pascal-like language developed specifically to provide high-level language support for 8-bit PIC microcontrollers. The original JAL has been been superseded by JALv2. JALv2 is typically used along with the jallib libraries.
A good source of information for getting things going with JALv2 and jallib is the Just Another JAL Website. General JAL and jallib documentation is also available at the jallib's Google Code site.
Both JALv2 and jallib appear to be actively developed. I would love to see a discussion regarding the quality of binary code it produces.
SDCC with PICs
SDCC can be used to program a limited number of PICs in C. The SDCC manual indicates that support for PICs with 14 bit wide instructions, “is not yet mature and still lacks many features. However, it can work for simple code.” Support for PICs with 16 bit wide instructions is not indicated as being immature. However, the SDCC homepage has the caveat, “Work is in progress on supporting the Microchip PIC16 and PIC18 series.”
Googling “sdcc pic linux” will point you toward several tutorials on getting PIC+SDCC projects running. One of the concerns I have with using SDCC with PICs is the (lack of) support for new devices—even those that have 16 bit wide instructions.
Debian packages
A list of packages in Debian relevant to PIC includes:
- gpsim: Simulator for Microchip's PIC microcontrollers
- GNU PIC utilities: Those utilities for the Microchip PIC microcontrollers family contain an assembler (compatible with MPASM), a disassembler, and other tools.
- nitpic: simulator for the Microchip PIC16C84 microcontroller
- picprog: Microchip PIC serial programmer software
- simulpic: simulator for Microchip PIC16F84 microcontroller
Programmer hardware
Consult:
XMOS
XMOS provides an Eclipse-based IDE for their embedded processors that is open source—though all the licensing terms need more careful examination to determine if it is FOSS. The IDE claims to support XC (a C subset with extensions designed specifically for XMOS devices), C and C++.
Programmer hardware
Programming of XMOS processors is achieved through their USB-based XTAG-2 card.
SDCC
From the SDCC Website, “SDCC is a retargettable, optimizing ANSI - C compiler that targets the Intel 8051, Maxim 80DS390, Zilog Z80, Z180, Rabbit 2000 and the Motorola 68HC08 based MCUs. Work is in progress on supporting the Microchip PIC16 and PIC18 series. … SDCC also comes with the source level debugger SDCDB, using the current version of Daniel's s51 simulator.” The simulator supports mcs51, the Dallas DS80C390, the Phillips XA51 family, the Z80 and the 6808.
SDCC appears to be actively developed. I would love to see a discussion regarding the quality of the binary code it produces.