Most of the software development efforts on the more powerful RISC-V boards like Pine64 Star64 or StarFive VisionFive 2 have been focusing on Linux, but Lup Yuen Lee tried something different and managed to boot Apache NuttX real-time operating system on the StarFive JH7110-powered Star64 SBC.
NuttX may not often make the news, but they are plenty of supported platforms, and we previously played with it on the Sony SPresense board, and reported about NuttX RTOS on ESP32, so it’s good seeing the open-source real-time operating system add support for the RISC-V architecture. [Update: RISC-V support was added many years ago, sometimes around 2016]
The main trick to boot NuttX on the Star64 is to make U-boot think the NuttX kernel is the Linux kernel. That means a Linux image such as sdcard.img for the VisionFive 2 board will be used to get OpenSBIU and U-boot bootloaders, and the NuttX Flat Image Tree which you can build from scratch or download the starfiveu.fit binary to overwrite the boot/Image for Linux.
You should then see the NuttShell (NSH) in the serial console when configured with 8N1 115,200 bps:
NuttShell (NSH) NuttX-12.2.1-RC0
nsh> uname -a
NuttX 12.2.1-RC0 8605714 Aug 7 2023 16:20:45 risc-v star64
nsh> ls -l
dr--r--r-- 0 dev/
dr--r--r-- 0 proc/
dr--r--r-- 0 system/
The commands are pretty much the same as in Linux, and as a POSIX-compliant OS, the C programs are pretty much the same, so in a sense, it works like a lightweight version of Linux. If you don’t want to overwrite Linux in the microSD card, TFTP boot is also supported.
Everything is explained in more detail on Hackster.io and especially GitHub, but there’s more work to do, and Lup Yuen Lee plans to work on more features including support for HDMI video output. The Star64 SBC was not the only board to get some NuttX love in recent days, as support for the Arduino Nano 33 BLE was merged just three days ago.
People interested in NuttX RTOS may also consider attending the NuttX International Workshop taking place online on September 29-30, 2023, or even submitting a proposal for a talk or tutorial at the event with the deadline to do so being August 18.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.