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

Mutually incompatible BSP features lead to testing difficulties #704

Open
ianrrees opened this issue Nov 22, 2023 · 1 comment
Open

Mutually incompatible BSP features lead to testing difficulties #704

ianrrees opened this issue Nov 22, 2023 · 1 comment
Labels
board support Related to support for a particular board

Comments

@ianrrees
Copy link
Contributor

Our Feather M0 BSP has features for some specific variants of the board, for instance the rfm feature for "RadioFruits", adalogger if the SD card shield is added, express for Feather M0 Express. These variants use the same ATSAMD21 microcontroller, but have different wiring.

Currently, we gate some of the provided BSP pins like this:

#[cfg(all(feature = "adalogger", not(feature = "rfm"), not(feature = "express")))]
PA21 {
    /// SD card detect
    name: sd_cd
    aliases: {
        PullUpInput: SdCd
    }
},

In particular when updating the HAL, it can be helpful to build all the examples for BSPs by doing cargo build --all-features --examples, however this fails when one of the examples uses the SdCd defined above. For most of our BSPs, this same approach is taken by CI, but currently we don't have an automated check that covers all the Feather M0 BSP examples.

Possible approaches to address this:

  1. Separate the Feather M0 BSP in to separate BSPs for the variants
  2. Extend the CI approach to build the mutually-incompatible variants separately
  3. Instead of feature-gating pins, feature-gate aliases

Bonus points: extend CI to check that each example gets built

@ianrrees ianrrees changed the title BSP features that are mutually incompatible, leads to testing difficulties Mutually incompatible BSP features lead to testing difficulties Nov 22, 2023
@ianrrees
Copy link
Contributor Author

Looking at this with a fresh set of eyes, I'm leaning toward approach 1 above. Cargo features just don't seem like a good way to express hardware variations, since they are purely additive. We've used the features like this to make it easier to support a wide variety of hardware, but even with this usage the current model is quite labour intensive.

So, rather than bending the CI process to support this use of features, I think that we'd be better off putting effort in to some other solution to make BSP maintenance easier.

@ianrrees ianrrees added the board support Related to support for a particular board label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board support Related to support for a particular board
Projects
None yet
Development

No branches or pull requests

1 participant