-
Notifications
You must be signed in to change notification settings - Fork 651
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
Tracking: Refactor nrf52 boards organization #1839
Comments
|
Well, I always thought it was a little weird that the acd52832 wasn't in that folder (I realize that the board isn't made by nordic, just the chip, but still..), and also that we only do it for nordic boards but not, say, stm boards. But we could certainly still keep the folder.
It wouldn't be once all the steps are done. I was trying to express that initially we should componentize everything in |
I always found it weird that Nordic boards were the only ones grouped together. I think we should either have a flat folder containing all the boards, or have a folder for each manufacturer (even if most manufacturers have only one board in them). Otherwise a mix of "categorized" boards (within |
1853: Components for all things nrf52 r=bradjc a=hudson-ayers ### Pull Request Overview This pull request creates components for all portions of nrf52dk-specific initialization that does not already rely on components. Specifically: - Converts Imix-specific analog comparator component into generic analog comparator component, uses it for Imix and nrf52* - Converts Imix-specific nonvolatile storage component into generic component, uses it for Imix and nrf52dk (required some HIL changes!) - Converts si7021 specific temperature sensor component into generic temperature sensor component, uses it for Imix, nrf52*, and Hail. - Creates a component for standalone initialization of the mx25r6435f flash chip used on the nrf52840dk - Creates NrfStartupComponent and NrfClockComponent, to store repeated initialization code in functions that can be reused. - Uses the existing SPI compnents to initialize SPI for the nrf52* boards. This PR is the first step towards addressing #1839 . ### Testing Strategy This pull request was tested by running the in-kernel log_test on Imix, running the nonvolatile_storage test on Imix, running the analog_comparator test on Imix, and running the analog_comparator and nonvolatile_storage tests on the nrf52840dk. ### TODO or Help Wanted I am not sure if adding a `configure()` function to the flash HIL was the correct call given that only the sam4l flash controller requires it. ### Documentation Updated - [x] No updates are required? ### Formatting - [x] Ran `make formatall`. Co-authored-by: Hudson Ayers <hayers@stanford.edu>
I don't think we should have a policy/preference around this. Using folders seems like it could be good in some cases. Flat list is also useful. But moving code around often leads to annoying git blames, so I prefer to avoid it unless it is really necessary. |
I do think we should have some policy around this. The blame issue is less bad if you've aliased it to always set I think it's confusing as it's sort of ad-hoc. Are they grouped by nordic because they use nordic chips (then why isn't I think we should decide on some policy and pay the rename cost once en masse. |
For longer term grouping I think it makes sense to try and group boards by either:
Both 1 and 2 work better with some boards then they do with others. 3 could have redundancies especially for vendor tools like flash scripts. |
I think there can be a lot of ways to group things, and different approaches might make sense in different cases. For the nordic created boards, the maintainers of those boards thought grouping them made sense, so we grouped them. Grouping the STM boards might also make sense. We might want to group by project (say "signpost" for example). Or by board family. Or board type if there are multiple revisions (say "telos" for example). Who knows. |
The problem is that it can become confusing for new users to find what boards Tock supports |
I'm more worried about new users being confused in navigating the code than by git blame being less friendly. Browsing the source directories is a much more common use case than doing a git blame, and for the latter use case @ppannuto mentioned the I think it's important to make things easy for newcomers ; people who are already more familiar with the code can afford to add a Likewise, I don't think that
|
I'm not worried about a slippery slope here. We clearly want to use components, and we don't like features. There isn't much ambiguity there. My opinion on the way to make this more friendly is tooling and documentation. A strong README is much more important than
What about the other reasons folders might be useful? If we had, say, 100 supported boards, would we really not want to be able to group them? |
The discussion in #1784 seems to have arrived at the conclusion that the organization of the nordic boards no longer makes sense, now that we have components and support multiple non-development-kit nordic boards.
The desired result is to refactor the nordic boards such that each board has its own folder (like how all other boards are handled), and use components for all initialization to minimize the repeated code between board files.
Below are a series of largely independent steps that would get us to that result:
nrf52dk_base/src/nrf52_components/
into top level ofboards
nrf52dk_base/src/lib.rs::setup_board()
(activate reset button, make flash writable, enable nfc pin protection, configure voltage regulator, start rtc, etc.) (Components for all things nrf52 #1853)nrf52dk_base/src/lib.rs
imix_components/analog_compartor.rs
to be usable for initialization across different chips and move the result to the general components folder (Components for all things nrf52 #1853)nonvolatile_storage
initialization (Components for all things nrf52 #1853 )mx25r6435f
component (Components for all things nrf52 #1853)nrf52dk_base/src/lib.rs
to use SPI component (Components for all things nrf52 #1853 )Once those steps are done..
nrf52dk
,nrf52840dk
, andnrf52840_dongle
in the top level ofboards/
, each with its ownmain.rs
that copies in the completely-componentizedsetup_board()
currently shared by those three boards. Deleteboards/nordic/
(Run OpenTitan tests in the CI #1859)The text was updated successfully, but these errors were encountered: