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

trait core::marker::Copy is not implemented for Interrupt #12

Open
pdgilbert opened this issue Oct 6, 2021 · 4 comments
Open

trait core::marker::Copy is not implemented for Interrupt #12

pdgilbert opened this issue Oct 6, 2021 · 4 comments

Comments

@pdgilbert
Copy link

With recent changes in rtic examples using stm32lxx_hal are now giving

Compiling rust-integration-testing-of-examples v0.1.0 (/home/paul/githubClones/rust-integration-testing/dev-testing)
error[E0277]: the trait bound `Interrupt: core::marker::Copy` is not satisfied
  --> examples/driver-examples/iaq-core-c-gas-voc-usart-logger.rs:41:48
   |
41 | #[cfg_attr(feature = "stm32l1xx", app(device = stm32l1xx_hal::stm32, dispatchers = [TIM2, TIM3]))] 
   |                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `core::marker::Copy` is not implemented for `Interrupt`
   | 
  ::: /home/paul/.cargo/git/checkouts/cortex-m-rtic-da08f71f062e5e7b/ca9088a/src/lib.rs:54:8
   |
54 |     I: InterruptNumber,
   |        --------------- required by this bound in `pend`
   |
   = note: required because of the requirements on the impl of `InterruptNumber` for `Interrupt`
@adamgreig
Copy link
Member

Huh, this is potentially a bit troublesome for a lot of crates. What versions of stm32l1, stm32l1xx_hal, cortex-m, and cortex-m-rtic are in use (try cargo tree)? It's weird because stm32l1's Interrupt definitely impls Copy for both 0.13.0 and 0.14.0.

@pdgilbert
Copy link
Author

I'm using recent git versions. My Cargo.lock has

[[package]]
name = "stm32l1"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edda4346740d0f01082c353dca33b320e84f9fb51765fdcac7a624017c5a8ff4"
dependencies = [
 "bare-metal 0.2.5",
 "cortex-m 0.5.11",
 "cortex-m-rt",
 "vcell",
]

[[package]]
name = "stm32l1xx-hal"
version = "0.1.0"
source = "git+https://github.com/stm32-rs/stm32l1xx-hal#b5bfb4ff069889233baf5bfda75eea4cbb5ce5f8"
dependencies = [
 "bare-metal 0.2.5",
 "cast",
 "cortex-m 0.5.11",
 "embedded-hal 0.2.6",
 "nb 0.1.3",
 "stm32l1",
 "void",
]

stm32l1 version = "0.5.0" seems to be specified in https://github.com/stm32-rs/stm32l1xx-hal/blob/master/Cargo.toml#L23-26. Could that be the problem?

@adamgreig
Copy link
Member

Ah, wow, 0.5 is pretty old. It was released in Dec 2018, but the PR that caused svd2rust to mark the interrupts as Copy (rust-embedded/svd2rust#274) wasn't until Jan 2019, so wouldn't be included. That is most likely the source of the problem, combined with new RTIC using the new InterruptNumber trait from cortex-m 0.7, which is what requires Interrupt to be Copy. The best bet is probably to update the stm32l1 version here...

@pdgilbert
Copy link
Author

Ok. I'll look forward to testing when things are updated.

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

2 participants