-
Notifications
You must be signed in to change notification settings - Fork 226
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
scaling out #623
Comments
For context, I came into There are two main technical things I ran into trying to add 0/1/2-series support to First, the two MCU crates ( For example, if you look at https://github.com/Rahix/avr-hal/tree/main/mcu/attiny-hal/src, there is no way to quickly tell which peripherals are implemented for a given MCU, and adding a new MCU means adding it to every file in there. My proposed solution to this is to reorganize the MCU crates into two layers:
I started working on this in my fork; the relevant diff is at main...innermatrix:avr-hal:attiny-hal-additive-features. The benefits of this approach include: support for a new MCU is self-contained (one MCU-specific files + adding some global bits like a feature flag and a top-level There is a lot of additional restructuring that I can envision doing in the future (for example, it's not clear to me that having the ATtiny vs ATmega separation makes sense in today's world where ATtiny Second, there is no support for unit testing right now. This makes it easy for someone to break one MCU while fixing another, without noticing. My proposed solution to this is to make two changes; one easy, one hard. The easy change is to require all doctests to compile. I started working on this and the relevant diff is in innermatrix/avr-hal@attiny-hal-additive-features...innermatrix:avr-hal:attiny-fix-doctests. This alone would substantially increase the confidence of a new contributor that their changes will not catastrophically break existing MCU support. The hard change is to start running unit tests on actual hardware. (I did consider qemu as an alternative, but its support for GPIO is fairly limited from what I can tell, which means that it's not a particularly useful test environment for IO peripherals.) I am currently researching related prior art, such as In summary, I think the following two changes would be essential for scaling out the project:
I think those are important because they are foundational and have long-term impact on scaling out; there are obviously many other improvements we can (and should) make (such as better documentation, API revisions, etc), all of which I would welcome. And I know I said this before, but it never gets said enough so I will say it again: much gratitude to the current maintainers and contributors, love everything you've done so far! |
I'd also like to introduce myself as someone that has been wanting to use Rust on AVR boards for a long time but patiently waiting for the support to mature. I echo the words above and would like to praise @Rahix and others that have put a lot of work in over the years to get to this point. The increase in interest (at least in my case) is directly related to the significant efforts this year to improve the LLVM codegen (also huge thanks to @Patryk27, @benshi001, and previous llvm-avr maintainers). I also have 20+ years of systems programming experience and am trying to return to the embedded space from a hobbyist perspective. My primary interest and motivation to contribute is to enable async Rust for some AVR (arduino uno) boards in some robotics kits. The embassy project appears to be leading in this space and I'd like to help build out AVR support. Toward that end the first missing piece is an embassy-time-driver implementation that requires adding some I also share an interest in seeing AVR support continue to mature into upstream As a new contributor one significant maintenance hurdle is the lack of testing infrastructure. For example in #618 and #621 I'd like some automation to ensure I'm also in agreement with @innermatrix re-org proposal above (still need to review #605). A recurring theme in the backlog of issues and open PRs is that there is a need to reduce the maintenance burden and evolve to support newer devices. I'm still learning Thanks again to the AVR-Rust community. |
There sorta is, https://github.com/Patryk27/avr-tester - I've been recently busy on something totally unrelated, but I'm hoping to implement more features in avr-tester in the near future. I'd also like to mention that the nearest milestone is getting AVR to tier 2, rust-lang/rust#131651; small steps forward! |
@Patryk27 Oooh, good to know! Poking around it, I see that To be clear, I am not at all opposed to testing with |
This one does seem to be implemented (https://github.com/buserror/simavr/blob/ae75edec3f4068f3d1a6c30130abef7ef8e83155/simavr/cores/avr/iotn88.h#L1) - I haven't been playing with simavr directly (besides implementing the support in avr-tester), so I'm not sure how much effort it'd take to implement more stuff there, though. |
@Patryk27 Those look like declarations derived from upstream AVR sources; wouldn't there need to be something related to tiny88 in https://github.com/buserror/simavr/tree/ae75edec3f4068f3d1a6c30130abef7ef8e83155/simavr/cores ? (Could be I just don't quite understand how this code is structured.) Anyway, I don't want to derail the main thread for this tangent. |
Huh, I'd say so as well! |
<preamble>
this issue concernsavr-hal
on the long run</preamble>
Pattern I think that I see is that the rust
avr-hal
project is getting more popular plus less involvement from Rahix.I fully agree with Rahix on Hey, it works for me and I will be the last one blaming Rahix for less involvement.
Thing that I would like to see is that this cool project scales out further.
That I choose issue instead of discussion is because I want to solve the issue of scaling out, not just discuss it.
What are your opinions on this issue?
The text was updated successfully, but these errors were encountered: