Re:MicroZig: Unified abstraction layer and HAL for Zig on se...
by mikepurvis on Wednesday February 28, 2024 @02:57PM
(#39542726)
I'm interested in this too, though I've had mixed experiences in the past using third party HALs for microcontrollers only to discover that they have gaps in API coverage or can only expose the most common use-cases. There was always lot of examples and documentation for the "easy" stuff like GPIOs, timers, ADCs, serial port, etc, but once you got into USB, Ethernet, or RTOS integration then things rapidly got much scarier.
Re:MicroZig: Unified abstraction layer and HAL for Zig on se...
by wredue on Wednesday February 28, 2024 @01:50PM
(#39542108)
I just recently switched off stable to 0.12 and I honestly didn’t run in to too much in the way of changes. It is a bit unusual for zig projects currently BUT zig changes are slowing.
Additionally, Andrew himself has stated he wants 0.12 to be a version where zig devs should feel comfortable pinning to stable. I know stable now is 0.11, but the changes are not egregious at the moment. Not sure if that’s still the deal.
Re:MicroZig: Unified abstraction layer and HAL for Zig on se...
by tredre3 on Wednesday February 28, 2024 @06:08PM
(#39544692)
Arduino is C++, not C! Of course that changes nothing to what you said :) .
Re:MicroZig: Unified abstraction layer and HAL for Zig on se...
by zamalek on Wednesday February 28, 2024 @07:54PM
(#39545409)
> Support for RP2040 is good,
I've done a fair bit of stuff with embedded Rust and the main reason for this is manufacturer documentation. The RP2040 is really in its own tier of documentation quality, nothing comes close. Other chipsets are so bad that the Rust SVD codegen has a way for maintainers to fix errata.
I've concluded that I'm only going to use RP2040s going forward.
However, the project is still not very mature. They just refactored into the repo you see since I started using it. Support for RP2040 is good, but the HAL for other microcontrollers seems less supported. (And it seems to be written in such a way that code isn’t shared between HALs for different microcontrollers.) It’s targeting stable Zig (instead of HEAD), which is an unusual choice for Zig projects, since Zig is also in an immature state and updates rapidly. There’s zero documentation except for the source, but that’s par for Zig projects.
Zig has the potential to be huge for embedded, once these APIs are fleshed out and stabilize. It’s already more enjoyable than writing C.