rtic: My project upgraded to 1.1.0, but compilation fails

My project upgraded to 1.1.0, but compilation fails most likely due to cortex-m-rtic-macros not being updated to 1.1.0 in main Cargo.toml. The root cause seems to be this commit missing (MASKS missing in macros/src/codegen/util.rs).

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Did anyone have a go with the released v1.1.2?

I propose we close this issue, but if there’s something it is easy to reopen 👍

For now we have yanked the 1.1 release until we get it properly fixed.

In case it is useful, here is a recipe to reproduce the issue:

git clone https://github.com/strawlab/strand-braid # currently at d7426dea92dab1d312ab9772fc7c1e8c146370e2
cd strand-braid/camtrig-firmware
cargo check # note that compilation succeeds

# Now, manually change `strand-braid/camtrig-firmware/Cargo.toml` such that
# the `cortex-m-rtic` version is set to "1" and remove the explicit requirement on `cortex-m-rtic-macros`.

cargo update
cargo check # note that compilation fails

The error I currently get is the following:

error: any use of this value will cause an error
  --> src\main.rs:66:1
   |
66 | #[rtic::app(device = stm32f3xx_hal::pac, peripherals = true)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to shift left by `38_u32`, which would overflow
   |
   = note: `#[deny(const_err)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
   = note: this error originates in the attribute macro `rtic::app` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `camtrig-firmware` due to previous error

This is with rustc version 1.60.0 (7737e0b5c 2022-04-04)

We are working on a real fix, in the meantime you can try:

#![allow(const_err)]

As seen the problem occurs only in case an interrupt with a vector index >31 is actually used (causing the over-shift in non-used code). Our tests did not cover this edge case, so it slipped by.

Thanks @Crzyrndm and @mryndzionek for the quick and prompt reporting.

/Per

I will try fixing it tomorrow then. I guess it slipped through the CI since we are testing on a fake device. I never seen this error, could be that the compiler has become more picky. You could try with an older compiler (but then again some other stuff might fail (at least on stable.)

New version coming up shortly (maybe already released).

Please report back so we know if that solved the issue. /Per