mirror of
https://github.com/gnxlxnxx/cargo-dfu.git
synced 2026-07-28 07:43:02 +02:00
Compare commits
10
Commits
8800b22edf
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bded1ebca
|
||
|
|
8a56445e6b
|
||
|
|
aed0c2fb0b | ||
|
|
cf19afbb7f | ||
|
|
8e6556699d | ||
|
|
d7daa0fd3d
|
||
|
|
31e5205683
|
||
|
|
2523cc8503
|
||
|
|
0108a54d8f | ||
|
|
59c74f921e
|
Generated
+13
-5
@@ -72,7 +72,7 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cargo-dfu"
|
name = "cargo-dfu"
|
||||||
version = "0.0.4"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cargo-project",
|
"cargo-project",
|
||||||
"clap",
|
"clap",
|
||||||
@@ -168,20 +168,22 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dfu-core"
|
name = "dfu-core"
|
||||||
version = "0.2.0"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3b82ffc1790e4af9371dbc3399c6c068a3ee506357632e21eb7111df199c59f3"
|
checksum = "6c3fb34e94bedc8bbd76dfc9f6774896fadbbedac6108fa8a3c46a0125bde188"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"displaydoc",
|
"displaydoc",
|
||||||
|
"log",
|
||||||
|
"pretty-hex",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dfu-libusb"
|
name = "dfu-libusb"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7c2092d59a31cc15f8e9a916ff6b020a0fe794b1ec8626d08eefeb7ad2bcb8f7"
|
checksum = "00b4d756e08681e12abb006bbcf557b45c89c189c32e08193cb773b9177f837e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dfu-core",
|
"dfu-core",
|
||||||
"libusb1-sys",
|
"libusb1-sys",
|
||||||
@@ -402,6 +404,12 @@ version = "0.2.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
|
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pretty-hex"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c6fa0831dd7cc608c38a5e323422a0077678fa5744aa2be4ad91c4ece8eec8d5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pretty_env_logger"
|
name = "pretty_env_logger"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
|
|||||||
+5
-5
@@ -1,12 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cargo-dfu"
|
name = "cargo-dfu"
|
||||||
authors = ["Roman Kretschmer <roman@kretschmer.email>"]
|
authors = ["Roman Kretschmer <roman@kretschmer.email>"]
|
||||||
version = "0.0.4"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "cargo extension for flashing embedded rust programs via dfu"
|
description = "cargo extension for flashing embedded rust programs via dfu"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
homepage = "https://github.com/gnxlxnxx/cargo-dfu"
|
homepage = "https://github.com/dfu-rs/cargo-dfu"
|
||||||
repository = "https://github.com/gnxlxnxx/cargo-dfu.git"
|
repository = "https://github.com/dfu-rs/cargo-dfu.git"
|
||||||
categories = ["embedded", "hardware-support"]
|
categories = ["embedded", "hardware-support"]
|
||||||
keywords = ["dfu", "flashing", "embedded"]
|
keywords = ["dfu", "flashing", "embedded"]
|
||||||
readme = "Readme.md"
|
readme = "Readme.md"
|
||||||
@@ -18,8 +18,8 @@ goblin = "0.2.3"
|
|||||||
colored = "2.0.0"
|
colored = "2.0.0"
|
||||||
rusb = "0.9.0"
|
rusb = "0.9.0"
|
||||||
pretty_env_logger = "0.3.0"
|
pretty_env_logger = "0.3.0"
|
||||||
cargo-project = "0.2.4"
|
cargo-project = "0.2.7"
|
||||||
clap = {version = "3.0.10", features=["derive"]}
|
clap = {version = "3.0.10", features=["derive"]}
|
||||||
maplit = "1.0.2"
|
maplit = "1.0.2"
|
||||||
log = "0.4.6"
|
log = "0.4.6"
|
||||||
dfu-libusb = "0.2.0"
|
dfu-libusb = "0.3.0"
|
||||||
|
|||||||
+3
-1
@@ -49,7 +49,9 @@ fn main() {
|
|||||||
.path(
|
.path(
|
||||||
artifact,
|
artifact,
|
||||||
profile,
|
profile,
|
||||||
opt.target.as_deref(),
|
opt.target
|
||||||
|
.as_deref()
|
||||||
|
.map(|target| target.trim_end_matches(".json")),
|
||||||
"x86_64-unknown-linux-gnu",
|
"x86_64-unknown-linux-gnu",
|
||||||
)
|
)
|
||||||
.expect("Couldn't find the build result");
|
.expect("Couldn't find the build result");
|
||||||
|
|||||||
+1
-11
@@ -64,17 +64,7 @@ pub fn flash_bin(binary: &[u8], d: &rusb::Device<GlobalContext>) -> Result<(), U
|
|||||||
)
|
)
|
||||||
.map_err(|e| UtilError::Dfu(e))?;
|
.map_err(|e| UtilError::Dfu(e))?;
|
||||||
|
|
||||||
std::fs::write("target/out.bin", binary).map_err(|e| UtilError::File(e))?;
|
dfu.download_from_slice(binary).unwrap();
|
||||||
dfu.download(
|
|
||||||
&mut std::fs::OpenOptions::new()
|
|
||||||
.read(true)
|
|
||||||
.open("target/out.bin")
|
|
||||||
.map_err(|e| UtilError::File(e))?,
|
|
||||||
std::fs::metadata("target/out.bin")
|
|
||||||
.map_err(|e| UtilError::File(e))?
|
|
||||||
.len() as u32,
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user