Hi,
Could you please have a look at the dfu-util output and give me a hint
on why what I'm doing is not working. Here is a description of the problem:
I am using an NRF52840DK.
1. I erase the chip to start clean:
nrfjprog --eraseall
2. I flash the MCUboot bootloader:
~/mcuboot/boot/zephyr$ west flash
The output from the console is OK as there is no image:
*** Booting MCUboot v2.1.0-43-g50f35144e4e4 ***
*** Using Zephyr OS build v3.6.0-596-g9fa4cd8226ce ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3,
image_ok=0x3
I: Boot source: none
W: Failed reading image headers; Image=0
E: Unable to find bootable image
3. I flash my first USB DFU enabled image:
~/zephyr/usb_dfu/build/zephyr$ nrfjprog --program
build/zephyr/zephyr.signed.hex
After resetting, the console output is OK and the image is executed:
*** Booting MCUboot v2.1.0-43-g50f35144e4e4 ***
*** Using Zephyr OS build v3.6.0-596-g9fa4cd8226ce ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3,
image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0xc000
I: Jumping to the first image slot
[00:00:00.000,213] <err> qspi_nor: JEDEC id [00 00 00] expect [c2 28 17]
*** Booting Zephyr OS build v3.6.0-596-g9fa4cd8226ce ***
[00:00:00.000,549] <inf> main: This device supports USB DFU class.
4. I check dfu-util:
~/zephyr/counter/build/zephyr# dfu-util -l
dfu-util 0.11
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 sourceforge.net/.../
Found Runtime: [2fe3:0005] ver=0306, devnum=117, cfg=1, intf=0,
path="3-3.4.3", alt=0, name="UNKNOWN", serial="4327BC869F6C049C"
Notice there is only alt=0
5. I try to download the new image:
~/zephyr/counter/build/zephyr# dfu-util --download zephyr.signed.hex
The download fails but alt=1 appears:
dfu-util 0.11
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 sourceforge.net/.../
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 2fe3:0005
Device DFU version 0110
Claiming USB DFU (Run-Time) Interface...
Setting Alternate Interface zero...
Determining device status...
DFU state(0) = appIDLE, status(0) = No error condition is present
Device really in Run-Time Mode, send DFU detach request...
Device will detach and reattach...
dfu-util: More than one DFU capable USB device found! Try `--list' and
specify the serial number or disconnect all but one device
6. I try to download the new image in the newly appeared slot:
~/zephyr/counter/build/zephyr# dfu-util --download zephyr.signed.hex
--alt 1
This time dfu-util succeeds:
dfu-util 0.11
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 sourceforge.net/.../
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 2fe3:ffff
Device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Interface #1 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 0110
Device returned transfer size 128
Copying data from PC to DFU device
Download [=========================] 100% 177796 bytes
Download done.
DFU state(2) = dfuIDLE, status(0) = No error condition is present
Done!
But after I press reset, the board swaps but still boots the old image:
*** Booting MCUboot v2.1.0-43-g50f35144e4e4 ***
*** Using Zephyr OS build v3.6.0-596-g9fa4cd8226ce ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: test
I: Bootloader chainload address offset: 0xc000
I: Jumping to the first image slot
[00:00:00.000,213] <err> qspi_nor: JEDEC id [00 00 00] expect [c2 28 17]
*** Booting Zephyr OS build v3.6.0-596-g9fa4cd8226ce ***
[00:00:00.000,549] <inf> main: This device supports USB DFU class.
Best regards,
-- Alex
Greetings, I recently worked for a very large company as a contractor who
sells Routers and internet based devices to companies and governments
around the world.
I noticed in the course of repairing these a line of code that appears and
it had that this was copyright back in 2016.
I tried looking online for the answer but I believe it's illegal to pass
off something that isn't yours as copyrighted material.
These machines they build all seem to run rather similar code and your
codes seems to be in it.
I have attached a picture i took of it.
I wanted to make sure this is on the up and up because if not, they are
clearly using your code for profit and passing it off as their own.
I found they use a lot of github code/free code.
[image: 20240219_071957.jpg]
Dear Mr/Mrs, during work with ST Microelectronics STM32MP135F-DK board I
have found, that after proper TF-A download there is a problem in
dfu-util. Read USB DFU label is "UNKNOWN". This scenario is not
reproducable under Linux dfu-util with the same set of software. I am
not depended on this problem - it is informational only.
Best Regards,
Peter
Hello,
This is not a bug and therefor I want to refrain from posting at the repository issues list.
I'm running dfu-util to flash firmware to the GIGA board to start with MicroPython exercises. Here is the output:
$ /usr/bin/dfu-util -w -a 0 -d 2341:0366 -D GIGAR1_MP_FW.dfu
dfu-util 0.11
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/
Waiting for device, exit with ctrl-C
^C
The ports on the desktop are:
from ttyACM0 to ttyACM5
from ttyUSB0 to ttyUSB3
The GIGA is connected through ttyACM4
libusb version 1.0.26 (11724)
I used dfu-util successfully (thanks to Tormod's advice) by setting the configuration rules for the USB port. Naturally, the port assignments for the GIGA board change in my environment but the Arduino IDE 2.4 correctly detects the right port for the board.
Do I have to set the port (in my environment) while using dfu-util to flash the firmware? There is a port parameter but I don't know the correct way to specify the port. Also, I couldn't use the -l parameter to gain insight on the connected devices.
Also, some clarification on the -a parameter would help my understanding. Thanks.
Regards.
DFU Util users/developers,
I am new to using this utility and would like to understand if it
applies to any my use cases.
Use case 1
I recently came into some USB flash drives that I wish to change the
vendor id and product id on (they have bogus vendor id and product id
numbers making them un-writable).
Use case 2
I would also like to be able to examine the firmware from a USB stick
(several years ago I was scammed on a USB stick I purchased that had a
bogus capacity and had to argue with PayPal to get my money back). So
it is surely not an unreasonable thing to wish to check a USB stick's
firmware for that or other security purposes (passive injection of
code to impact BIOS or the OS).
Can this utility perform any of the aforementioned enumerated
activities when used in a Linux environment? If not, any idea what
would do so?
Mailing list question - can this email list be commanded to send daily
or weekly digests or should I expect a multitude of emails coming from
individuals replying to threads?
Thanks in advance and do stay safe (avoid the thugs) and healthy.
Stuart
Very Respectfully,
Stuart Blake Tener, BScCS, N3GWG (Extra), MROP
Computer Scientist / FCC Licensed Radio Operator
Las Vegas, NV / Philadelphia, PA
(310) 358-0202 Mobile Phone
(215) 338-6005 Google Voice
dfu-util 0.11 has been released, and is available from
http://dfu-util.sourceforge.net/ under "Releases".
Thanks to everybody who contributed with patches, testing and bug reporting.
>From the ChangeLog (see git history for full details):
- Fix suffix check regression on Windows with Large File Support
- Skip setting alternate interface when not needed
- Only clamp transfer size on Linux
- Quirk for GD32 leave request
- Improve status and error messages and exit codes
- dfuse: Process all alternate interfaces in a DfuSe file
- dfuse-pack.py: Fix alternate settings if first is 0
The binaries package (also in the release folder) includes 32-bit and
64-bit Windows binaries built on MinGW as well as macOS x86_64
binaries built on 10.13.6. It also includes an "lsusb" binary for
these platforms, which might come handy for debugging. Latest git of
libusb was used, and there are binaries with libusb statically linked,
as well as dynamically linked.
Best regards,
Tormod