A Chinese edition of this article can be found on my Chinese blog, On Open Source Hardware (Chinese).
Recently, I gained knowledge of several open source hardware platforms that catch my eye. I’d like to write down some notes about them for my own reference. As a hobbyist, I do not promise that these facts are one hundred percent accurate, while I will keep updating this article to make it more useful.
RISC-V instruction set architecture (ISA) is a lowest-level project in the open source hardware community, developed by a group of experts who spearheaded the RISC instruction set style. By now, 275 companies or research institutes have joined the RISC-V foundation. Members of the RISC-V foundation include established tech giants (like Google, Nvidia, Alibaba, Qualcomm and Western Digital, etc.), universities, and chip startups (SiFive, Andes, and etc.)
GCC toolchains and Linux kernel have supported RISC-V ISA.
Like any other ISA, RISC-V only specifies the interface between processor hardware and software, while implementation of working chips requires huge amount of extra work from chip designers and manufactures. Many chip companies have implemented RISC-V based IP cores (can be sent to foundries like TSMC to manufacture real chips) and soft cores (run on FPGA and simulators).
By now, there are only several RISC-V chips available on the market.
As an avant startup company in the RISC-V ecosystem, SiFive does not sell physic chips. Instead, it offers two Arduino-compatible boards, and a Linux-capable board. These three boards are not so affordable for hobbyists.
Canaan Inc., a China company known for cryptocurrency mining machines, released Kendryte K210 in September 2018. K210 chips can be purchased from taobao.com, priced at 199 RMB (about 28 USD) for 5 pcs. K210 features dual RISC-V cores with FPU, image & audio processing units, and AES hardware accelerator. Third-party vendors like Sipeed offer K210-based boards. K210 has rich software support. Programming frameworks like FreeRTOS, Arduino and MicroPython now are available for K210. Canaan Inc. has released an IDE based on VS code.
For Sipeed MAIX Bit hands-on, please see my article A New Powerful Arduino Variant: Maixduino on Sipeed MAIX Boards.
Indian Institute of Technology at Madras released its Shakti processor and SDK in the end of 2018, while no further information for this chip has been posted since then.
On July 25, 2019, Alibaba Group chip division announced its Xuantie 910 chip. It is a high performance RISC-V soft core.
WCH, a China company know for its CH340 series USB-to-UART chips, lists a RISC-V microcontroller, CH572, featuring BLE support.
There are some companies in Guangzhou and Shenzhen that published RISC-V soft cores. These soft cores are available in the form of FPGA boards, and are aiming at hobbyists.
The RISC-V foundation website lists some RISC-V chips from established chip manufacturers, like Microchip and NXP.
On August 22, 2019, China-based GigaDevice announced world’s first line of 32-bit RISC-V microcontrollers, consisting of 14 MCUs. GigaDevice’s RISC-V IP cores are licensed from Nuclei System Technology, another China-based RISC-V start-up.
Raspberry Pi is a platform founded by United Kingdom gentleman Eben Upton. It is promoted as a 35 USD computer, aiming at children education. Due to its hight performance and low price, Raspberry Pi has attracted millions of hobbyist users. In total, about 20 million of Raspberry Pi units are sold, making it the most popular UK computer brand.
On the hardware side, a typical Raspberry Pi board comes with a Broadcom’s Cortex-A SoC, a large RAM, and a graphics card, etc. Connectivities include USB, WiFi, Bluetooth, display ports, camera interface and GPIO. Raspberry Pi 4B, starting on sale on July 24, 2019, has been upgraded to incorporate a Broadcom BCM2711B0 SoC (quad Cortex-A72 cores running at 1.5 GHz), optional 1GB/2GB/4GB RAM, and dual Micro HDMI ports.
Besides a Raspberry Pi board, one usually needs to buy a TF card, a mouse, a keyboard, and a monitor. Of course, one can remotely connect the Raspberry Pi via SSH or VNC, therefore no need of extra mouse, keyboard and monitor.
On the software side, Raspberry Pi is capable of running desktop operating systems. It support many OSes, including Raspbian, Fedora, RISC OS, FreeBSD, Windows 10 IoT Core, among others. The official OS, Raspbian, is derived from Debian, with its custom desktop environment, and a number of software packages for education purpose. Available software packages, to name a few, are BlueJ (Java IDE), Thonny (Python IDE), and Mathematica (math software). Raspbian is portable and can run on x86 machines.
The Raspberry Pi foundation posted abundant learning materials on the web, including programming skills, electronics knowledge and many starter projects. Raspberry Pi has contributed to STEM education, in a way no other movement can match.
Arduino is a very popular electronic prototyping platform. In contrast to Raspberry Pi, Arduino boards do not seek performance advantage, unable to run any desktop operating system, instead they tend to act as building blocks for electronic prototypes.
Speaking of Arduino, I have to mention Wiring, which is often ignored by people when they write articles about Arduino. Circa 2004, Hernando Barragán, a graduate student at Interaction Design Institute Ivrea, developed Wiring for his master thesis project, making significant improvement on both usability and affordability of electronics development boards. In 2005, several employees at this institute designed Arduino based on Wiring.
Arduino expose a high-level abstraction for microcontrollers and other components, with succinct C/C++ APIs. With a few lines of code, users are able to invoke boards’ functions, such as GPIO, serial communication and flash memory. Arduino liberates users from low-level resource handling (like register manipulation), which is common in traditional microcontroller programming.
On the hardware side, Arduino platform supports multiple processor architectures. The most classical Arduino boards (Uno, Mega, Tiny) are based on Atmel AVR processors (ATmega328p, ATmega2560). Some boards (e.g, DUE) are based on Arm Cortex-M processors (Atmel SAM3X8E). There are boards (Galileo and Edison) based on Intel Quark processors. As I mentioned before, Arduino has been ported to RISC-V processors, like Kendryte K210.
Arduino boards abound in communication interfaces, such as GPIO, I2C, SPI, UART. Users can buy shields and peripherals to extend functions of their boards.
In addition to official boards, there are dozens of compatible Arduino clone brands, from companies such as Adafruit, Seeed and DFRobot. Some clones come with no brand, and can be purchased from online stores at very low prices. I bought one Arduino Uno R3 clone from taobao.com, for only 9.7 RMB (1.5 USD).
The Arduino official website offers an integrated development environment, Arduino IDE, capable of being installed on Windows, macOS and Linux. Arduino Create is a official online system that provides an web editor, user guides, a project hub, etc. Arduino IDE is not so feature-rich, lacking some important features (autocomplete) found in mordern IDEs. Third-party IDEs, like PROGRAMINO IDE and PlatformIO, are able to offer more features and better user experience.
For using PlatformIO, please see my article Develop Arduino Projects with PlatformIO for Visual Studio Code.
STM32 microcontrollers and microprocessors are designed and manufactured by STMicro. They are based on Arm Cortex-M cores, and have been successfully used in a wide range of electronics products. Although STM32 itself is a portfolio of proprietary products, it does show characteristics found in open source community.
Thanks to Arm holdings’ support for open source community, STM32 processors, like other Arm-based processors, are able to be compiled by the Gnu compiler collection (GCC). After STMicro’s acquisition of Atollic, the latter’s TrueStudio IDE is rebranded as STM32CubeIDE which can be used for free. Both TrueStudio and STM32CubeIDE are based on established open source projects, mainly Eclipse and GCC. With the combination of STM32CubeIDE and STM32CubeMX which is a graphical configration and code generation tool, developing STM32 programs becomes as easy as Arduino programming. Hobbyists and startup companies no longer need to buy expensive commercial IDEs like Keil MDK and IAR Embedded Workbench.
The flourishing STM32 ecosystem is in part due to a wide range of development boards. Official Discovery and Nucleo boards from STMicro are sold at prices ranging from 80 RMB (12 USD) to 200 RMB (30 RMB), covering F0 to H7 lines, with diverse features and performance optional. The past decade saw the rise of distinguished China-based STM32 board vendors, whose offerings are known for extremly abundant peripherals. Both STMicro and China board vendors published numerous video tutorials, e-books and code samples. Users can download these learning materials for free, even though they don’t buy any board from the publishers. In this way, STM32 has an open source ecosystem.
There exist some unbranded STM32 mini systems made by unknown China vendors, and sold via online shopping websites (AliExpress, taobao.com, and ebay). These cheap boards have drew attention to hobbyists worldwide. Because of their unique colors and shapes, they are favorably called Blue Pill and Black Pill.
For using native FreeRTOS on STM32, see my new article, Using Native FreeRTOS in STM32 Microcontrollers.
ESP8266 and ESP32
ESP8266 is a custom Cadence Tensilica Xtensa LX6 SoC, with rich resources, in particluar WiFi capability and 1 MB flash. It is sold by a China company named Espressif Systems at a very affordable price, namely 8.5 RMB (1.25 USD) per chip. The chip had been insignificant because of lack of English document until a third-party module based on it was found by geeks outside China. By now, easy-to-use frameworks like Arduino and Lua have been ported to ESP8266, making it very popular on open source hardware community.
ESP32, the successor of ESP8266, brings more higher performance and richer resources. Plenty of boards and modules based on ESP8266 or ESP32 are available on hobbyist and IoT markets. Some Arduino boards incorporate ESP8266 for wireless communication.
MicroPython is a Python runtime on microcontrollers. It is developed by Damien George, a physicist and mathematician at University of Cambridge, UK.
After connected to PC via USB, a MicroPython board displays as USB drive. Users can edit the main.py file to program their boards.
Besides, users can enter the built-in MicroPython interpreter provided by the USB-to-serial capability of their boards, then code just like in a normal Python interpreter on PC.
Now commercially available MicroPython boards are provided by MicroPython’s auther and third-parties. There are popular MicroPython clones called TPYBoard in China. The aforementioned Sipeed MAIX boards and ESP8266/ESP32 boards can be programmed using their built-in MicroPython runtime, too.
Micro:bit is developed by BBC, in conjunction with dozens of world-leading tech giants. It is aiming at children programming education. The official Micro:bit board is very compact, has two buttons, simple GPIO pads, LED array, wireless connection (radio, Bluetooth) and abundant sensors.
After connected to PC via USB, Micro:bit displays as USB drive into which programs (hex files) can be copied.
Micro:bit supports many programming languages, like Python. Kids can program their Micro:bit boards with the official block editor, MakeCode. The Micro:bit foundation offers a web-based Python IDE, too. There is also an easy-to-use third-party Python IDE, Mu.
There are Micro:bit clones available in China.
In addition to the aforementioned ones, there exist other open source hardware platforms. I will name a few.
BeagleBoard used to be very popular among electronics hobbyists. Even though its market share declined in the past few years, it evolved to form a product line, consisting of over ten boards. BeagleBoard boards are named after their characteristic colors (e.g., BeagleBone Black), and incorporate Arm Cortex-A processors from TI or Octavo Systems. BeagleBoard is Linux-capable.
We can also find many boards provided by China vendors. Most of them are inspired by Raspberry Pi, and based on Arm Cortex-A processors from Allwinner, MediaTek, Actions or Rockchip. Popular brands are Banana Pi, Orange Pi, CubieBoard and pcDuino. They lack good document and learning materials.
- July 30, 2019: First published in Chinese on my Chinese blog, and part of the article is rewritten in English and published on my English blog.
- July 31, 2019: Finishing the first English version.
- August 22, 2019, Added GigaDevice’s 32-bit RISC-V microcontrollers.