Making it Easier to Build Firmware

OSHW Logo

Most microcontroller manufacturers give you some kind of free development toolchain or IDE with their silicon products. Often it’s crippled, closed source, and a large download. This is pretty inconvenient when you want to have firmware that’s easy to build and distribute. I’ve found many of these toolchains to be annoying to use, and requiring closed source software to build open source firmware seems less than desirable.

It’s possible to build code for most microcontrollers using command line tools. You’ll need a compiler, the device manufacturer’s libraries and header files, and some method of flashing the device. A lot of these tools are open source, which lets you have an open source toolchain that builds your project.

Setting up these tools can be a bit tricky, so I’m building a set of templates to make it easier. Each template has instructions on setting up the toolchain, a Makefile to build the firmware, and sample code to get up and running quickly. It’s all public domain, so you can use it for whatever you’d like.

Currently there’s support for AVR, MSP430, Stellaris ARM, and STM32L1. More devices are in the works, and suggestions are welcome. Hopefully this helps people get started building firmware that’s easy to build and distribute with projects.

29 thoughts on “Making it Easier to Build Firmware

  1. Only plans to support PIC18 and PIC32? Microchip have been producing their line of C compilers for PIC’s all the way down to 12F, seems strange to ignore everything below PIC 18.

    1. To be honest, I just stuck PIC18 there as a placeholder. I think it will be easy to get support for PIC12 and PIC16 with SDCC, an open source C compiler. Haven’t used the low end PICs in a little while though.

    1. I’d like to contribute both our LPC13xx libraries (the LPC1343 and LPC1347 families have some slight but important differences), and also the LPC176x library. These are all original libraries developed by us (me), offered under BSD 3-clause license, but I’m happy to go with Unlicense. There is currently some good documentation for the LPC1343 library: http://universalair.co.uk/control/forebrain#functions but not for the others.

      The LPC1343 code is specifically written for the Forebrain LPC1343 dev board, but is written in a way that makes it useable on any LPC1343 board. You donidn’t include

      1. whoops, I meant to say: you didn’t include any contact details in the post, but then I found your twitter handle and stuff via your personal page. Please let me know how best to get in touch with you if you’re interested.

        1. Based on UAir’s work, I’ve done a small amount of work to get things running nicely under Linux:

          http://forums.hackaday.com/viewtopic.php?f=2&t=2556

          It’s no terrible departure from their stock code, but I wrote up step-by-step directions (apologies if UAir has re-published it and made this comment redundant), which might be of interest.

          I’ll also be hacking on it a little more to get it working with the LPC1778 sometime in the near future, and can try to remember to post updates.

          1. You might be interested then in the LPC176x libraries we’re working on, it might be a smaller jump from there to the LPC1778 than from the LPC13xx up.

      2. Should also mention that in terms of the library, there’s only minor differences between the LPC13xx series M3 and LPC11xx series M0, but there are two distinct “generations” that you have to be careful of for each, but other than that, porting code is straightforward.

  2. Honestly, Atmel’s stuff has always been free and non-crippled. The IDE is actually really nice if your running windows. None the less, this will be a great tool, especially for a lot of the new ARM stuff coming out!

    1. That’s not true, it has been free for the past 6-7 years, but before that Atmel didn’t offer the gcc option at all.
      Good thing it went free, it has really boosted usage, compatibility and documentation. It really shows what OpenSource has to offer :-)

      1. Indeed. Now if only they would get their supply chain sorted out… Been burned once too often by their moronic shit. 41 weeks IS NOT an acceptable lead time :(

  3. I think that we will be able to talk about Open Source Hardware when the architecture of the processor itself is Open Source, like for the COFE processor (open source hardware developped for academical purposes) that could be synthetized on an FPGA. Taking an open source IDE for developing on ARM based processors and others are not enough, but important though.

    1. Yes, an open source architecture that’s actually available in silicon would be very cool. The OpenRISC is one example of an open core, but it’s not widely used since you need to run it on a FPGA. They’re working on an ASIC though apparently.

    2. I’ve seen this advocated, and I can see why it’s interesting, but I can’t see why it’s _useful_, or more useful than a sufficiently accessible and documented platform. For all practical purposes you’re going to want an ASIC.

  4. CodeBlocks pretty much has template and compiler settings for AVR build into it. Making it very easy to do AVR building. (Not sure about the rest of the chips)

  5. This sounds wonderful. Especially for my 2 stellaris launchpads, which have remained mostly unused (even with the stellarisware+gcc post earlier, it was just so much of a hassle to build for)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s