Code Monkey home page Code Monkey logo

gd32-dfu-utils's Introduction

Dfu-util - Device Firmware Upgrade Utilities

Dfu-util is the host side implementation of the DFU 1.0 [1] and DFU 1.1 [2]
specification of the USB forum.

DFU is intended to download and upload firmware to devices connected over
USB. It ranges from small devices like micro-controller boards up to mobile
phones. With dfu-util you are able to download firmware to your device or
upload firmware from it.

dfu-util has been tested with Openmoko Neo1973 and Freerunner and many
other devices.

[1] DFU 1.0 spec: http://www.usb.org/developers/devclass_docs/usbdfu10.pdf
[2] DFU 1.1 spec: http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

The official website is:

  http://dfu-util.sourceforge.net

See the INSTALL file for build instructions.

gd32-dfu-utils's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gd32-dfu-utils's Issues

dfu-util: Error during download get_status with Longan Nano

I compiled the project on both macOS and ArchLinux, but could not flash successfully. The device could be discovered successfully. However, I am getting error on get_status after downloading consistently.

dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 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: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 28e9:0189
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
GD32 flash memory access detected
Device model: GD32VF103CB
Memory segment (0x08000000 - 0801ffff)(rew)
Erase size 1024, page count 128
Downloading to address = 0x08000000, size = 6584
Download	[=========================] 100%         6584 bytes
Download done.
File downloaded successfully
dfu-util: Error during download get_status

Poll timeout

Helllo, my working environment is debian 10, the chip used is "GD32VF103C8T6",when I run sudo dfu-util -d 2e80:0189 -a 0 -D gd32vf_gpio.bin -s 0x08000000:leave -v , the following problems occur, how can I solve it.

dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 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: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 28e9:0189
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
GD32 flash memory access detected
Device model: GD32VF103C8
Memory segment (0x08000000 - 0800ffff)(rew)
Erase size 1024, page count 64
Downloading to address = 0x08000000, size = 2120
Download	[                         ]   0%            0 bytes   Poll timeout 100 ms
   Poll timeout 0 ms
   Poll timeout 100 ms
   Poll timeout 0 ms
 Download from image offset 00000000 to memory 08000000-080007ff, size 2048
   Poll timeout 104 ms
   Poll timeout 0 ms
   Poll timeout 100 ms
   Poll timeout 0 ms
 Download from image offset 00000800 to memory 08000800-08000847, size 72
   Poll timeout 104 ms
   Poll timeout 0 ms
File downloaded successfully
   Poll timeout 104 ms
   Poll timeout 0 ms
Transitioning to dfuMANIFEST state

proper history would be appreciated

In the spirit of the open source world, it would be much appreciated if instead of having an "import sources" commit with some changes on top, this would actually be a branch on top of the original code with commit history preserved, so that it is easier to compare & merge with/from upstream.
(Otherwise this reminds me too much of the ARM community :-P)

Linux usb

Hola tengo en la laptop un usb con linux al querer ejecutar un archivo me aparece syntax unexpected "("...
Se que el archivo funciona porque en la otra laptop instalé linux y lo ejecuté. La diferencia es que ahora lo intento ejecutar desde el usb...

Sudo ./xmrig

When I run ./configure, error : syntax error near unexpected token `USB,'

OS : Ubuntu 1804

I hv install libusb :
ii libgusb2:amd64 0.2.11-1 amd64 GLib wrapper around libusb1
ii libusb-1.0-0:amd64 2:1.0.21-2 amd64 userspace USB programming library
ii libusb-1.0-0-dev:amd64 2:1.0.21-2 amd64 userspace USB programming library development files

Configure output :
stan@ubuntu:~/gd32-dfu-utils$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/stanley/gd32-dfu-utils/m4/missing: Unknown --is-lightweight' option Try /home/stanley/gd32-dfu-utils/m4/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for libusb_init in -lusb... no
./configure: line 3954: syntax error near unexpected token USB,' ./configure: line 3954: PKG_CHECK_MODULES(USB, libusb-1.0 >= 1.0.0,,'

Please upstream these quirk fixes

Please submit these fixes to the upstream dfu project.
It took me a while to figure out the mainline dfu-util does not properly work with the gd32 chips.
Not upstreaming means I need a seperate version just for this chip.

GD32VF103 variant not supported

It seems there are some variants of GD32VF103CBT6.

dfu-util --list output of bare chip available in the market.

Found DFU: [28e9:0189] ver=0100, devnum=15, cfg=1, intf=0, path="1-4", alt=0, name="@Internal Flash  /0x08000000/128*001Kg", serial="3CBJ"

dfu-util --list output of Longan Nano.

Found DFU: [28e9:0189] ver=1000, devnum=16, cfg=1, intf=0, path="1-4", alt=1, name="@Option Bytes  /0x1FFFF800/01*016 g", serial="3CBJ"
Found DFU: [28e9:0189] ver=1000, devnum=16, cfg=1, intf=0, path="1-4", alt=0, name="@Internal Flash  /0x08000000/512*002Kg", serial="3CBJ"

While Longan Nano can be erased with mass-erase command, bare chip always reports failure.
If the bare chip is blank it can be programmed successfully. But if it is not blank it fails to program silently. Reporting success but read-out not matching.

If you erase the chip through JTAG with openocd, it can be programmed again.

Is there a way to properly erase this chip through DFU?
Or is there a way to update bootloader in these chips?
How can you tell the difference of these chips from their markings?

Any information is welcome.

"Cannot open DFU device 28e9:0189"

I've bought a Wio Lite RISC-V (https://www.seeedstudio.com/Wio-Lite-RISC-V-GD32VF103-p-4293.html) with a GD32VF103CBT6 chip on it. I've installed the "MCU Drivers" in the "MCU tool" package listed under https://gd32mcu.21ic.com/en/index.

The USB device successfully appears in the device manager when it is connected in the BOOT0 = 1 position.

grafik

However when attempting to a upload a firmware file generated by PIO (or any), the program is unable to open the USB device

C:\Users\Maxi\Desktop>dfu-util -d 28e9:0189 -a 0 --dfuse-address 0x08000000:leave -D "C:\Users\Maxi\Documents\PlatformIO\Projects\risv5_test\.pio\build\wio_lite_risc-v\firmware.bin"
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 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/

Cannot open DFU device 28e9:0189
No DFU capable USB device available

Since you have not printed the error return value (or its string help text) in the code

if (libusb_open(dev, &devh)) {
warnx("Cannot open DFU device %04x:%04x", desc->idVendor, desc->idProduct);
break;

I have no idea why opening failed or what I have to do.

Also, the device doesn't appear in Zadig so I can't load libusb drivers for it

The only upload method which works is by the "GigaDevice Dfu Tool" linked above.

grafik

So uploading via USB DFU works in general. Did I misconfigure the tool or is something wrong with the tool?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.