Skip to main content

Tools for Open Source Hardware

As officially defined by OSHWA.org, "Open source hardware is hardware whose design is made publicly available so that anyone can study, modify, distribute, make, and sell the design or hardware based on that design. The hardware's source, the design from which it is made, is available in the preferred format for making modifications to it. Ideally, open source hardware uses readily-available components and materials, standard processes, open infrastructure, unrestricted content, and open-source design tools to maximize the ability of individuals to make and use hardware."

Note that in order to be open source hardware (OSHW), it does not have to offer open source design tools. "Design tools" can mean anything from hardware (a multimeter) to an Integrated Development Environment (IDE) to web-based tools that offer project management functionality. It's important to note that many of the well-known OSHW boards like ArduinoLaunchPadBeagleBone, and the STM Nucleo include free libraries, code examples, and projects with complete source code offered for free download, as well as either free tools like the Arduino IDE or mbed.org.

Hardware tools that utilize open source exist, and like open source hardware, are more accessible via (comparatively) low prices. One example is the Red Pitaya, a low cost, versatile measurement and control board running Linux that enables access to the kind of lab equipment that otherwise, some could not afford. The Red Pitaya offers fast and slow analog inputs (up to 125MS/s) and outputs (100KS/s). It can act as an oscilloscope (~50MHz bandwidth), spectrum analyzer, LCR meter, Bode analyzer, Tesla meter, LTI DSP workbench, a function generator suitable for audio (14-bit resolution), and more. It connects to a tablet, PC, or smartphone to use as an interactive display. Add the Sensor Extension Module and you can connect toArduino shields and SEEED Studio Grove sensors to extend functionality even further.

Figure 1: The incredible, affordable Red Pitaya, an open source measurement and control board that can act as an oscilloscope, spectrum analyzer, LCR meter, Bode analyzer, Tesla meter, LTI DSP workbench, and more.

Figure 1: The incredible, affordable Red Pitaya, an open source measurement and control board that can act as an oscilloscope, spectrum analyzer, LCR meter, Bode analyzer, Tesla meter, LTI DSP workbench, and more.

Red Pitaya is a spin-off of a company that builds instrumentation for particle accelerators and was first introduced via Kickstarter in 2013. Red Pitaya is an open-source-software measurement and control tool with visual programming software and open-source, web-based test and measurement instruments. Red Pitaya can be used with Matlab, LabView, Python and Scilab. Red Pitaya is made more accessible with open source software so users can create additional features, functions and utilities themselves.

Some tools can be made out of open source hardware boards. An Arduino UNO can be made into a digital logic analyzer, for instance. But there's more to tools than diagnostic hardware tools. Fundamentally, tools are meant to help you test, debug and troubleshoot. Good tools are useless if a board is not useable due to lack of information or the ability to "play well with others."

So what are the more common types of tools used when working with OSHW projects?

  1. The first design tool is perhaps the most important and the least technical: documentation. A project notebook and pencil are key for capturing ideas on the fly, noting test results and keeping track of details on design decisions in case a project must be revisited months or years later.

  2. Hardware like multimeters,oscilloscopesdecade boxes, and the like. These are typically not free, but if you belong to a makerspace, you can use tools in the makerspace for a nominal membership fee. Many hardware tools have reached price points that make them very reasonable for even casual tinkerers and makers.

  3. Programming in machine code isn't easy, so most have tools that put a layer of abstraction in between the developer and the silicon. Software creation & editing design tools are built with the processor's core architecture in mind. Most boards have a user manual that will suggest which software development tools work well with that particular board. Other tools help debug code and analyze how code is working on embedded hardware. There are still other design tools that help create schematics that can then simulate via modeling before starting bread boarding or prototyping. But with respect to OSHW, there are several categories of tools, including:

    An IDE is a software platform meant to improve productivity by providing a framework that organizes a source code editor, compiler/interpreter, debugger, build automation tool, and sometimes testing tools together in one place. Some kind of IDE is usually included with purchased tools, and some are free. One example is the Eclipse IDE. Various plug-ins can be added to Eclipse to make it support various programming languages, like C++ or Python. Mbed.org is a free online design tool with a built-in IDE.

    Sometimes "free" means accepting a compiler that doesn't optimize code (translate from C to Assembly) as nicely as paid compilers, but this constraint will increasingly abate as open source tools get better and hardware performance vs. cost continues to improve.

    1. A free, complete tool suite that is designed for and works well with the OSHW board. E.g., Arduino IDE, Energia IDE for TI LaunchPads.

    2. Online tools: Tools that never get installed on your host computer. You must have internet access for the tools to work. However, there are no updates to a tool on your computer and a much smaller footprint is on your computer hard drive. E.g.: Mbed.org

    3. Tools for purchase: Tools are generally based upon the processor's core architecture. Even so, a design tool must be verified as to whether it works well with a specific chip. Typically, you find out what core architecture your processor is based upon, and find the tools for that architecture. However, not all boards and tools work like that. For example, if a board has an ARM® Cortex®-M4 architecture, it may or may not work well, so it's a good idea to confirm that the software development tools have been designed and tested for your specific chip. Purchased tools generally come with a support agreement and are maintained with regular updates. Good examples of software design, development, debugging and testing tools for purchase are those provided by KEILMacraigor Systems, and National Instruments.

    4. Free (and open source) tools: Some tools are available in a free trial for several days; usually 30 days, and then are disabled until you purchase a key. Others are truly free, such as GNU tools. (GNU stands for "GNU's not Unix.") Linux is a free operating system; it has a Linux kernel and incorporates GNU components. (The Linux mascot is a penguin, not a gnu.)

    5. The "GNU toolchain" is an open source collection of software design tools for compiling, linking, assembling, debugging, testing, and automating programs to run on various processor architectures. Many OSHW boards support the Linux operating system (OS) and/or have GNU tools. Not all processors (usually microcontrollers) have or require an operating system, but may have GNU tools to support development. Don't confuse Linux the operating system with the GNU tools that are typically used with Linux.
  4. Bare microcontroller chips that come off the assembly line require the use of external hardware, called a programmer, to "burn" or flash the machine (Assembly) code onto the microcontroller (MCU). Most embedded development boards come from the manufacturer flashed with a bit of firmware called a "bootloader." The bootloader enables the first of two ways to get code off the computer and onto the microcontroller:

     
    Figure 2: The low cost, open source hardware STM32 Nucleo boards come with a detachable

    Figure 2: The low cost, open source hardware STM32 Nucleo boards come with a detachable "ST-LINK/V2-1" programmer tool (shown in the red box.)

    1. Many popular development boards (such as Arduinos, LaunchPads, and Nucleos) rely on the fact that the on-board microcontrollers come from the factory pre-flashed with a bootloader so the device can connect easily, typically over USB, to the computer for programming. This convenience comes at a price. A bootloader eats up some memory (usually just a few KB) and adds some delay, so if you want maximum performance, you need to overwrite the bootloader when testing is complete.

    2. In-System Programming (ISP) is a way to program on-board microcontrollers without the overhead of a bootloader or USB/serial interface. Atmel and Microchip have specialized ISPs, called In-Circuit Serial Programming (ICSP). Arduino development boards have a 2x3 header on the board that allows an external programmer tool to flash firmware onto the MCU. Programmers are platform specific.

    3.  
  5. Debuggers allow programmers to carefully monitor the flow of code as it executes for identifying code issues. A debugger uses three tools - the IDE that runs on the desktop computer (aka "the host"), circuitry built into the MCU itself, and an external debugger tool. Fortunately, the debugger tool tends to be coupled with the programmer (used to load code to the embedded hardware, or "target") so you don't need to acquire two separate pieces of hardware. Some key concepts and tools when dealing with debugging include:
    1. GDB or GNU Debugger: These popular debugger packages work for a variety of programming languages. Many include a "remote mode" that lets PC-based debugging software monitor and control the device under test via an external programmer/debugger hardware device.

    2. JTAG: is a standard for testing embedded systems. While JTAG began as a tool for board-level testing and fault detection, it is slowly becoming part of the vocabulary of the OSHW community. The Intel Edison and Galileo (both OSHW) each have a JTAG connector.

    3. Breakpoints stop code execution at defined points for checking what is happening as code executes, such as checking the status of pins and registers to ensure everything is working as intended. You can also execute each line of code step by step if desired, and observe everything as it executes.

    4. Open OCD (Open On-Chip Debugger) is an open source package that provides on-chip debugging, In-System Programming, and boundary-scan testing for a huge variety of embedded platforms that is getting traction with many chip manufacturers. Open OCD supports many JTAG probes. Modern JTAG probes have a JTAG adapter on one end (e.g., a 10- or 20-pin header) and USB on the other 

  6. Bug Tracking and Source Control
    1. A tool to track bugs is a must for an open source embedded product with any sizeable customer base or with multiple developers spread around the globe. Open source bug tracking tools are plentiful. Tools like Bugzilla or Mantis BT can be downloaded and installed on servers for free, and there are always services that can provide hosting of a bug tracker for a nominal fee.

    2. Source control is another aspect of open source embedded development that is crucial, especially since at the heart of open source is the notion of sharing and community support. Tools such as Git and Subversion are popular content management systems. Services built around tools such as GitHub provide hosted tools with many benefits. In addition to source control, GitHub provides a means to share projects widely, provides bug tracking capability, and allows for collaborative code reviews. The best part of GitHub is that it is free to host on public repositories and as with open source community tools, free and public are laudable features.

      Open Source Hardware has helped drive down the cost and complexity of getting started with embedded systems electronics. Tools that support OSHW development are steadily getting better thanks to passionate, collaborative communities that build up around these platforms and their ecosystems. No matter how powerful or feature-rich an embedded platform is on paper, if developers do not have access to solid, inexpensive development tools they are less likely to adopt that embedded platform.

 

One Last Thought

One final point about getting experience in a wide variety of embedded ecosystems: engineers or makers may find it very tempting to become an expert on a single platform. Studying the datasheet to the point of being able to recite every processor feature or register name is no doubt valuable for individual projects, but consider that in the grand scheme of things technology will change. Even if embedded systems do not have the "refresh rate" of consumer electronics, being able to adapt to various platforms easily is a much more valuable skill than becoming a master of a single, narrowly-focused product family. OSHW enables this type of broad-based learning by driving down costs so we can "taste" a variety of platforms. Try gaining some experience with an Arduino development board, try your hand at getting an individual PIC chip up and running using an external programmer. This is the kind of low-cost education that will help people (such as inexperienced students) obtain jobs by demonstrating cross-platform fluency, since help can be found in forums for almost every OSHW platform. Early exposure to a variety of system designs and paradigms will help you learn how to learn different platforms. That is crucial to a long and prosperous embedded development career or hobby.

 

Michael Parks, P.E. is a contributing writer for Mouser Electronics and the owner of Green Shoe Garage, a custom electronics design studio and technology consultancy located in Southern Maryland. He produces the S.T.E.A.M. Power Podcast to help raise public awareness of technical and scientific matters. Michael is also a licensed Professional Engineer in the state of Maryland and holds a Master’s degree in systems engineering from Johns Hopkins University.


 

Lynnette Reese is a member of the technical staff at Mouser Electronics and holds a B.S. in Electrical Engineering from Louisiana State University. Prior to Mouser, she completed a combined 15 years in technical marketing in embedded hardware and software with Texas Instruments, Freescale, and Cypress Semiconductor. She started her career as an applications engineer at Johnson Controls.