-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Survey: Crates you use for embedded development #12
Comments
|
|
❤️
if you use the
Inspired by the x86 crate, I created the |
|
|
|
teensy3-rs - bindings for the official C/C++ stack for Teensy 3.x boards. |
here are some links to related posts: https://github.com/flosse/rust-os-comparison#embedded-systems |
I don't know if you'd do much parsing in embedded dev, but nom can build in |
I have three very minor crates that were all building on nightly as of a couple of weeks ago:
|
If you are working with Cortex-M microcontrollers, need register maps for their peripherals but
to save yourself lots of time. Many thanks to @brandonedens for porting my initial version that used @flosse that link seems more appropriate for #15 @Geal Some embedded applications must not use any heap memory. Can @emk nice, an allocator! I've been looking for one. Is this one x86 specific? Do you know if it will |
I guess "xargo - A drop-in replacement for xargo..." should be "xargo - A drop-in replacement for cargo" |
My launchpad project uses these (according to my extern crate statements anyway...) volatile_register - for memory mapped registers spin - a spinlock Mutex linked_list_allocator - basic memory allocation rlibc - pure Rust implementation of some required C library functions (like memset) compiler_builtins - Instrinsics LLVM needs |
I've only tried it on x86_64, but it can probably be made to work almost anywhere with a few tweaks. The major advantage of Buddy allocators are one of the simplest allocators. It's a fun algorithm. |
linked_list_allocator is from Phil Opperman's x86-64 blog but it works on a Cortex-M4. It's just pointer math at the end of the day, |
I also note that nobody has mentioned this popular crate yet: x86. Library to program x86 (amd64) hardware. Contains x86 specific data structure descriptions, data-tables, as well as convenience function to call assembly instructions typically not exposed in higher level languages. |
some parsers can allocate and return a Vec, but the rest won't rely on Le 16 oct. 2016 20:50, "Jorge Aparicio" notifications@github.com a écrit :
|
@aochagavia yes, thank you. @thejpster @emk Thanks for the pointers. I'll read more about these allocators. 👍 |
@japaric This is of course not the case, thumbv6m supports atomic reads/writes via regular read/write instructions and atomic read/modify/writes through a cpsid/cpsie sequence. LLVM only needs to be taught that. |
A crate to load and control bare-metal programs on the PRU, an ARM co-processor found among others on the BeagleBone.
|
I've started porting
That's true. I personally don't know how one would implement the
I'm unsure about an implementation like that. cpsid/spsie only work in privileged mode and are no-op in user mode. An implementation of |
There are a few other ways to do atomics. You can set basepri to max which will mask out all interrupts (except those with 0 priority). This is what brittle and freertos seem to do. I suppose this is more for critical sections than atomics. You can also use the |
This stackoverflow.com article appears to be somewhat insightful: http://stackoverflow.com/questions/11894059/atomic-operations-in-arm Might be hard to wrap this properly. |
This, like cpsid/cpsie, can only be done in privileged mode.
These are not available for the thumbv6m target (which is what I said is doesn't support atomics -- keep reading). For thumbv7 and newer, rustc (or rather LLVM) lowers |
You cannot. You need RMW cycles to implement the complete API.
Indeed. Fortunately... thumbv6m doesn't have the concept of user mode, as far as I'm aware! So this is not a problem. |
I pulled out the drivers from my Stellaris Launchpad project, so I'd like to add: lm4f120 - A set of drivers for the TI LM4F120. |
|
I just started work on ubyte, a rust library for serialization/deserialization on microcontrollers. The API is still in progress, but I got Edit: it looks like |
Also, one I recently wrote:
Tags: |
|
Tags: |
clerk - A hardware agnostic HD44780 LCD controlling library. |
Categories:
Due to its focus on minimal overhead cc @SimonSapin ^ |
|
genio - io::{Read, Write} traits for no_std. It has wrappers for std::io::{Read, Write} to allow use in crates that support std and no_std. Its Read, Write traits have associated type parameters to support custom error types. |
Full disclosure: I wrote this. |
|
@Amanieu any plans to push this through the RFC process? In particular HashMap not being in |
@whitequark The problem is that the default |
@Amanieu I know. Can't the libstd facade provide it, though? |
Just wanted to mention my logging crate, I've been working in past. cortex-m-log - It provides generics over possible outputs (for now it is only semihosting, itm and dummy), I didn't have much of feedback so far and I haven't been working with embedded stuff for quite some time, but I appreciate increased visibility since I'd like to start working on embedded again. Tags: |
@DoumanAsh Interesting. Have to check it out, I've been using the log crate previously to log output to a UART and wrote an adapter to use that for |
@therealprof Here is example in my playground with log DoumanAsh/2B@35d6bc5 If you want to write custom destination for logs, you need to implement Printer then it will just work Specifically you only need to provide how to retrieve |
|
I believe that this issue has been superseded by the github.com/rust-embedded/awesome-embedded-rust repo. I would propose that we close this issue. Marking this for a cleanup sweep. If we would like this to stay open, please provide an update to what this issue should be focused on. |
I am closing this issue, please feel free to open another issue if you would like this discussed further. |
Ultimately, we'd like to have a list of curated crates that are nicely categorized in a presentable format (a website with search function, etc.). But, for starters, let's list here all the crates we use for embedded development.
Just add a comment here with the list of crates that you use The crate can be a library or a tool (binary). Try to stick to the following format:
I'll be collecting them here in the top comment. Try to not to list a crate that has already been mentioned unless you'd like to propose more tags for it.
The tags at this point are free form and can be anything you think will be useful to someone that has to decide whether they can use that crate or not (is it for my target architecture/device? Is it no_std? etc.).
This is also a good opportunity to figure out what are common tags that we could use for #11.
Here's the list so far:
bitflags
- A macro for C-like bit flags, pretty useful for modeling hardware registers.Tags:
no_std
macro
bitflags
lazy_static
- A macro that allows to initialize a static using arbitrary code.Tags:
no_std
macro
static
lazy
rustc_builtins
- Current state of the Rust port ofcompiler-rt
. Provides various intrinsics that are required by the compiler.Tags:
no_std
compiler-rt
instrinsics
DEPRECATED in favor of the official
compiler_builtins
crate (see below)xargo
- A drop-in replacement for Cargo that compiles the sysroot for custom targets on the fly.Tags:
cargo
sysroot
core
libcore
liballoc
libcollections
intrusive-collections
- Intrusive (non-allocating) singly/doubly linked lists and red-black trees.Tags:
no_std
intrusive
rbtree
collections
log
- Supports logging inno_std
environments, as long as you define your own logger type.Tags:
no_std
log
cortex-m
- Low level access to Cortex-M processorsTags:
arm
cortex-m
hardware
no_std
register
peripheral
meta-rust
- Yocto layer providing from-source version of the Rust compiler and CargoTags:
build
yocto
meta-rust-bin
- Yocto layer that uses pre-built Rust and Cargo from rust-lang.orgTags:
build
yocto
fixedvec
-Vec
-like interface to a pre-sized buffer of memory. Allows using something likeVec
when doing heapless programming.Tags:
no_std
sysfs-gpio
- A Rust Interface to the Linux sysfs GPIO interfaceTags:
hardware
linux
gpio
i2cdev
- Rust library for interfacing with i2c devices under LinuxTags:
hardware
linux
i2c
spidev
- Rust library providing access to spidev devices under LinuxTags:
hardware
linux
spi
log_buffer
- Rust library for logging into a circular string bufferTags:
no_std
slog
- Supports logging inno_std
environments, as long as you implement your ownDrain
Tags:
log
no_std
teensy3
- Rust interface layer for the Teensy 3.1/3.2 microcontrollerTags:
arm
cortex-m
hardware
no_std
cpuio
. Bare metal (no_std) inb, outb, inw, outw, inl, outw instructions, with a Rust-friendly API.Tags:
no_std
x86
alloc_buddy_simple
. Simple, drop-in replacement allocator for Rust running on bare metal. This intended for small, known-size heaps that contain simple collections, such as lists of USB devices discovered on the bus.Tags:
allocator
no_std
pic8259_simple
. Kernel-space interface to the 8259 and 8259A interrupt controllers.Tags:
no_std
interrupts
volatile_register
- for memory mapped registersTags:
kernel_mode
no_std
registers
spin
- a spinlock MutexTags:
no_std
linked_list_allocator
- basic memory allocationTags:
bare_metal
no_std
allocator
rlibc
- pure Rust implementation of some required C library functions (like memset)Tags:
no_std
intrinsics
NOTE the
compiler_builtins
crate also provides memset (see below)compiler_builtins
- Instrinsics LLVM needsTags:
no_std
intrinsics
x86
. Library to program x86 (amd64) hardware. Contains x86 specific data structure descriptions, data-tables, as well as convenience function to call assembly instructions typically not exposed in higher level languages.Tags:
x86
no_std
prusst
- Rust interface to the PRU subsystem on AM335x processors (BeagleBone & other SBC)Tags:
hardware
linux
pru
beaglebone
m
- A C free / pure Rust mathematical library ("libm") forno_std
codeTags:
no_std
math
float
lm4f120
- A set of drivers for the TI LM4F120.Tags:
bare-metal
drivers
fel-cli
- CLI tools for dealing with Allwinner devices in FEL mode, in pure Rust.Tags:
arm
sunxi
allwiner
fel
alloc-cortex-m
- A heap allocator for Cortex-M processorsTags:
arm
cortex-m
allocator
cortex-m-semihosting
- Semihosting for ARM Cortex-M processorsTags:
cortex-m
arm
semihosting
cortex-m-template
- A Cargo project template for ARM Cortex-M bare metal developmentTags:
arm
cortex-m
Cargo
template
DEPRECATED in favor of
cortex-m-quickstart
(see below)byteorder
- Library for reading/writing numbers in big-endian and little-endian.Tags:
endian
big-endian
little-endian
byte
binary
cortex-m-quickstart
- A template for building applications for ARM Cortex-M microcontrollersTags:
arm
cortex-m
template
cortex-m-rtfm
- Real Time For the Masses (RTFM), a framework for building concurrent applications, for ARM Cortex-M microcontrollersTags:
arm
cortex-m
concurrency
heapless
-static
friendly data structures that don't require dynamic memory allocationTags:
no-heap
static
build-const
- a helper library for computing constants at compile time in build.rs or a script. Also includes no_std macros for importing themTags:
embedded
no_std
build
const
static
defrag
- safe defragmenting memory manager for microcontrollersTags:
no_std
embedded
memory
manager
microcontroller
bridge-rpc
- (in development) a protocol designed to allow a system of different devices, to communicate with each other and issue commands through (optionally) guaranteed unique remote procedural calls. It allows inter-network communication through the concept of "bridges". Both nodes and bridges can be highly resource constrained devices (such as microcontrollers). Intended supported networks include tcp/ip, UART, CAN and ZigBee.aligned
- Statically allocated arrays with guaranteed memory alignmentsCategories:
embedded
memory-management
no-std
Tags:
alignment
aligned
array
cty
- Type aliases to C types like c_int for use with bindgenCategories:
embedded
ffi
no-std
Tags:
bindgen
ffi
c
types
scroll
A suite of powerful, extensible, generic, endian-aware Read/Write traits and contextual conversion traits (Byte serializing and deserializing)Tags:
pread
bytes
endian
pwrite
ssmarshal
- stupid simple (no_std) serde serialzation libraryTags:
no_std
, (TODO)smoltcp
- A TCP/IP stack designed for bare-metal, real-time systems without a heap.Tags:
tcp
network
udp
ethernet
ip
byte
- A low-level, zero-copy, panic-free, binary serializer and deserializer. (parser and encoder)Tags:
no_std
byte
encode
binary
parser
clerk - A hardware agnostic HD44780 LCD controlling library.
Tags:
embedded
driver
stlog
A lightweight logging framework for resource constrained devicesCategories:
embedded
no-std
development-tools::debugging
Keywords:
log
elf
symtab
lcd
- Yet another HD44780/LCD display library (third, at least)! Batteries are not included: all binding to the hardware/GPIO initialization is the responsibility of the user (including the sleep function).Tags:
no_std
embedded
genio
- io::{Read, Write} traits for no_std. It has wrappers for std::io::{Read, Write} to allow use in crates that support std and no_std. Its Read, Write traits have associated type parameters to support custom error types.framed
- Rust crate to send and receive data over lossy streams of bytes.cstr_core
-#[no_std]
port ofstd::ffi::CStr
andstd::ffi::CString
.CString
support is optional, and uses thealloc
crate instead ofstd
.hashmap_core
-#[no_std]
port ofstd::collections::HashMap
andstd::collections::HashSet
. This crate usesalloc
instead ofstd
and uses FNV as the default hash function since SipHash requires a source of random numbers.The text was updated successfully, but these errors were encountered: