mirror of
https://github.com/gnxlxnxx/cargo-dfu.git
synced 2026-07-27 15:23:02 +02:00
Compare commits
9
Commits
59c74f921e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bded1ebca
|
||
|
|
8a56445e6b
|
||
|
|
aed0c2fb0b | ||
|
|
cf19afbb7f | ||
|
|
8e6556699d | ||
|
|
d7daa0fd3d
|
||
|
|
31e5205683
|
||
|
|
2523cc8503
|
||
|
|
0108a54d8f |
Generated
+13
-5
@@ -72,7 +72,7 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
|
||||
|
||||
[[package]]
|
||||
name = "cargo-dfu"
|
||||
version = "0.0.4"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"cargo-project",
|
||||
"clap",
|
||||
@@ -168,20 +168,22 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dfu-core"
|
||||
version = "0.2.0"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3b82ffc1790e4af9371dbc3399c6c068a3ee506357632e21eb7111df199c59f3"
|
||||
checksum = "6c3fb34e94bedc8bbd76dfc9f6774896fadbbedac6108fa8a3c46a0125bde188"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"displaydoc",
|
||||
"log",
|
||||
"pretty-hex",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dfu-libusb"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c2092d59a31cc15f8e9a916ff6b020a0fe794b1ec8626d08eefeb7ad2bcb8f7"
|
||||
checksum = "00b4d756e08681e12abb006bbcf557b45c89c189c32e08193cb773b9177f837e"
|
||||
dependencies = [
|
||||
"dfu-core",
|
||||
"libusb1-sys",
|
||||
@@ -402,6 +404,12 @@ version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
|
||||
|
||||
[[package]]
|
||||
name = "pretty-hex"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c6fa0831dd7cc608c38a5e323422a0077678fa5744aa2be4ad91c4ece8eec8d5"
|
||||
|
||||
[[package]]
|
||||
name = "pretty_env_logger"
|
||||
version = "0.3.1"
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "cargo-dfu"
|
||||
authors = ["Roman Kretschmer <roman@kretschmer.email>"]
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
edition = "2021"
|
||||
description = "cargo extension for flashing embedded rust programs via dfu"
|
||||
license = "MIT"
|
||||
@@ -18,8 +18,8 @@ goblin = "0.2.3"
|
||||
colored = "2.0.0"
|
||||
rusb = "0.9.0"
|
||||
pretty_env_logger = "0.3.0"
|
||||
cargo-project = "0.2.4"
|
||||
cargo-project = "0.2.7"
|
||||
clap = {version = "3.0.10", features=["derive"]}
|
||||
maplit = "1.0.2"
|
||||
log = "0.4.6"
|
||||
dfu-libusb = "0.2.0"
|
||||
dfu-libusb = "0.3.0"
|
||||
|
||||
+3
-1
@@ -49,7 +49,9 @@ fn main() {
|
||||
.path(
|
||||
artifact,
|
||||
profile,
|
||||
opt.target.as_deref(),
|
||||
opt.target
|
||||
.as_deref()
|
||||
.map(|target| target.trim_end_matches(".json")),
|
||||
"x86_64-unknown-linux-gnu",
|
||||
)
|
||||
.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))?;
|
||||
|
||||
std::fs::write("target/out.bin", binary).map_err(|e| UtilError::File(e))?;
|
||||
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();
|
||||
dfu.download_from_slice(binary).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user