NuttX RTOS
NuttX RTOS
Abstract— Linux has followed a long and amazing journey to Soon after that Linux started to be used on some embedded
become the standard OS when people think about a "Feature applications as well. In fact, in 1997 Dave Cinege created the
Rich Embedded" OS, but yet it has its drawbacks: it requires a Linux Router Project [29] that was considered the first real
processor with MMU (the no-mmu/uClinux has many embedded Linux project [28].
limitations that will be discussed during the article); it requires
a lot of RAM and Flash memory to run; its power- In the following year (1998) a new important milestone for
consumption is high; its boot time is long (dozens of seconds Linux in the embedded system arena was reached: Kenneth
to minutes), and the list goes on. These limitations make Albanowski and D. Jeff Dionne began working on the uClinux
Linux not the best choice for resource-constrained devices. project. uClinux was a port of Linux kernel to processor
without MMU (Memory Management Unit). The initial port
In order to correct many of these limitations, in 2007 Mr. was to the Motorola MC68328 DragonBall processor that was
Gregory Nutt released an RTOS he had created from scratch, used by PDAs (Personal Digital Assistant) [27] such as 3Com
called NuttX (just like Linux also refers to its creator, Linus PalmPilot and Pilot III.
Torvalds). NuttX was implemented from scratch to be small,
fast, POSIX and ANSI compliant, and run on small Then in 2002 a company called SnapGear Inc that was
microcontrollers and even on 64-bit Intel/AMD, RISC-V and contributing to the uClinux project and using it in their
ARM processors. And most importantly: to be Unix/Linux- products submitted the uClinux patches to kernel mainline that
like RTOS. were included on Linux 2.5.46 [26]. Since then in the Linux
source code tree there is a "no-mmu" directory that enables the
I. INTRODUCTION (Heading 1) Linux kernel to run on processors without MMU.
Linux is everywhere nowadays. It runs on TVs [1], WiFi
routers [2], Smartphones [3] [4], Smartwatches[5], Cars[6], Despite the fact of Linux been used on many embedded
Refrigerators[7] and even on SpaceX Falcon [8][9]. But Linux system projects it has some drawbacks and limitations, just to
success didn't happen overnight. list some: 1) it requires at least 2MB Flash and 4MB RAM to
Linux was created more than 30 years ago as a general run [25]; 2) its boot time is too long for some applications
purpose operating system for PCs. In 1991 Linus Torvalds, (there are some hacks that try to improve it, like saving a
creator of Linux, released his famous message in the minix booted image on disc/flash and just load it directly to the
usergroup announcing about his project: RAM); 3) it is not a Realtime kernel (although there are
patches that can be applied to the kernel to improve its
“Hello everybody out there using minix – realtime capabilities, it still best effort scenario, the kernel
wasn't designed from scratch to be realtime); 4) it is not a
I’m doing a (free) operating system (just a hobby, won’t be good option for low power applications because it needs to run
big and professional like gnu) for 386(486) AT clones. […] It on processor that consumes too much power and scaling down
is NOT portable (uses 386 task switching etc), and it probably the CPU frequency to few MHz is not an option because the
never will support anything other than AT-harddisks, as that’s kernel by itself requires too many CPU cycles to do its job; 5)
all I have :-(.” [31] and most importantly the GPL license is a source of concern
for some companies because they need to release the source
From his words it was clear what were Linux's limitations at code [32].
the time, it was not planned to run on anything other than an
Intel 386 processor that Linus was using to write it. Actually It's important to note that although Linux can run on
that statement proved to be wrong and just four years later the processors without MMU it cannot run on low-cost
Linux kernel was ported to Alpha DEC [30], SUN Sparc and microcontrollers that have few KB of RAM and Flash,
MIPS. because its size is too big to fit in the Flash and it requires too
much RAM memory to start-up.
www.embedded-world.eu
8051 and Z80 to confirm that NuttX was small enough to run
So, to solve these issues in 2007 Gregory Nutt released the on 8-bit microcontrollers [20].
NuttX RTOS. This RTOS is what Linux should be for
microcontrollers. In the next sections we will discuss what Currently NuttX supports dozen of hardware architectures
NuttX is, which problems NuttX solves. (i.e.: arm, arm64, avr, hc, mips, misoc, or1k, m16c, risc-v (32-
bit and 64-bit, with or without MMU), sh1, sim, sparc, x86,
x86_64, xtensa, z16, z80) and hundreds of microcontrollers
I.What is NuttX? and microprocessors [19].
www.embedded-world.eu
USB and they developed a C++ library called FiMoSDK that the NuttX project. Masayuki from Sony presented this new
implements the handwriting logic and exercises. platform in the Embedded Linux Conference Europe in 2019
[12].
In [34] NuttX was used to create the RT-ROS (Realtime
Robot Operating System) project. They used the ROS But Sony is not the only semiconductor company submitting
framework as base and extended it to support realtime time support to their chips to the NuttX mainline: Espressif
application using a multi-core processor approach: running Systems is also actively contribution code to the project, they
non-realtime ROS applications on Linux in a core and realtime already included ESP32, ESP32-C3, ESP32-C6, ESP32-S2
control applications in another core running NuttX. and ESP32-S3 into NuttX mainline; NXP also submitted
support to some other their chip to the mainline. And slowly
In [35] researchers from Bosch present the micro-ROS project other companies are starting to contribute.
[16], a ROS framework developed to work on
microcontrollers. In this article they explained about their NuttX also was used as the backbone of Google Project Ara
micro-ROS Executor that uses NuttX's Sporadic Scheduler and, although Google didn't release any commercial product
(SCHED_SPORADIC) as base. based on it, their source code was used by Motorola to create
the Moto Z series Snap Covers powered by NuttX [40].
An open-source computing platform for robot control is
presented in [36]. Their platform is based on the NXP More recently a new company called Wilderness Labs created
LPC4337 microcontroller, but because it was developed over a .NET C# ecosystem for microcontrollers called Meadow
NuttX they can replace the microcontroller without modifying [42] that runs over the NuttX RTOS. They created their own
their application. implementation using Mono as a starting point. They
contributed their advancements in the Dynamic Library
The first successful open-source project with a broad audience Loader back to the NuttX community [43].
to use NuttX was the PX4 Autopilot and Flight Controller for
drones [15]. The PX4 project was created by Dr. Lorenz Meier Another company developing products with NuttX is Xiaomi,
from ETH Zurich in 2011 [37] and it evolved very fast to which uses it in their Vela platform [41]. Xiaomi is very active
support many devices [14]. in the NuttX community submitting a huge amount of patches
every single day.
The next project that brought NuttX attention to the many
companies was ThingSee One from Haltian. They created a
very advanced IoT device and a successful campaign on IV. Conclusion
Kickstarter [13] and commented that they developed it on top
of NuttX (at video position 2:22). Haltian contributed many of NuttX was implemented from scratch to be a POSIX
their developed features back to the NuttX community, compliant RTOS. It means everything on NuttX was
including the USRSOCK subsystem. developed with this idea in mind, even internal APIs of the
kernel also follow this approach. This approach makes even
Soon after that Sony announced during the ARM TechCon the kernel driver development a task more orthogonal for
2016 that they were developing audio product using NuttX developers, because then they don't need to learn some strange
[11] : API.
"Sony has released audio products based on Cortex-M3. Also the similarities with Linux kernel subsystems makes the
Considering development efficiency, code reusability and transition to NuttX something more pleasant for developers.
feature enhancements, we ported POSIX based open source Embedded Linux developers normally can trace parallels on
RTOS named NuttX onto the MCU by ourselves, modified the solutions they created for Linux and apply those concepts
NuttX for fast ELF loading, introduced minimum adb (Android when developing similar applications to run on
debug bridge) protocols for testing purpose, DVFS in microcontrollers.
autonomous mode, wake_lock and stack trace which are
popular in Linux/Android worlds. Middleware and Another important thing to keep in mind is that as main
Applications were developed in C++11 with libc++ which are desktops processors moved to 64-bit the Linux focus to 32-bit
also popular for large software systems. To debug the is slowly being left to the second plan, as discussed here [38].
software, we implemented NuttX support for OpenOCD so that In fact, the support for Intel 386, the processor where Linux
we can debug multi-threaded applications with gdb." was created, was already removed 10 years ago [39].
In the sequence Sony released the Sprense platform [10] also Bibliography
running NuttX. It is based on Sony Multicore (6x ARM
Cortex-M4F) CXD5602. They submitted support to NuttX
mainline and since then Sony became a constant contributor to
[1] D. Neary, "Did you know Linux is in your TV?", [15] "PX4 Open Source Autopilot for Drone Developers",
OpenSource.com, 24 February 2023, DroneCode, 23 February 2023, https://px4.io
https://opensource.com/article/18/5/places-find-linux
[16] "micro-ROS puts ROS 2 onto microcontrollers", ROS
[2] "OpenWrt Project", OpenWrt, 23 February 2023, Foundation, 22 February 2023, https://micro.ros.org
https://openwrt.org/
[17] "MCUBoot", MCUBoot Page, Linaro, 22 February 2023,
[3] "Android", Android Project, Google Inc, 23 February https://www.mcuboot.com/
2023, https://www.android.com
[18] A. Assis, "What is the NuttX RTOS and why should you
[4] J. Gloor, "Are There Any Linux Phones?", How-To Geek, care?", Embedded, 15 August 2017,
23 February 2023, https://www.howtogeek.com/790014/are- https://www.embedded.com/what-is-the-nuttx-rtos-and-why-
there-any-linux-phones/ should-you-care/
[5] "AsteroidOS: Free your wrist", AsteroidOS Project, 23 [19] "NuttX arch/ directory", Github NuttX Repository,
February 2023, https://asteroidos.org/ Microsoft, 23 February 2023,
https://github.com/apache/nuttx/tree/master/arch
[6] "Automotive Grade Linux", The Linux Foundation
Projects, 23 February 2023, https://www.automotivelinux.org/ [20] "NuttX Release Notes", Github NuttX Repository,
Microsoft, 23 February 2023,
[7] "Linux community touched by the touchscreen on https://github.com/apache/nuttx/blob/master/ReleaseNotes
Electrolux fridge", Electrolux Group, 23 February 2023,
https://www.electroluxgroup.com/en/linux-community- [21] "The Apache Software Foundation Announces Apache®
touched-by-the-touchscreen-on-electrolux-fridge-8873/ NuttX™ as a Top-Level Project", Apache Software
Foundation, 23 February 2023,
[8] "SpaceX Sent NASA Astronauts Into Orbit Using Linux", https://news.apache.org/foundation/entry/the-apache-software-
The Byte, Futurism.com, 23 February 2023, foundation-announces-apache-nuttx-as-a-top-level-project
https://futurism.com/the-byte/spacex-nasa-astronauts-linux
[22] G. Nutt, "NuttX RTOS Beginnings", Youtube Video, 23
[9] S. Vaughan-Nichols, "From Earth to orbit with Linux and February 2023,
SpaceX", ZDNET, 23 February 2023, https://www.youtube.com/watch?v=KF_9yOsNH2s
https://www.zdnet.com/article/from-earth-to-orbit-with-linux-
and-spacex/ [23] "NuttX Real-Time Embedded Operating System",
SourceForge, Slashdot Media, 22 February 2023,
[10] "Sony’s multicore microcontroller technology with global https://sourceforge.net/projects/nuttx/
LTE connectivity", Sony, 23 February 2023,
https://developer.sony.com/develop/spresense/ [24] A. Sharma, "Porting NuttX Real-Time Operating System
on PolarFire® SoC FPGA", 22 February 2023,
[11] "ARM TechCon 2016 Schedule", ARM TechCon / https://riscv.org/blog/2023/02/porting-nuttx-real-time-
recovered from archive.org, 23 February 2023, operating-system-on-polarfire-soc-fpga/
https://web.archive.org/web/20170402115031/http://schedule.
armtechcon.com/session/developing-audio-products-with- [25] E. Barbieri, "What is embedded Linux? Part I", 22
cortex-m3nuttxc11 February 2023, https://ubuntu.com/blog/what-is-embedded-
linux
[12] M. Ishikawa, "NuttX for Embedded Linux Developers",
Embedded Linux Conference Europe 2019, 23 February 2023, [26] M. Gillham, "uClinux and Linux set to merge", 23
https://elinux.org/images/8/84/NuttX_for_Embedded_Linux_d February 2023, https://www.linux.com/news/uclinux-and-
evelpers_20191026_without_video.pdf linux-set-merge/
[13] "Thingsee One: The Smart Developer Device", [27] "Personal digital assistant", Wikipedia, Wikimedia
Kickstarter, 23 February 2023, Foundation, 26 February 2023,
https://www.kickstarter.com/projects/haltian/thingsee-one-the- https://en.wikipedia.org/wiki/Personal_digital_assistant
smart-developer-device-for-mobile
[28] C. Simmonds, "Embedded Linux timeline", 26 February
[14] "Flight Controller (Autopilot) Hardware", DroneCode, 23 2023, https://2net.co.uk/embedded-history
February 2023, https://docs.px4.io/main/en/flight_controller/
www.embedded-world.eu
[29] "Linux Router Project", Wikipedia, Wikimedia [41] "Xiaomi launches a new IoT Software Platform Xiaomi
Foundation, 25 February 2023, Vela based on NuttX OS", GizmoChina, 24 February 2023,
https://en.wikipedia.org/wiki/Linux_Router_Project https://www.gizmochina.com/2020/11/05/xiaomi-launches-a-
new-iot-software-platform-xiaomi-vela-based-on-nuttx-os/
[30] J. Paradis, "Porting Linux to the DEC Alpha",
https://www.linuxjournal.com/article/1177 [42] "Enterprise-Grade IoT Full .NET, Real Embedded Secure
& Scalable", Wilderness Labs, 24 February 2023,
[31] L. Torvalds, "LINUX's History", https://www.wildernesslabs.co/
https://www.cs.cmu.edu/~awb/linux.history.html
[43] "ICYMI: Meadow demos at NuttX Workshop 2022",
[32] S. Yegulalp, "Why GPL still gives enterprises the jitters", Wilderness Labs, 24 February 2023,
https://www.infoworld.com/article/2608340/why-gpl-still- https://blog.wildernesslabs.co/icymi-meadow-demos-at-nuttx-
gives-enterprises-the-jitters.html workshop-2022/
[34] Wei, H., Shao, Z., Huang, Z., Chen, R., Guan, Y., Tan, J.,
& Shao, Z. (2016). RT-ROS: A real-time ROS architecture on
multi-core processors. Future Generation Computer Systems,
56, 171–178.
https://doi.org/https://doi.org/10.1016/j.future.2015.05.008
[36] Pessacg, F., Nitsche, M., Teijeiro, A., Martın, D., &
Cristoforis, P. D. (2017). Open-source embedded framework
for unmanned ground vehicle control using CIAA. 2017 Eight
Argentine Symposium and Conference on Embedded Systems
(CASE), 1–6. https://doi.org/10.23919/SASE-
CASE.2017.8115372