dfu-rs / cargo-dfu Goto Github PK
View Code? Open in Web Editor NEWcargo extension for flashing embedded rust programs via dfu based on jacobrosenthals cargo-hf2
License: MIT License
cargo extension for flashing embedded rust programs via dfu based on jacobrosenthals cargo-hf2
License: MIT License
PS C:\cansat\crates\cansat-stm32f4> cargo dfu
Finished dev [unoptimized + debuginfo] target(s) in 2.12s
Searching for a connected device with known vid/pid pair.
Found STMicroelectronics STM32 BOOTLOADER
Flashing "\\\\?\\C:\\cansat\\crates\\cansat-stm32f4\\target\\thumbv7em-none-eabihf\\debug\\cansat-stm32f4"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: File(Os { code: 3, kind: NotFound, message: "The system cannot find the path specified." })', C:\Users\Vixu\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-dfu-0.1.2\src\main.rs:143:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I think it may be because we are using a workspace. Here is the project.
Notice that it tries to find the target
dir in cansat/crates/cansat-stm32f4/
, but it should be just cansat/
. As you can see, I'm calling cargo dfu
from crates/cansat-stm32f4
.
It works fine on my linux machine and the path gets properly resolved to:
/home/wiktor/Cosmo/cansat/target/thumbv7em-none-eabihf/debug/cansat-stm32f4
hello,
as below:
cargo dfu --chip gd32vf103 --example hello
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Searching for a connected gd32vf103.
Found GigaDevice GD32 USB DFU in FS Mode
Flashing "/data/programming/rust/embedded/polos_gd32vf/polos-alef/target/riscv32imac-unknown-none-elf/debug/examples/hello"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Dfu(StatusError(ErrUnknown))', /home/alb/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/cargo-dfu-0.1.1/src/utils.rs:67:37
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I want to flash a bin file like hello.bin, I use:
cargo dfu --bin hello_pb9.bin --chip gd32vf103
error: no bin target named `hello_pb9.bin`
but I use dfu-util is Ok
dfu-util -a 0 -s 0x08000000:leave -D hello_pb9.bin
dfu-util 0.11-dev
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Warning: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release
Opening DFU capable USB device...
Device ID 28e9:0189
Device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(10) = dfuERROR, status(14) = Something went wrong, but the device does not know what it was
Clearing status
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
Found GD32VF103, which reports a bad page size and count for its internal memory.
Fixed layout based on part number: page size 1024, count 128.
Downloading element to address = 0x08000000, size = 8816
Erase [=========================] 100% 8816 bytes
Erase done.
Download [=========================] 100% 8816 bytes
Download done.
File downloaded successfully
Submitting leave request...
Hello ๐
I made the GitHub organization dfu-rs in hope to add more projects related to DFU stuff in Rust.
I don't have a lot of free time but I would be willing to help to do some maintenance on cargo-dfu if you want to help on dfu-core et dfu-libusb.
I propose we move your repository cargo-dfu to the dfu-rs org and I'll give you admin privileges on the organization.
What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.