stm32-usbd
stm32-usbd copied to clipboard
Request release
So deps can release on Crates.io. Thx! https://github.com/stm32-rs/stm32-usbd/pull/33
+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();
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.
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?
What's the word? Should I fork and release this as a new crate?
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" }
Just stumbled over the same issue, @dlaw's solution here also helped me for the time being.
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! 😬
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 Might be easier to get a release here if all it takes is merging the version bump. I'm just hoping.
It doesn't take any merge - whoever owns the crate just needs to do it by running cargo publish