GRiSP 2 is a combination of embedded hardware and software aiming at being the best prototyping solution for Erlang and Elixir developers.
The first version of the GRiSP board was and is still used extensively for a wide range of applications like custom made home automation systems, teaching, European research projects, and even industrial prototyping.
Solving the Pain Points with Embedded Development
Traditional embedded development is done with low level languages or specialized virtual machines and language subsets. Many problems become hard to solve in such environments. Properties like fault tolerance, debugging and tracing, test and iterate are hard to implement. The GRiSP platform solves these problems by bringing native Erlang and Elixir into the embedded world. You can now get the full fault tolerance properties from Erlang and its supervision structure. Debugging and tracing is easy and fast, and can be performed against live hardware and existing systems. Testing and iterative development is more fun and flexible with features such as hot code loading.
Getting into embedded development can be a daunting task for high-level language developers. There are many hardware platforms and configurations out there. Learning new or specialized languages that have special limitations reduces productivity and comes at a cost. Picking an option and setting up environments is a painful process. What if you could program embedded systems using normal Erlang and Elixir and their standard tools? With GRiSP that becomes a real possibility. We have taken a layered approach to the hardware API so you can interact with the hardware and peripheral drivers through pure Erlang. You can keep using any existing libraries that you are used to, since the VM is the same as you would run on any other platform. GRiSP lets you venture out into the world of embedded development using your existing skillset!
The Evolution of GRiSP
The GRiSP 2 board will be the natural evolutionary next step for our GRiSP 1 board. We have overcome design pitfalls and optimized our hardware, and all we learned will be put into GRiSP 2 by design.
The experience and feedback we gathered lead us to work on the second version of the board with the following enhancements:
- Real bare-metal Erlang using the RTEMS RTOS
- Support for Elixir via Nerves and Linux
- More CPU power for better peak performance and enhenced power efficiency
- Better booting capabilities, aiming at ultra-fast boot time
- Ethernet port for more network configuration choices
- Overall improved IO throughput
- More modular design to ease the move from development to production
- Improved tooling
- Complete Erlang project backward compatibility
GRiSP 2 Specifications
GRiSP 2 is a prototyping board made from a System on Module (SoM) and an IO break-out base board.
System on Module
- NXP iMX6UL, ARM Cortex-A7 @ 696 MHz, 128 KB L2 cache
- Integrated power management
- TRNG, Crypto Engine (AES/TDES/SHA), Secure Boot
- Wi-Fi 802.11b/g/n WLAN
- 100 Mbit/s Ethernet port with support for IEEE 1588
- MicroSD Socket for standard MicroSD cards
- Dallas 1-Wire via 3-pin connector
- Digilent Pmod™ compatible I²C interface
- Two Digilent Pmod™ Type 1 interfaces (GPIO)
- One Digilent Pmod™ Type 2 interface (SPI)
- One Digilent Pmod™ Type 2A interface (expanded SPI with interrupts)
- One Digilent Pmod™ Type 4 interface (UART)
- Two RGB LEDs
- 5 DIP switches
- Reset Key
- Serial port via Micro USB for console (Erlang Shell or RTEMS Console)
- On-board JTAG debugger via Micro USB
- JTAG / Trace connector for external debuggers
- Power supply via Micro USB connector
- Only one USB cable needed for power, console and on-board JTAG
Like for the first version, the project provides all the tools to build and run Erlang code on bare-metal hardware. What you get is a complete, full-blown Erlang Virtual Machine (VM) that is identical to what you would run on a normal OS, but running directly on the CPU.
The Erlang virtual machine is compiled together with the real-time abstraction layer The Real-Time Executive for Multiprocessor Systems (RTEMS) Real Time Operating System (RTOS). This allows Erlang to work directly with the hardware without any layer in-between. Drivers or NIFs implemented in C can process signals with stringent deadlines and together with Erlang’s excellent soft real-time properties can make for a very snappy hardware system.
Towards Hard Real-Time
We are also working on research to bring hard real-time to the embedded Erlang world. Working with C drivers in your Erlang system can already give you hard real-time benefits, but we want to make this accessible from Erlang directly without requiring any low-level knowledge. Once mature, this will be part of our future software stack and feature set.
Nerves and Linux
In addition to running Erlang bare-metal, GRiSP 2 supports the Nerves platform on Linux. This greatly widens the range of embedded applications that can be prototyped and deployed on GRiSP 2 hardware.
The GRiSP 2 hardware has been carefully designed to improve the IO contentions that we detected in the first version. We added an on-board Ethernet port, to increase the number of ways you can interact with the board via networking.
The GRiSP 2 hardware is designed with a SoM (System on Module) on top of an IO break-out board. When designing a production board after the prototyping phase, the same SoM can be reused and only the IO board need customization. This greatly reduces the cost of designing production hardware.
GRiSP 2 comes with a complete toolchain to create and deploy embedded projects using Erlang or Elixir. There is also automated tooling support for creating custom builds of the Erlang VM that include your own custom C drivers or any other included C code that you may need.
We want to make it as easy and painless as possible to deploy embedded projects with Erlang. It should feel as close as possible to a normal Erlang project and our tooling is there to help you with all steps in the process.
The GRiSP 2 hardware and software suite is fully backward compatible with the Erlang code developed for the first version.