Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
university:tools:pluto:users:firmware [08 Jun 2020 16:04] – [Update using DFU mode] Robin Getzuniversity:tools:pluto:users:firmware [24 Jun 2020 01:32] – [Debugging DFU] Robin Getz
Line 235: Line 235:
 </code> </code>
 ''pluto.dfu'' is your firmware file in the dfu format. ''pluto.dfu'' is your firmware file in the dfu format.
 +
 +==== Debugging DFU ====
 +
 +If those instructions didn't help - you might get here. Hopefully this will help describe things.
 +
 +The first thing to try is to make sure the device (Pluto or M2k) is actually in DFU mode. This is accomplished by asking the dfu utilities to list any devices that it finds, their configuration, interface and altsetting.
 +
 +<WRAP info>
 +Although these examples are on a Linux machine, on Windows, it is similar. When you installed the Pluto or M2k Windows Drivers, it put the ''dfu-utils'' on your hard drive (that's why you accepted the GPL when you installed the Windows license). However, for many these are not on path. It's easy to go to this directory, and run things from there. For example:
 +
 +<xterm>
 +C:\>**cd "c:\Program Files\Analog Devices\PlutoSDR-M2K"**
 +C:\Program Files\Analog Devices\PlutoSDR-M2K>**dfu-util.exe -l**
 +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/%%
 +
 +Found DFU: [0456:b674] ver=0221, devnum=7, cfg=1, intf=0, path="1-1", alt=4, name="spare.dfu", serial="UNKNOWN"
 +Found DFU: [0456:b674] ver=0221, devnum=7, cfg=1, intf=0, path="1-1", alt=3, name="uboot-env.dfu", serial="UNKNOWN"
 +Found DFU: [0456:b674] ver=0221, devnum=7, cfg=1, intf=0, path="1-1", alt=2, name="uboot-extra-env.dfu", serial="UNKNOWN"
 +Found DFU: [0456:b674] ver=0221, devnum=7, cfg=1, intf=0, path="1-1", alt=1, name="firmware.dfu", serial="UNKNOWN"
 +Found DFU: [0456:b674] ver=0221, devnum=7, cfg=1, intf=0, path="1-1", alt=0, name="boot.dfu", serial="UNKNOWN"
 +</xterm>
 +
 +Just don't type in the ''sudo'' that is necessary on Linux.
 +</WRAP>
 +
 +Here it found one device, with 5 "partitions" in the flash map.
 +
 +<xterm>
 +rgetz@brain:~/$ **sudo dfu-util --list**
 +[sudo] password for rgetz: 
 +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/%%
 +
 +Found DFU: [0456:b674] ver=0221, devnum=104, cfg=1, intf=0, path="3-1.6.6", alt=4, name="spare.dfu", serial="UNKNOWN"
 +Found DFU: [0456:b674] ver=0221, devnum=104, cfg=1, intf=0, path="3-1.6.6", alt=3, name="uboot-env.dfu", serial="UNKNOWN"
 +Found DFU: [0456:b674] ver=0221, devnum=104, cfg=1, intf=0, path="3-1.6.6", alt=2, name="uboot-extra-env.dfu", serial="UNKNOWN"
 +Found DFU: [0456:b674] ver=0221, devnum=104, cfg=1, intf=0, path="3-1.6.6", alt=1, name="firmware.dfu", serial="UNKNOWN"
 +Found DFU: [0456:b674] ver=0221, devnum=104, cfg=1, intf=0, path="3-1.6.6", alt=0, name="boot.dfu", serial="UNKNOWN"
 +rgetz@brain:~/
 +</xterm>
 +
 +If this doesn't show up, try again. ''dfu-utils'' is known to work better the 2nd time.
 +
 +When the system boots, it follows this basic process:
 +  - the U-Boot (''boot'' section) will load, 
 +  - U-Boot will load it's environment (both the ''uboot-env'' and ''uboot-extra-env'' sections), 
 +  - U-Boot will then use that to load the kernel and ramfs (the ''firmware'' section).
 +
 +<WRAP info>
 +//**dfu-util**// - a short dfu primer
 +
 +[[http://dfu-util.sourceforge.net/dfu-util.1.html|DFU]] has lots of options, the ones to remember are:
 +  * ''-l'' List the currently attached DFU capable USB devices
 +  * ''-a <altsetting>'' Specify the Altseting of the DFU Interface
 +  * ''-D <file'' Write firmware from <file> into device
 +  * ''-U <file>'' Read firmware from device into <file>
 +  * ''-R'' Issue USB reset signalling after upload or download has finished.
 +
 +The file releases always include:
 +  * ''boot.dfu''
 +  * ''pluto.dfu''
 +  * ''uboot-env.dfu''
 +</WRAP>
 +
 +And corruption of those sections can cause problems in the booting process. In order, try writing the:
 +  - firmware section:<xterm>rgetz@brain:~/$ **sudo dfu-util -a firmware.dfu -D ./pluto.dfu**
 +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/%%
 +
 +Match vendor ID from file: 0456
 +Match product ID from file: b673
 +Opening DFU capable USB device...
 +ID 0456:b674
 +Run-time device DFU version 0110
 +Claiming USB DFU Interface...
 +Setting Alternate Setting #1 ...
 +Determining device status: state = dfuIDLE, status = 0
 +dfuIDLE, continuing
 +DFU mode device DFU version 0110
 +Device returned transfer size 4096
 +Copying data from PC to DFU device
 +Download [=========================] 100%     10623523 bytes
 +Download done.
 +state(7) = dfuMANIFEST, status(0) = No error condition is present
 +state(2) = dfuIDLE, status(0) = No error condition is present
 +Done!
 +rgetz@brain:~/
 +</xterm>
 +  - The U-Boot section: <xterm>rgetz@brain:~/$ **sudo dfu-util -a boot.dfu -D ./boot.dfu**
 +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/%%
 +
 +Match vendor ID from file: 0456
 +Match product ID from file: b673
 +Opening DFU capable USB device...
 +ID 0456:b674
 +Run-time device DFU version 0110
 +Claiming USB DFU Interface...
 +Setting Alternate Setting #0 ...
 +Determining device status: state = dfuIDLE, status = 0
 +dfuIDLE, continuing
 +DFU mode device DFU version 0110
 +Device returned transfer size 4096
 +Copying data from PC to DFU device
 +Download [=========================] 100%       469388 bytes
 +Download done.
 +state(7) = dfuMANIFEST, status(0) = No error condition is present
 +state(2) = dfuIDLE, status(0) = No error condition is present
 +Done!
 +rgetz@brain:~/
 +</xterm>
 +  - the U-Boot environment : <xterm>rgetz@brain:~/$ **sudo dfu-util -a uboot-env.dfu -D ./uboot-env.dfu**
 +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/%%
 +
 +Match vendor ID from file: 0456
 +Match product ID from file: b673
 +Opening DFU capable USB device...
 +ID 0456:b674
 +Run-time device DFU version 0110
 +Claiming USB DFU Interface...
 +Setting Alternate Setting #3 ...
 +Determining device status: state = dfuIDLE, status = 0
 +dfuIDLE, continuing
 +DFU mode device DFU version 0110
 +Device returned transfer size 4096
 +Copying data from PC to DFU device
 +Download [=========================] 100%       131072 bytes
 +Download done.
 +state(7) = dfuMANIFEST, status(0) = No error condition is present
 +state(2) = dfuIDLE, status(0) = No error condition is present
 +Done!
 +</xterm>
 +  - the ''uboot-extra-env.dfu''. This is rarely needed to be changed. This is where things like factory calibration and ppm offset are stored. A good idea is just to check it:<xterm>rgetz@brain:~/ **sudo dfu-util -a uboot-extra-env.dfu -U ./uboot-extra-env.dfu**
 +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/%%
 +
 +Opening DFU capable USB device...
 +ID 0456:b674
 +Run-time device DFU version 0110
 +Claiming USB DFU Interface...
 +Setting Alternate Setting #2 ...
 +Determining device status: state = dfuIDLE, status = 0
 +dfuIDLE, continuing
 +DFU mode device DFU version 0110
 +Device returned transfer size 4096
 +Copying data from DFU device to PC
 +Upload [=========================] 100%         4096 bytes
 +Upload done.
 +</xterm>This will upload things from the device to your PC. It can be checked with ''hexdump''.<xterm>rgetz@brain:~/Downloads/pluto2$ hexdump -C ./uboot-extra-env.dfu
 +00000000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
 +*
 +00001000
 +</xterm>Here we can see this is blank (all ''0xFF''). If you need to clear it, just make a file that starts with ''0xFF'', and write it. The U-Boot environment sections are protected with a CRC32, so if something has become corrupt, it will be skipped. (This is good, until you realize that the previous U-Boot environment.
 +  - The last time your access things, you can tell the device to reset with the ''-R'' option.<xterm>rgetz@brain:~/ **sudo dfu-util -R -a uboot-extra-env.dfu -U ./uboot-extra-env.dfu**
 +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/%%
 +
 +Opening DFU capable USB device...
 +ID 0456:b674
 +Run-time device DFU version 0110
 +Claiming USB DFU Interface...
 +Setting Alternate Setting #2 ...
 +Determining device status: state = dfuIDLE, status = 0
 +dfuIDLE, continuing
 +DFU mode device DFU version 0110
 +Device returned transfer size 4096
 +Copying data from DFU device to PC
 +Upload [=========================] 100%         4096 bytes
 +Upload done.
 +Resetting USB to switch back to runtime mode
 +</xterm>
university/tools/pluto/users/firmware.txt · Last modified: 21 Aug 2023 15:45 by Adrian Bogdan Stanea