Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions re: STM32 from a Rust Embedded dev #179

Open
jamesmunns opened this issue Feb 28, 2024 · 4 comments
Open

Suggestions re: STM32 from a Rust Embedded dev #179

jamesmunns opened this issue Feb 28, 2024 · 4 comments

Comments

@jamesmunns
Copy link

jamesmunns commented Feb 28, 2024

Hey! Chiming in as someone doing embedded Rust things:

Just wanted to share particularly with respect to STM32 chips, which have an insane number of variants, SVD files that are often wrong, and a lot of challenging details, it might be worth looking at https://github.com/embassy-rs/stm32-data, which https://embassy.rs uses for the unified stm32 HAL. It is typically more actively patched and maintained for correctness than the upstream STM32 SVD data sources.

In general, SVD files often require patching and continued maintenance, https://github.com/embassy-rs/chiptool might be a good inspiration, which uses YAML files to apply patches and groupings, rather than hand-editing SVD files.

Feel free to close, or let me know if y'all would like to share notes on anything. Excited to see what you all build!

(edited title to make it more clear this is just my opinion, not like an "offical embedded rust position")

@jamesmunns jamesmunns changed the title Suggestions from Rust Embedded re: STM32 Suggestions re: STM32 from a Rust Embedded dev Feb 28, 2024
@mattnite
Copy link
Contributor

Hey James! Thanks for pointing this out. I was planning on adding support for the yaml patches that svd2rust/chiptool uses to our code generation tool, but didn't realize there was a common place to maintain them.

We've got some major changes on the horizon but looking forward to working with embedded Rust folks in the future!

@jamesmunns
Copy link
Author

AFAIK, stm32 is the only familiy big and active enough to merit centralized info like this. IIRC, some data was also pulled from stm's cubemx databases, and other sources, tho that might just be through yaml updates.

Other popular families generally have a good enough "quality + quantity" factor that occasional SVD patches are done in-repo.

Feel free to come hang out in the Matrix Room, esp if you want any opinions before trying out certain tools or approaches.

@kuon
Copy link
Contributor

kuon commented Feb 29, 2024

I use the stm32l0x1 serie, and I wrote a small library for my own use. It is very minimal at the moment, but it might be of some interest.

Feel free to copy/integrate whatever you feel is useful.

https://github.com/kuon/stm32l0x1-zig

@ikskuh
Copy link
Contributor

ikskuh commented Feb 29, 2024

Hey! Chiming in as someone doing embedded Rust things:

Heya! Thanks for the hints. Definitly better to use and contribute to an already existing community-maintained thing than make it our own.

We've got some major changes on the horizon but looking forward to working with embedded Rust folks in the future!

Absolutely! Rust and Zig together will probably make a really great experience for embedded development. Drivers in Zig, application logic in Rust should yield a pretty damn solid foundation for a new generation of devices 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants