The embedded-hal reference implementation

I've written, I guess, four HALs now. I wrote a sizable portion of the STM32L4x6 crate, wrote two for the STM32L0x1 (one "conventional" one "experimental", since combined), and I've gotten a decent start on the LPC177x/8x crate. Because I've joined in an existing effort and also started my own I'm feeling pretty experienced now. :slight_smile:

When starting to add features, the very first place I look is existing implementations as close to my target as I can get. In some cases I've even copied-and-pasted existing code wholesale and tweaked until it worked. Even if the specifics of a chip don't line up, understanding what the embedded-hal traits look like in a concrete way can be a real boon for new implementors.

I am strongly in favor of having blessed reference crate that shows off the latest and best thinking in terms of design of a HAL. Having written crates that consume the HALs at a higher level (board support crates, not yet published), I've got some ideas about how to move a reference implementation forward.

The stm32f30x HAL is identified in the embedded-hal docs as being "the reference implementation", and it's got Jorge's name on it, which carries a lot of weight. Should that remain the case? Should the embedded WG "own" a HAL crate and "bless" it? I'd like to have something reliable against which to submit PRs to show my latest thinking about design and to gather input, but it's hard to have confidence it'll get attention and discussion.

2 Likes

The best way would probably be to use the HAL of a platform that has easily available and inexpensive development boards, so e.g. the blue pill. I agree that it should be moved to a shared organization for it to become a "blessed reference crate".

By the way, there is some more discussion on HAL/PAC creates, naming and organization over at Handling of device / peripheral access crates.