UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor robster
Visitor
966 Views
Registered: ‎07-03-2018

U-boot: enable dfu device on zc702

Jump to solution

Hej,

I'm tying to enable U-boot on a ZC702 evk board to act as a DFU device. I'm building/deploying the latest u-boot-xlnx-v2018.2 github release (I've added a couple of extra printf, but that's it) .

Trying to enable dfu looks like this in the prompt:

Zynq> run dfu_mmc_info
Zynq> run dfu_mmc     
run_usb_dnl_gadget usb_dnl_dfu
board_usb_init index:0 type:1
usb_setup_ehci_gadget: uclass_find_device_by_seq return:-19
g_dnl_register: failed!, error: -19

ENODEV (No such device) is returned.

I've tried to change the default dr_mode for the USB device in the device-tree from 'host' (which doesn't seem right for this implementation) to 'otg' and 'peripheral' (including changing jumpers on the evk board) generate the same result (the later renders no usb function at all).

 

Well I guess I could simplify the problem description to: unable to enable any gadget functionality on zc702-evk board.

 

Is there any other initialization I need to do before starting the dfu device?

Any pointers/suggestions on what to do I greatly appreciated.

 

Hälsningar

Robert

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
929 Views
Registered: ‎02-07-2018

Re: U-boot: enable dfu device on zc702

Jump to solution

HI Robster,

 

Add the following lines in the system-user.dtsi

/include/ "system-conf.dtsi"
/ {
aliases

{ usb0 = &usb0; };
};

&usb0

{ dr_mode = "peripheral"; };

 

 

  1. Boot the board in SD boot mode and stop at the u-boot prompt
  2. On u-boot prompt run the following command 
    run dfu_ram
  3. On Host machine run the following command:
    dfu-util -l 
    After running this command, you can see the device like this:

dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Found DFU: [03fd:0300] ver=0221, devnum=9, cfg=1, intf=0, alt=0, name="image.ub", serial="UNKNOWN"

 

  1. On host machine, run the following command
    dfu-util -d 03fd:0300 -D images/linux/image.ub -a 0
  2. Once it download the image.ub, on u-boot prompt
    Ctrl+C
  3. bootm

 

Note: Make sure this driver has to be installed in host machine( if it is windows):

https://downloads.tomsguide.com/Zadig,0301-65957.html

 

This i already verified and it is working fine.

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

 

4 Replies
Moderator
Moderator
942 Views
Registered: ‎02-07-2018

Re: U-boot: enable dfu device on zc702

Jump to solution

HI,

 

Please follow below steps USB device mode test

1. Download till u-boot and stop at the u-boot prompt.
2.Connect board to host PC using USB0 and install dfu util on host PC.
3. Download the windows download utility(dfu-0.7) from http://dfu-util.gnumonks.org/releases/
4.At the u-boot prompt enter command "run dfu_ram" to enter into the Device mode.
5.At the Host side the device should be detected.
6.Then go to the command prompt and cd to dfu-util folder and try to run dfu-util.exe from command line with options as below.
 a. dfu-util.exe -l 
 b. the zynq device should be listes as DFU capable. 
 c. Then download uImage from host using command "dfu-util.exe -a 0 -D Image 
 d. Download the fdt to device using the same command but "-a 1"(for fdt) ("dfu-util.exe -a 1 -D system.dtb).
 7.Run the u-boot boot command, booti (booti $kernel_addr - $fdt_addr) to boot kernel.

Log:

ZynqMP> run dfu_ram

 

 

To enable the  dfu support  please enable the below config options:

petalinux-config -c u-boot
CMD_DFU=y
DFU_PRAM=y

 

Need to pass dr_mode=peripheral  in device tree.

 

I verified in zynqMP platfrom, and not verified in zynq  but i hope this info will help you.

 

you can refer this link for more info: https://www.xilinx.com/support/answers/69378.html

 

Thanks & regards

Aravind

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

0 Kudos
Visitor robster
Visitor
849 Views
Registered: ‎07-03-2018

Re: U-boot: enable dfu device on zc702

Jump to solution

Hej Aravind,

Sorry for not getting back earlier...vacation times n' all that.

 

The problem isn't enabling DFU functionality, it's what comes after....enabling USB to act as a device/gadget.

I've changed dr_mode=peripheral  in device tree....sill no dice.

 

Can u-boot be configured in any way to enable (any) USB gadget functionality on a zynq platform?

USB device model doesn't seem to support USB gadget framework( see usb-info.txt), is there a workaround for this?

 

Hälsningar

Robert

0 Kudos
Moderator
Moderator
930 Views
Registered: ‎02-07-2018

Re: U-boot: enable dfu device on zc702

Jump to solution

HI Robster,

 

Add the following lines in the system-user.dtsi

/include/ "system-conf.dtsi"
/ {
aliases

{ usb0 = &usb0; };
};

&usb0

{ dr_mode = "peripheral"; };

 

 

  1. Boot the board in SD boot mode and stop at the u-boot prompt
  2. On u-boot prompt run the following command 
    run dfu_ram
  3. On Host machine run the following command:
    dfu-util -l 
    After running this command, you can see the device like this:

dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Found DFU: [03fd:0300] ver=0221, devnum=9, cfg=1, intf=0, alt=0, name="image.ub", serial="UNKNOWN"

 

  1. On host machine, run the following command
    dfu-util -d 03fd:0300 -D images/linux/image.ub -a 0
  2. Once it download the image.ub, on u-boot prompt
    Ctrl+C
  3. bootm

 

Note: Make sure this driver has to be installed in host machine( if it is windows):

https://downloads.tomsguide.com/Zadig,0301-65957.html

 

This i already verified and it is working fine.

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

 

Visitor robster
Visitor
797 Views
Registered: ‎07-03-2018

Re: U-boot: enable dfu device on zc702

Jump to solution

Thanks Aravind.

It works like a charm.

 

Hälsningar

Robert

0 Kudos