Box, Arc, Mutex in Embedded Rust (RTIC)

That specific stm32 is a Cortex-M3 (ARMv7-M), which has tier 2 compiler support "without host tools" (cross-compilation only) and without the standard library.

You can provide your own allocator (or just use an existing one) to use the alloc crate for Box and Arc, and you can use something like spin for a Mutex. As with most things in Rust, it seems, "there's a crate for that" is probably the right answer.

1 Like