This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

About DFU(Device Firmware Update) for LINUXEZSDK-AM335X V07.00



Hi

In the following URLs(Texas Instruments Wiki), there are the steps of using the dfu command in uboot.

1.AM335x USB Device Firmware Upgrade User Guide
http://processors.wiki.ti.com/index.php/AM335x_USB_Device_Firmware_Upgrade_User_Guide

2.Linux Core U-Boot User's Guide
http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User's_Guide

In EZSDK V06.00, I have ran the dfu with no problems, but it did not work correctly with EZSDK V07.00.

I paste the detail at below.

Ran in host PC(debian):

----------------------------------

root@LINARO-ARM-WHYYZY:/opt/u-boot# dfu-util -l
dfu-util 0.5

(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY

dfu-util does currently only support DFU version 1.0

Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=0, name="NAND.SPL"
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=1, name="NAND.SPL.backup1"
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=2, name="NAND.SPL.backup2"
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=3, name="NAND.SPL.backup3"
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=4, name="NAND.u-boot-spl-os"
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=5, name="NAND.u-boot"
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=6, name="NAND.u-boot-env"
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=7, name="NAND.u-boot-env.backup1"
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=8, name="NAND.kernel"
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=9, name="NAND.rootfs"
root@LINARO-ARM-WHYYZY:/opt/u-boot# dfu-util -a 0 -D MLO
dfu-util 0.5

(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY

dfu-util does currently only support DFU version 1.0

Opening DFU USB device... ID 0403:bd00
WARNING: Can not find cached DFU functional descriptor
Warning: Assuming DFU version 1.0
Run-time device DFU version 0100
Found DFU: [0403:bd00] devnum=0, cfg=1, intf=0, alt=0, name="NAND.SPL"
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Error obtaining cached DFU functional descriptor
DFU mode device DFU version 0110
Device returned transfer size 4096
No valid DFU suffix signature
Warning: File has no DFU suffix
bytes_per_hash=2158
Copying data from PC to DFU device
Starting download: [##################################################] finished!
state(2) = dfuIDLE, status(0) = No error condition is present
Done!

----------------------------------

Ran in AM335x:

----------------------------------

U-Boot# setenv dfu_alt_info ${dfu_alt_info_nand}
U-Boot# printenv dfu_alt_info
dfu_alt_info=NAND.SPL part 0 1;NAND.SPL.backup1 part 0 2;NAND.SPL.backup2 part 0 3;NAND.SPL.backup3 part 0 4;NAND.u-boot-spl-os part 0 5;NAND.u-boot part 0 6;NAND.u-boot-env part 0 7;NAND.u-boot-env.backup1 part 0 8;NAND.kernel part 0 9;NAND.rootfs part 0 10
U-Boot# nand erase.chip

NAND erase.chip: device 0 whole chip
Erasing at 0xffe0000 -- 100% complete.
OK
U-Boot# mtdparts

device nand0 <nand.0>, # parts = 10
#: name size offset mask_flags
0: NAND.SPL 0x00020000 0x00000000 0
1: NAND.SPL.backup1 0x00020000 0x00020000 0
2: NAND.SPL.backup2 0x00020000 0x00040000 0
3: NAND.SPL.backup3 0x00020000 0x00060000 0
4: NAND.u-boot-spl-os 0x00040000 0x00080000 0
5: NAND.u-boot 0x00100000 0x000c0000 0
6: NAND.u-boot-env 0x00020000 0x001c0000 0
7: NAND.u-boot-env.backup10x00020000 0x001e0000 0
8: NAND.kernel 0x00800000 0x00200000 0
9: NAND.rootfs 0x0f600000 0x00a00000 0

active partition: nand0,0 - (NAND.SPL) 0x00020000 @ 0x00000000

defaults:
mtdids : nand0=nand.0
mtdparts: mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.rootfs)
U-Boot# dfu --h
dfu - Device Firmware Upgrade

Usage:
dfu <USB_controller> <interface> <dev> [list]
- device firmware upgrade via <USB_controller>
on device <dev>, attached to interface
<interface>
[list] - list available alt settings

U-Boot# dfu 0 nand 0
using id 'nand0,0'
using id 'nand0,1'
using id 'nand0,2'
using id 'nand0,3'
using id 'nand0,4'
using id 'nand0,5'
using id 'nand0,6'
using id 'nand0,7'
using id 'nand0,8'
using id 'nand0,9'
GADGET DRIVER: usb_dnl_dfu
musb-hdrc: peripheral reset irq lost!
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
dfu_get_buf: Could not memalign 0x800000 bytes
DOWNLOAD ... OK
Ctrl+C to exit ...

----------------------------------

like the detail at above, I got the error messge "dfu_get_buf: Could not memalign 0x800000 bytes" in EZSDK V07.00(u-boot-2013.10-ti2013.12.01).

Is this a bug of u-boot-2013.10-ti2013.12.01? How can I use dfu command in u-boot-2013.10-ti2013.12.01?

 

Thanks!

  • Hi,

    This may be related to the value of CONFIG_SYS_DFU_DATA_BUF_SIZE (8MB by default). This is also the DFU_MAX_FILE_SIZE which is equal to the DFU_DATA_BUF_SIZE. Try to change these. Here is what the U-Boot readme says about these two:

            CONFIG_SYS_DFU_DATA_BUF_SIZE
            Dfu transfer uses a buffer before writing data to the
            raw storage device. Make the size (in bytes) of this buffer
            configurable. The size of this buffer is also configurable
            through the "dfu_bufsiz" environment variable.

            CONFIG_SYS_DFU_MAX_FILE_SIZE
            When updating files rather than the raw storage device,
            we use a static buffer to copy the file into and then write
            the buffer once we've been given the whole file.  Define
            this to the maximum filesize (in bytes) for the buffer.
            Default is 4 MiB if undefined.

    If my suggestion doesn't help, please direct your question to the U-Boot mailing list.

    P.S.

    Which version is your dfu-util package?

    Best regards,
    Miroslav

  • Hi Miroslav 

    Thanks for your reply.

    When I ran dfu-util -l, the output is 

    dfu-util 0.5

    So I think the version of dfu-util is 0.5.

    I will try to change the  "dfu_bufsiz" environment variable.

    Thanks!