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

how does "usb_fs" and "usb_hs" work together? #690

Open
xzzWZY opened this issue Nov 3, 2023 · 2 comments
Open

how does "usb_fs" and "usb_hs" work together? #690

xzzWZY opened this issue Nov 3, 2023 · 2 comments

Comments

@xzzWZY
Copy link

xzzWZY commented Nov 3, 2023

in Cargo.toml, I try to include both "usb_fs" and "usb_hs" like

stm32f4xx-hal = { version = "0.17.1", features = [
  "stm32f405",
  "rtic",
  "rtic-monotonic",
  "usb_fs",
  "usb_hs",
  "synopsys-usb-otg",
  "i2s",
  "sdio-host",
] }

but there's error saying

error[E0252]: the name `OTG_GLOBAL` is defined multiple times
  --> {...}/synopsys-usb-otg-0.3.2/src/ral/mod.rs:18:13
   |
16 |     pub use super::stm32f429::otg_fs_global::OTG_FS_GLOBAL as OTG_GLOBAL;
   |             ------------------------------------------------------------ previous import of the module `OTG_GLOBAL` here
17 |     #[cfg(feature = "hs")]
18 |     pub use super::stm32f429::otg_hs_global::OTG_HS_GLOBAL as OTG_GLOBAL;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `OTG_GLOBAL` reimported here
   |
   = note: `OTG_GLOBAL` must be defined only once in the type namespace of this module

what may cause this issue? how to use both 'usb_fs' and 'usb_hs' together?

@paulyoung
Copy link

[features]
fs = ["stm32f4xx-hal/usb_fs"]
hs = ["stm32f4xx-hal/usb_hs"]

[dependencies]
stm32f4xx-hal = { version = "0.17.1", features = [
  "stm32f405",
  "rtic",
  "rtic-monotonic",
  "synopsys-usb-otg",
  "i2s",
  "sdio-host",
] }

Then build with --features fs or --features hs

@paulyoung
Copy link

Unless you mean this? stm32-rs/synopsys-usb-otg#12

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