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.

USB WiFi error on DM365 EVM

Hi all,

 

I am trying to get a WiFi dongle with a Zydas ZD1211B chip working with the DM365 EVM.

I am using kernel version 2.6.32-rc2, the one shipped in the DVSDK 4.00.00.22. When I plug in the dongle

at the USB port of the board I occasionally get the following error and the interface is not enabled.

 

usb 1-1: new high speed USB device using musb_hdrc and address 8

usb 1-1: New USB device found, idVendor=0ace, idProduct=1215

usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=0

usb 1-1: Product: USB2.0 WLAN

usb 1-1: Manufacturer: ZyDAS

usb 1-1: configuration #1 chosen from 1 choice

usb 1-1: print_id() 0ace:1215 v4810 high

usb 1-1: reset high speed USB device using musb_hdrc and address 8

zd1211rw 1-1:1.0: zd_chip_read_mac_addr_fw()

phy6: Selected rate control algorithm 'minstrel'

zd1211rw 1-1:1.0: probe() successful

zd1211rw 1-1:1.0: phy6

zd1211rw 1-1:1.0: zd_usb_init_hw()

usb 1-1: request_fw_file() fw name zd1211/zd1211b_ub

usb 1-1: firmware: requesting zd1211/zd1211b_ub

usb 1-1: upload_firmware() firmware device id 0x4810 is equal to the actual device id

usb 1-1: request_fw_file() fw name zd1211/zd1211b_uphr

usb 1-1: firmware: requesting zd1211/zd1211b_uphr

usb 1-1: upload_code() transfer size 4018

usb 1-1: upload_code() firmware confirm return value 0x01

zd1211rw 1-1:1.0: zd_usb_init_hw() couldn't reset configuration. Error number -110

 

The error 110 stands for ETIMEDOUT and it is intermittent, ie if I unplug and plug the USB

dongle a few times it will eventually work. Has anybody else seen this issue?

 

Cheers,

Stathis

  • Stathis,

    If this is intermittent and works fine after a few detach/attach then looks like sometime the wifi device is too slow to respond to the host commands.

    Does this wifi device works correctly with any standard Linux or XP PC ?

    Please also provide the below data which may help.

    1. print the output of "cat /proc/bus/usb/devices" . you need to enable USBFS for this.

    2. Whats the FIFO table (mode_2_cfg) configured at drivers/usb/musb/musb_core.c. Is it the same as copied below,

    1100 /* mode 2 - fits in 4KB */
    1101 static struct musb_fifo_cfg __initdata mode_2_cfg[] = {
    1102 { .hw_ep_num = 1, .style = FIFO_TX,   .maxpacket = 512, },
    1103 { .hw_ep_num = 1, .style = FIFO_RX,   .maxpacket = 512, },
    1104 { .hw_ep_num = 2, .style = FIFO_TX,   .maxpacket = 512, },
    1105 { .hw_ep_num = 2, .style = FIFO_RX,   .maxpacket = 512, },
    1106 { .hw_ep_num = 3, .style = FIFO_RXTX, .maxpacket = 256, },
    1107 { .hw_ep_num = 4, .style = FIFO_RXTX, .maxpacket = 256, },
    1108 };

    Regards,
    Ajay
  •  

    Hi Ajay,

    Thanks for your help. I have tried the dongle on a Windows PC and it seems 

    to work reliably. Unfortunately I do not have a Linux PC available at the moment.

     

    1) This is the output of /proc/bus/usb/devices

    root@dm365-evm:~# cat /proc/bus/usb/devices

    T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 1

    B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0

    D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

    P:  Vendor=1d6b ProdID=0002 Rev= 2.06

    S:  Manufacturer=Linux 2.6.32-rc2-davinci1 musb-hcd

    S:  Product=MUSB HDRC host driver

    S:  SerialNumber=musb_hdrc

    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA

    I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

    E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

     

    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 0

    D:  Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs=  1

    P:  Vendor=0ace ProdID=1215 Rev=48.10

    S:  Manufacturer=ZyDAS

    S:  Product=USB2.0 WLAN

    C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA

    I:* If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=00 Prot=00 Driver=zd1211rw

    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

    E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

    E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=125us

    E:  Ad=04(O) Atr=03(Int.) MxPS=  64 Ivl=125us

     

    2) I changes the FIFO mode 2 table to the one you suggest, but it did not fix the issue.

    The table that was previously enabled in the code was:

    /* mode 2 - fits in 4KB */
    static struct fifo_cfg __initdata mode_2_cfg[] = {
    { .hw_ep_num = 1, .style = FIFO_TX,   .maxpacket = 512, },
    { .hw_ep_num = 1, .style = FIFO_RX,   .maxpacket = 512, },
    { .hw_ep_num = 2, .style = FIFO_TX,   .maxpacket = 512, },
    { .hw_ep_num = 2, .style = FIFO_RX,   .maxpacket = 1024, },
    { .hw_ep_num = 3, .style = FIFO_TX,   .maxpacket = 512, },
    { .hw_ep_num = 3, .style = FIFO_RX,   .maxpacket = 512, },
    { .hw_ep_num = 4, .style = FIFO_TX,   .maxpacket = 256, },
    { .hw_ep_num = 4, .style = FIFO_RX,   .maxpacket = 128, },
    };

     

    3) I turned on debugging on the MUSB HDRC driver. These are some of the 

    relevant messages when the kernel is booting, discovers the dongle and

    loads the Zydas driver.

     

    musb_hdrc: version 6.0, cppi-dma, host, debug=3

    DaVinci OTG revision 00140901 phy 21f0 control 00

    musb_hdrc: ConfigData=0x06 (UTMI-8, dyn FIFOs, SoftConn)

    musb_hdrc: MHDRC RTL version 1.500 

    musb_hdrc: setup fifo_mode 2

    musb_hdrc: 7/9 max ep, 2624/4096 memory

    musb_hdrc: hw_ep 0shared, max 64

    musb_hdrc: hw_ep 1tx, max 512

    musb_hdrc: hw_ep 1rx, max 512

    musb_hdrc: hw_ep 2tx, max 512

    musb_hdrc: hw_ep 2rx, max 512

    musb_hdrc: hw_ep 3shared, max 256

    musb_hdrc: hw_ep 4shared, max 256

    musb_hdrc: USB Host mode controller at fec64000 using DMA, IRQ 12

    musb_hdrc musb_hdrc: MUSB HDRC host driver

    drivers/usb/core/inode.c: creating file 'devices'

    drivers/usb/core/inode.c: creating file '001'

    musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1

    usb usb1: default language 0x0409

    usb usb1: udev 1, busnum 1, minor = 0

    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

    usb usb1: Product: MUSB HDRC host driver

    usb usb1: Manufacturer: Linux 2.6.32-rc2-davinci1 musb-hcd

    usb usb1: SerialNumber: musb_hdrc

    usb usb1: uevent

    usb usb1: usb_probe_device

    usb usb1: configuration #1 chosen from 1 choice

    usb usb1: adding 1-0:1.0 (config #1, interface 0)

    usb 1-0:1.0: uevent

    hub 1-0:1.0: usb_probe_interface

    hub 1-0:1.0: usb_probe_interface - got id

    hub 1-0:1.0: USB hub found

    hub 1-0:1.0: 1 port detected

    hub 1-0:1.0: standalone hub

    hub 1-0:1.0: individual port power switching

    hub 1-0:1.0: no over-current protection

    hub 1-0:1.0: power on to power good time: 10ms

    hub 1-0:1.0: local power source is good

    hub 1-0:1.0: enabling power on all ports

    musb_start 891: <== devctl 98

    drivers/usb/core/inode.c: creating file '001'

    musb_init_controller 2082: HOST mode, status 0, devctl 99 B

    Registered /proc/driver/musb_hdrc

    .....................................

    .....................................

    musb_stage0_irq 385: <== Power=e0, DevCtl=5d, int_usb=0x10

    musb_stage0_irq 624: CONNECT (a_host) devctl 5d

    hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002

    musb_hub_control 357: port status 00010101

    hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s

    hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101

    musb_hub_control 357: port status 00120503

    usb 1-1: new high speed USB device using musb_hdrc and address 2

    musb_ep_program 740: --> hw0 urb c23fe380 spd3 dev0 ep0out h_addr00 h_port00 bytes 8

    musb_hub_control 357: port status 00120503

    musb_ep_program 740: --> hw0 urb c23fe380 spd3 dev0 ep0out h_addr00 h_port00 bytes 8

    musb_ep_program 740: --> hw0 urb c23fe280 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    musb_ep_program 740: --> hw0 urb c23fe280 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    musb_ep_program 740: --> hw0 urb c23fe280 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    musb_ep_program 740: --> hw0 urb c23fe280 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    usb 1-1: default language 0x0409

    musb_ep_program 740: --> hw0 urb c23fe280 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    musb_ep_program 740: --> hw0 urb c23fe280 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    usb 1-1: udev 2, busnum 1, minor = 1

    usb 1-1: New USB device found, idVendor=0ace, idProduct=1215

    usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=0

    usb 1-1: Product: USB2.0 WLAN

    usb 1-1: Manufacturer: ZyDAS

    usb 1-1: uevent

    usb 1-1: usb_probe_device

    usb 1-1: configuration #1 chosen from 1 choice

    musb_ep_program 740: --> hw0 urb c23fe480 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    usb 1-1: adding 1-1:1.0 (config #1, interface 0)

    usb 1-1:1.0: uevent

    drivers/usb/core/inode.c: creating file '002'

    hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002

    musb_hub_control 357: port status 00020503

    hub 1-0:1.0: port 1 enable change, status 00000503

    .............................................

    .............................................

     

    usb usb1: uevent

    usb 1-0:1.0: uevent

    usb 1-1: uevent

    usb 1-1:1.0: uevent

    usb 1-1: uevent

    usb usb1: uevent

    zd1211rw usb_init()

    zd1211rw 1-1:1.0: usb_probe_interface

    zd1211rw 1-1:1.0: usb_probe_interface - got id

    usb 1-1: print_id() 0ace:1215 v4810 high

    musb_hub_control 357: port status 00120503

    hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002

    usb 1-1: reset high speed USB device using musb_hdrc and address 2

    musb_ep_program 740: --> hw0 urb c2eef580 spd3 dev0 ep0out h_addr00 h_port00 bytes 8

    musb_hub_control 357: port status 00120503

    hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002

    musb_ep_program 740: --> hw0 urb c2eef580 spd3 dev0 ep0out h_addr00 h_port00 bytes 8

    musb_ep_program 740: --> hw0 urb c2eef200 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    musb_ep_program 740: --> hw0 urb c2eef200 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    musb_ep_program 740: --> hw0 urb c2eef200 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    zd1211rw 1-1:1.0: zd_chip_read_mac_addr_fw() 

    musb_ep_program 740: --> hw0 urb c2eef200 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    phy0: Selected rate control algorithm 'minstrel'

    zd1211rw 1-1:1.0: probe() successful

    zd1211rw 1-1:1.0: phy0

    usbcore: registered new interface driver zd1211rw

    zd1211rw initialized

     

    4) These are the kernel messages produced when attempting to bring up the interface with

    wpa_supplicant. At this stage the firmware is loaded on the Zydas chip.

     

     

    zd1211rw 1-1:1.0: zd_usb_init_hw() 

    usb 1-1: request_fw_file() fw name zd1211/zd1211b_ub

    usb 1-1: firmware: requesting zd1211/zd1211b_ub

    usb 1-1: upload_firmware() firmware device id 0x4810 is equal to the actual device id

    usb 1-1: request_fw_file() fw name zd1211/zd1211b_uphr

    usb 1-1: firmware: requesting zd1211/zd1211b_uphr

    usb 1-1: upload_code() transfer size 4018

    musb_ep_program 740: --> hw0 urb c196bc80 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    musb_h_ep0_continue 983: Sending 64 bytes to ep0 fifo c103e000

    musb_h_ep0_continue 983: Sending 64 bytes to ep0 fifo c103e040

    ......................................................

    ......................................................

     

    musb_h_ep0_continue 983: Sending 64 bytes to ep0 fifo c103eec0

    musb_h_ep0_continue 983: Sending 64 bytes to ep0 fifo c103ef00

    musb_h_ep0_continue 983: Sending 64 bytes to ep0 fifo c103ef40

    musb_h_ep0_continue 983: Sending 50 bytes to ep0 fifo c103ef80

    musb_ep_program 740: --> hw0 urb c196bc80 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    usb 1-1: upload_code() firmware confirm return value 0x01

    musb_ep_program 740: --> hw0 urb c196bc80 spd3 dev2 ep0out h_addr00 h_port00 bytes 8

    usb 1-1: wpa_supplicant timed out on ep0out len=0/0

    zd1211rw 1-1:1.0: zd_usb_init_hw() couldn't reset configuration. Error number -110

     

    Kind regards,
    Stathis

     

     

     

     

     

  • Stathis,

    The endpoint resources and FIFO table is fine in your code base. Please apply attached patch which fixes cppi4.1 dma issue with networking class host.

    6406.0001--MUSB-Fix-for-CDC-Host-issue-when-streaming-more.patch.log

    Regards,

    Ajay

  • Hi Ajay,

    Thank you, but the patch does not apply to my kernel. I am running Linux 2.6.32-rc2 from PSP 03.01.00.37

    which does not seem to have have support for CPPI 4.1. In addition I compiled and ran the MUSB driver with

    the CPPI DMA disabled (PIO mode) and the behaviour was the same.

    I have the feeling that this may not be a DaVinci  issue as it always seems to timeout when the Zydas driver

    tries to reset the device (usb_reset_configuration() call) just after uploading the firmware. Those times 

    when the timeout does not occur and I manage to bring the interface up and connect to the WiFi AP it looks

    reasonably stable (without having performed any extensive testing yet).

    Stathis

     

  • Stathis,

    I am sorry but I missed that you are using DM365 which uses cppi3.0 dma. Please ignore this patch.

    Please enable musb debug messages using "echo D5 > /proc/driver/musb_hdrc" and then reproduce the error. Please attach the error log here.

    Regards,

    Ajay

     

  • Hi Ajay,

    I enabled musb_hdrc debugging. The attachment contains the kernel log messages

    that are produced when I plug in the device.

    Regards,

    Stathis

    3465.usb-timeout.log

  • Stathis,

    As per the log there is a hub set feature with reset command. Do you have USB analyzer so that you can capture the bus traffic?

    Also please check the drivers for your wifi device and see if it is sending reset command after "usb 1-1: print_id() 0ace:1215 v4810 high" ?

    usb 1-1: adding 1-1:1.0 (config #1, interface 0)
    usb 1-1:1.0: uevent
    zd1211rw 1-1:1.0: usb_probe_interface
    zd1211rw 1-1:1.0: usb_probe_interface - got id
    usb 1-1: print_id() 0ace:1215 v4810 high
    musb_hub_control 427: set feature 4
    musb_port_reset 163: root port reset stopped
    musb_port_reset 171: high-speed device connected
    musb_hub_control 357: port status 00120503
    musb_hub_control 291: clear feature 20
    usb 1-1: reset high speed USB device using musb_hdrc and address 17

    Could you test the device with Linux machine running with same wifi class driver?

    Regards,
    Ajay

  • Hi Ajay,

     

    Thanks for your help again.

    I am afraid I do not have a USB analyzer to debug this. The aim of this exercise was mainly to enable and test the WiFi functionality

    rather than the USB. My device is using the zd1211rw driver under drivers/net/wireless. The print_id() statement that you mention

    is from the probe() function of the driver and it is followed by a call to usb_reset_device(), so it appears that the device is being reset.

    I will try to get a different  WiFi dongle with the same chipset to see if the issue is repeated. 

    I have had other devices, such as my USB memory stick working fine with the DM365 EVM.

     

    Regards,

    Stathis

  • Stathis,

    Now it seems class driver for wifi device itself is sending reset command. but the concern is that interface is not up whenever you see the reset error message. looks like driver has to be fine tuned for this specific scenario. Please update once you test with other dongles.

    Regards,

    Ajay

  • Hi Ajay,

    Just to add that I now tested the device on a Linux PC running Ubuntu 10.04 and the initialization always completed successfully without any of the timeout errors seen on the DM365 EVM. I also tried the latest Linux kernel source code from the Arago staging tree, but the behaviour was the same.

    Regards,

    Stathis