I've been doing a bunch of microcontroller projects over the past few years, on a variety of different microcontrollers. I've primarily been using the Arduino environment to do so, but there are a large number of things that irritate me about Arduino, so I would prefer to move away from Arduino. However, I'm finding it difficult to do so, because Arduino supports many different microcontrollers, and has a wide variety of libraries available for interfacing with various peripherals.
Basically, what I'm looking for is a hardware abstraction layer of some sort. I don't mind delving into registers when I need to, but I'd prefer to have a common way of accessing things like timers, GPIO pins, SPI, and I2C regardless of which microcontroller I'm using.
Some things I'm looking for are:
A couple of possibilities I've looked at:
Are there other contenders I've overlooked? Thanks!
Basically, what I'm looking for is a hardware abstraction layer of some sort. I don't mind delving into registers when I need to, but I'd prefer to have a common way of accessing things like timers, GPIO pins, SPI, and I2C regardless of which microcontroller I'm using.
Some things I'm looking for are:
- Supports multiple architectures and manufacturers. I primarily use ATSAMD microcontrollers, but I'd like to also be able to use ARM Cortex-M microcontrollers from other vendors, and sometimes venture into RISC-V or ESP32.
- Not too bloated. I want to be able to write code that fits on a SAMD11 with 16K of flash, but also scale up.
- Writing code in a statically typed, systems programming language. It doesn't necessarily have to be C/C++, but I'm not looking for a dynamic language like MicroPython or Javascript.
- A good ecosystem, with libraries and examples.
- I don't necessarily object to an RTOS, but I don't need one. Just a single thread with interrupts is fine for me.
- Easy to port to a new board.
A couple of possibilities I've looked at:
- ARM mbed - Close to what I'm looking for. Seems well engineered. Version 5 seems to be moving more in the RTOS direction; I think version 2 was closer to what I was looking for. Downsides: ARM only. Each project uses a large amount (nearly a gigabyte, if I remember correctly) of disk space on the development system. I get the impression that adding support for a new board is not entirely trivial.
- Rust - An interesting language with a number of features I like. Tends to be very verbose, though. Seems to support Cortex-M and RISC-V well, and ESP32 support is in development. Has a large number of libraries for many peripherals, although when I started to actually use them, I discovered they were not necessarily well-tested.
Are there other contenders I've overlooked? Thanks!