stm32-usbd icon indicating copy to clipboard operation
stm32-usbd copied to clipboard

Request release

Open David-OConnor opened this issue 1 year ago • 5 comments

So deps can release on Crates.io. Thx! https://github.com/stm32-rs/stm32-usbd/pull/33

David-OConnor avatar Feb 24 '24 03:02 David-OConnor

+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();

tomioe avatar Mar 14 '24 13:03 tomioe

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.

dlaw avatar Mar 29 '24 21:03 dlaw

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?

funbiscuit avatar Apr 24 '24 20:04 funbiscuit

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

David-OConnor avatar May 08 '24 22:05 David-OConnor

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" }

David-OConnor avatar May 08 '24 22:05 David-OConnor

Just stumbled over the same issue, @dlaw's solution here also helped me for the time being.

sunsided avatar Jun 29 '24 19:06 sunsided

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" }

@David-OConnor Make it a pull request! 😬

sunsided avatar Jun 29 '24 19:06 sunsided

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" }

@David-OConnor Make it a pull request! 😬

What do you mean?

David-OConnor avatar Jun 29 '24 23:06 David-OConnor

@David-OConnor Might be easier to get a release here if all it takes is merging the version bump. I'm just hoping.

sunsided avatar Jun 30 '24 00:06 sunsided

It doesn't take any merge - whoever owns the crate just needs to do it by running cargo publish

David-OConnor avatar Jun 30 '24 01:06 David-OConnor