Ada on the first RISC-V microcontroller
by Fabien Chouteau –
Updated July 2018
The RISC-V open instruction set is getting more and more news coverage these days. In particular since the release of the first RISC-V microcontroller from SiFive.
Since the initial release of this blog post we have improved the support of Ada/SPARK on RISC-V and the HiFive1 board.
In GNAT Community Edition 2018, the HiFive1 is now directly supported on Linux. This means that the procedure to use the board is greatly simplified:
- Download and install GNAT riscv32-elf hosted on Linux. This package contains the RISC-V cross compiler as well the required Ada run-times
- Download and install GNAT native for Linux. This package contains the GNAT Programming Studio IDE
- Download the Ada_Drivers_Library project
- Start GNAT Programming Studio
- Click on "File -> Open Project..."
- Select the "examples/HiFive1/hifive1_example.gpr" file in the Ada_Drivers_Library sources and click Ok
- Click on the "Build all" icon to compile the example
- Follow the instructions in the freedom-e-sdk to flash the example on the board using OpenOCD
Feeling inspired and want to start Making with Ada? We have the perfect challenge for you!
The Make with Ada competition, hosted by AdaCore, calls on embedded developers across the globe to build cool embedded applications using the Ada and SPARK programming languages and offers over €8000 in total prizes.