Skip to content

Conversation

hudson-ayers
Copy link
Contributor

@hudson-ayers hudson-ayers commented Dec 28, 2020

Pull Request Overview

This pull request updates the rust nightly version to 2020-12-28. This was motivated by the stabilization of min_const_generics ( rust-lang/rust#79135 ) -- by using this nightly, we will be able to use const generics in Tock without adding an unstable feature.

Testing Strategy

compiling

TODO or Help Wanted

N/A

Documentation Updated

  • Updated the relevant files in /docs.

Formatting

  • Ran make prepush.

@hudson-ayers
Copy link
Contributor Author

hudson-ayers commented Dec 28, 2020

It looks like a lot of what we are doing with inline assembly in naked functions now generates warnings. I didn't realize, I'm gonna mark this as draft until I have fixes.

One particularly thorny issue is that it is illegal to use anything other than a single asm!() block in any naked function. But we pretty extensively mix rust code and insline asm in several functions like hard_fault_handler_arm_v7m() which are marked #[naked]. The reason this generates a warning, I believe, is because rust code relies on the compiler generated prologue in order to correctly use stack-allocated variables, but #[naked] prevents generation of that prologue.

@hudson-ayers hudson-ayers marked this pull request as draft December 28, 2020 18:29
@hudson-ayers
Copy link
Contributor Author

hudson-ayers commented Dec 30, 2020

This is blocked on merging #2317 , #2318, and #2319. With the commits from those PRs added, CI passes.

@hudson-ayers hudson-ayers added the blocked Waiting on something, like a different PR or a dependency. label Dec 31, 2020
@hudson-ayers hudson-ayers marked this pull request as ready for review December 31, 2020 20:10
bors bot added a commit that referenced this pull request Jan 5, 2021
2311: Board based instantiation of chip drivers and interrupt mappings: imxrt10xx r=bradjc a=mciantyre

### Pull Request Overview

The PR refactors the `imxrt10xx` chip and boards to support board-based initialization (first proposed in #2069). It builds on the work of #1918 and #2200, where we noted the effort as a TODO. After this PR, you may instantiate and configure i.MX RT peripherals in a board, or use the default peripherals provided by the chip.

Most peripherals were easily transitioned to the new API. The exception was the GPIO driver, which referenced `static` GPIO ports and pins throughout the code. I may have found some issues in the driver, so I took the refactoring opportunity to update the implementation, trying to follow [this suggestion](https://github.com/tock/tock/blob/master/chips/stm32f4xx/src/gpio.rs#L595). I'll leave more details in review comments.

Other changes include

- fix a GPT clock gating bug introduced in #2200
- move UART root clock initialization out of the `configure()` method, and into CCM peripheral setup

### Testing Strategy

Tested `boards/teensy40` on a Teensy 4.0 using the tests from #2200.

`boards/imxrt1050-evkb` continues to compile, but I don't have the hardware to test examples.

### TODO or Help Wanted

Looking for feedback on the refactor. Let me know if it deviates too much from the other chips.

Holding as draft to

- [x] ~~wait for #2310, since the new GPIO driver needs `min_const_generics`~~ accepting as-is, and we'll remove the feature later
- [x] figure out a way to remove the remaining `static` peripheral in `iomuxc_snvs`
- [x] remove `std` dependency in new unit tests, avoiding the conditional `no_std` in the crate
- [x] leave thoughts on GPIO changes
- [x] clean up commit messages

### Documentation Updated

- [x] ~~Updated the relevant files in `/docs`, or~~ no updates are required.

### Formatting

- [x] Ran `make prepush`.


Co-authored-by: Ian McIntyre <ianpmcintyre@gmail.com>
@hudson-ayers
Copy link
Contributor Author

closed in favor of #2334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting on something, like a different PR or a dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant