8 Commits
Author SHA1 Message Date
gnxlxnxx 1bded1ebca Bump up version to 0.1.2 2022-10-25 23:45:06 +02:00
gnxlxnxx 8a56445e6b Bump dfu-libusb version to 0.3.0
this fixes #7
2022-10-25 23:44:29 +02:00
gnxlxnxxandGitHub aed0c2fb0b Merge pull request #6 from tversteeg/custom-target
Support custom target files
2022-04-05 09:48:40 +02:00
Thomas Versteeg cf19afbb7f Support custom target files 2022-04-04 17:28:21 +02:00
gnxlxnxxandGitHub 8e6556699d Merge pull request #5 from gnxlxnxx/main
use `download_from_slice` function
2022-02-26 13:55:23 +01:00
gnxlxnxx d7daa0fd3d Bump up Version to 0.1.1 2022-02-26 13:40:35 +01:00
gnxlxnxx 31e5205683 Update cargo-project 2022-02-26 13:39:47 +01:00
gnxlxnxx 2523cc8503 use download_from_slice function
this closes #4
2022-02-26 13:37:49 +01:00
4 changed files with 20 additions and 20 deletions
Generated
+13 -5
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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(())
}