Skip to content

Support more families of microcontrollers #2

Closed
@japaric

Description

@japaric

The "Arduino" sub-ecosystem is probably the biggest as it contains several devices from different
architectures. Right now, Rust pretty much only supports, albeit not officially, microcontrollers
based on the ARM Cortex-M processor. This family is big but there are a lot of other widely used
architectures, to name a few:

  • AVR
  • PIC
  • MSP430
  • Xtensa (see ESP8266)

To ease adoption, eventually, most of these architectures should be officially supported by the
compiler. By "oficially", I mean that not only the Rust compiler should be able to generate programs
for the target but there should also be some minimal testing of the target in the rust-lang/rust
repo.

Here's the current state of Rust support for all the architectures listed above (as of 2016-09-28):

(Note that, because rustc is LLVM based, adding support for any of these architectures depends on
LLVM also supporting the architecture.)

  • ARM Cortex-M. Fully supported but not built into rustc. Can be used as a "custom" target by
    creating a JSON file that describes (specifies) the target.
  • AVR. The avr-llvm fork supports this architecture. This fork is in the process of being
    merged back into upstream LLVM.
  • PIC. Some (all?) 32-bit PIC micros are based on the MIPS32 M4K architecture so it may be
    possible to leverage existing LLVM support for the MIPS architecture to create targets for these.
    I think LLVM doesn't support the architecture of 8-bit and 16-bit variants though.
  • MSP430. There is a MSP430 backend in official LLVM. Success building a Rust program for MSP430
    was reported back in 2014 but I haven't seen anyone pushing for or requesting MSP430 support
    recently.
  • Xtensa. No LLVM support AFAIK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feb-2019-cleanupThese issues are proposed to be closed, as part of a cleanup of issues in February 2019microcontrollerupstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions