[HN Gopher] Using the Rust standard library with the NuttX RTOS
___________________________________________________________________
Using the Rust standard library with the NuttX RTOS
Author : fork-bomber
Score : 46 points
Date : 2025-01-27 18:16 UTC (4 hours ago)
(HTM) web link (lupyuen.org)
(TXT) w3m dump (lupyuen.org)
| the__alchemist wrote:
| Interesting. RTOS is a major embedded ecosystem component that
| rust currently lacks.
|
| For anyone not familiar: NuttX is notable as the RTOS used on the
| open-source PX4 flight controller firmware, which is ubiquitous
| in commercial UASs.
| kbaker wrote:
| https://arewertosyet.com/
|
| has a big list. The definition of what is an RTOS and how much
| is in software vs hardware is a blurry area.
|
| https://rtic.rs/2/book/en/#is-rtic-an-rtos
| vdjskshi wrote:
| There's Hubris, https://github.com/oxidecomputer/hubris
| vollbrecht wrote:
| The espressif ESP-IDF sdk that is using FreeRTOS underneath has
| rust + std support for quite some time now.
| AlotOfReading wrote:
| Rust has some very competent RTOSes already like Tock / OxidOS
| and PikeOS. It's great to see support for NuttX, but it's Rust
| isn't completely lacking for options here.
| fellowmartian wrote:
| Actually, Rust embedded ecosystem exists and is amazing. It's a
| breath of fresh air after having to use vendor SDKs from ST,
| Nordic, and even Raspberry Pi.
| ost-ing wrote:
| There is embassy and rtic, albeit they are quite lightweight
| junon wrote:
| Not sure if the author is the one who added support but it'd be
| great to get a somewhat in depth explanation as to how a target
| was added to Rust! The docs surrounding this kind of... leave a
| lot to the imagination.
| loeg wrote:
| So like, taking a step back, is NuttX POSIX or POSIX-like (if
| there's a file namespace with /dev in it / you can use the Nix
| package)?
|
| And... does it have a global memory allocator (using stdlib
| packages that use alloc)? I can't really tell if this is an RTOS
| for microcontrollers or like, 32-bit ARM and don't have any
| background on it. And how does that interact with RTOS
| guarantees?
| MarkSweep wrote:
| Yes, it's POSIX-like, its system calls can even be implemented
| using interrupts like a normal OS (though that is optional). It
| has its own hardware abstractions and IOCTL interfaces around
| devices. Yes, it has a global memory allocator you obviously
| can use when processing interrupts. You can register your own
| interrupt handlers through the operating system, so you can
| still get real time guarantees.
|
| It does run microcontrollers. In the project I worked on we ran
| it on a STM32 device. The networking stack, threads, POSIX-like
| message queue, memory allocator, and synchronization primitives
| were fine. It has a little shell than runs on serial that can
| be useful debugging tool. It had a little file system that was
| easy to corrupt. Most of the other hardware abstractions we
| avoided and just talked directly to hardware.
|
| Personally if I were doing a project from scratch I would use a
| different RTOS that does not add extra layers of abstraction.
| But I understand the appeal of porting existing software to a
| POSIX-like target.
___________________________________________________________________
(page generated 2025-01-27 23:01 UTC)