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

Request release #35

Open
David-OConnor opened this issue Feb 24, 2024 · 5 comments
Open

Request release #35

David-OConnor opened this issue Feb 24, 2024 · 5 comments

Comments

@David-OConnor
Copy link

David-OConnor commented Feb 24, 2024

So deps can release on Crates.io. Thx! #33

@tomioe
Copy link

tomioe commented Mar 14, 2024

+1

The examples linked in this repo's README to the HAL Examples are no longer compiling, since stm32-usbd on crates.io (v 0.6.0) has an old dependency for usb-device (0.2.X, needs to be bumped as per #33).

For those struggling with getting it to compile, here's what I did:

cd /opt
git clone https://github.com/stm32-rs/stm32f3xx-hal
git clone https://github.com/stm32-rs/stm32-usbd

Modify Cargo.toml in stm32f3xx-hal from stm32-usbd = { version = "0.6.0", optional = true } to stm32-usbd = { version = "0.6.0", optional = true, path="../stm32-usbd" }.

And in your project utilizing stm32f3xx-hal, modify Cargo.toml to e.g. stm32f3xx-hal = { version = "0.10.0", features = ["stm32f303xc", "usb", "rt" ], path="/opt/stm32f3xx-hal/Cargo.toml" }

Since usb-device changed the way it builds as per v0.3.0, you also need to change your code to:

use usb_device::LangID;
use usb_device::device::StringDescriptors;

let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x1234, 0x1234))
        .strings(&[StringDescriptors::default()
            .manufacturer("Test")
            .product("Test")
            .serial_number("Test")])
        .unwrap()
        .self_powered(false)
        .max_power(250)
        .unwrap()
        .build();

@dlaw
Copy link

dlaw commented Mar 29, 2024

I am successfully using this version of stm32-usbd on real hardware (STM32G473CCT6) with the following Cargo.toml override:

[patch.crates-io]
stm32-usbd = { git = "https://github.com/stm32-rs/stm32-usbd.git" }

as well as the change to use StringDescriptors as described by tomioe.

@funbiscuit
Copy link

I confirm current version from master is working properly on blue pill (STM32F103C8T6) with changes from comments above. Tested as virtual com port. Should we expect new version released any time soon?

@David-OConnor
Copy link
Author

What's the word? Should I fork and release this as a new crate?

@David-OConnor
Copy link
Author

I published a fork; same as current master, but on crates.io. This allows you to use it as a dependency of a different released crate. https://crates.io/crates/stm32-usbd2

stm32-usbd = { package = "stm32-usbd2", version = "^0.7.0" }

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

4 participants