LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 03-12-2019, 09:24 AM   #1
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Rep: Reputation: 19
USB devices are not enumerated


I've got a MicroZed evaluation board with a Zynq 7020 SoC on it. I'm trying to get the USB port to work in a petalinux distro, and I can't quite figure out what the issue is. I'm using Avnet's own BSP, so I expect that it should "just work."

Please note that that I am confident that the hardware is OK.

In particular, I had to make some changes to the device tree in order to get the host bus to be recognized. That is, out-of-the-box, lsusb returns nothing. When I alter the device tree a bit, I can get lsusb to return one device, the bus itself. So that seems like a positive step.

However, plugging in a USB mass storage device, for example, does nothing. I get no messages in dmesg, and nothing new in lsusb. It seems likely that I'm missing something either at the kernel level or above, but I'm not sure how to go about diagnosing and working through it. Anyone got any advice?

Thanks
 
Old 03-14-2019, 07:53 AM   #2
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,493

Rep: Reputation: Disabled
Maybe USB hasn't been coded/compiled into your kernel(?).
 
Old 03-14-2019, 10:03 PM   #3
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Original Poster
Rep: Reputation: 19
USB support is definitely enabled in the kernel. I can confirm that the usbcore module is inserted on boot, as is ehci_hcd. Other modules specific to USB mass storage are not loaded, but can be inserted manually without error (usb_storage, sd_mod, scsi_mod).

Still, if you plug in a USB drive, nothing happens. No messages in dmesg, nothing reported by udevadm monitor. It seems like the device tree is correctly configured, because the root hub DOES get recognized and there are some messages in dmesg about it. But no uevents get fired. Udevd is running, but if nothing's firing a uevent, that doesn't help.

I think that's what's so confusing... if the USB root hub device exists, what else needs to happen to get uevents to fire when devices are attached/detached?
 
Old 03-23-2019, 07:47 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
What does 'sudo lsusb' say? Please plug in your non working devices, run it and post it.
For each usb device you support, you need
  1. The appropiate kernel configuration
  2. The appropiate kernel driver module.
  3. Firmware if needed.

For any device you want to work, insert it and immediately type in a terminal
Code:
sudo dmesg |tail -n 20
Post that also. We'll get you over this, and that's the information we need.
 
Old 03-25-2019, 09:19 AM   #5
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Original Poster
Rep: Reputation: 19
On boot, without a device attached, it looks like the root hub & EHCI are ok:

Code:
# dmesg | tail -n 20   
of_cfs_init: OK
ALSA device list:
  No soundcards found.
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address 1388
mmcblk0: mmc0:1388 USD00 14.7 GiB 
 mmcblk0: p1 p2
EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
udevd[726]: starting version 3.2.2
udevd[727]: starting eudev-3.2.2
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
macb e000b000.ethernet eth0: link up (1000/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

# dmesg | grep -i usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usb_phy_generic usb_phy@0: usb_phy@0 supply vcc not found, using dummy regulator
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
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: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.14.0-xilinx-v2018.2 ehci_hcd
usb usb1: SerialNumber: ci_hdrc.0
hub 1-0:1.0: USB hub found
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver

# lsusb
Bus 001 Device 001: ID 1d6b:0002
Then I plugged in a regular USB mass storage device. The output is identical to the above:

Code:
# dmesg | tail -n 20
of_cfs_init: OK
ALSA device list:
  No soundcards found.
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address 1388
mmcblk0: mmc0:1388 USD00 14.7 GiB 
 mmcblk0: p1 p2
EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
udevd[726]: starting version 3.2.2
udevd[727]: starting eudev-3.2.2
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
macb e000b000.ethernet eth0: link up (1000/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

# dmesg | grep -i usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usb_phy_generic usb_phy@0: usb_phy@0 supply vcc not found, using dummy regulator
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
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: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.14.0-xilinx-v2018.2 ehci_hcd
usb usb1: SerialNumber: ci_hdrc.0
hub 1-0:1.0: USB hub found
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver

# lsusb
Bus 001 Device 001: ID 1d6b:0002
Quote:
For each usb device you support, you need
  • The appropiate kernel configuration
  • The appropiate kernel driver module.
  • Firmware if needed.
Since it's a regular old USB mass storage device, no firmware is needed. Regarding the kernel configuration, as far as I can tell, everything is set up correctly. I can manually modprobe all the modules I should need (in particular, usb-storage inserts just fine, but still no devices are detected). My understanding is that, when a device is inserted, a userspace event should be fired. Udev should then handle creating device nodes and inserting the required modules. However, I'm not getting anything in dmesg or in lsusb, no modules get inserted, etc. In fact, `udevadm monitor` doesn't show any activity at all when a device is attached/detached.

Thanks
 
Old 03-25-2019, 12:19 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
usb_phy@0 supply vcc not found, using dummy regulator
That's a hardware error - no power. it says. Go figure. Act on this also
Quote:
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
 
Old 03-25-2019, 05:07 PM   #7
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Original Poster
Rep: Reputation: 19
Those are both quirks of this device. A different image for this board DOES have a working USB system, and both of those messages are present in dmesg on that system also.

The question I'm sure you want to ask, then, is "what's different between the two images?" Unfortunately, I don't know. The hardware, kernel configuration, and device tree are all the same in the working and non-working images. They even use the same rootfs. That's doesn't leave much else, which is what has me so stumped.
 
Old 03-26-2019, 05:26 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
The mmcblk error sounds like a sdcard issue, probably ext2 filesystem not unmounted. You can update that to ext3/4, but fsck it anyway.

The 'no power on vcc' IS a hardware issue. It can happen that something old-fashioned wants 5V and is only getting 3.3V. You may be able to power the port externally via the devices plugged in, or the design may be lacking. I don't really care, if you don't, but all serious thinking on usb stops until those errors go. You looked for a possible usb fault; I found 2. Your move.
 
Old 03-27-2019, 10:14 PM   #9
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Original Poster
Rep: Reputation: 19
I understand those issues look bad, but I can confirm that they are not related (as I mentioned in the previous post, an older version of PetaLinux creates images for which the USB port works fine, and those messages appear there too).

In fact, my most recent tests seem to indicate that the FPGA program may actually be at fault. I'm getting the FPGA team involved at this point to see if we can find a problem there. The same kernel, device tree, and rootfs can all be used, and USB works fine (those dmesg errors are still present). The only change is that I used the BOOT.BIN file from the vendor BSP.
 
Old 03-28-2019, 05:44 AM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Let's see what the FPGA nerds come up with. They should fix those errors while they're at it. You could be powering something with a logic high, which is bad for business and lousy engineering. Post when they pass it back to you with their results.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Usb device not enumerated properly in ubuntu14.04 LTS mrigendra Linux - Newbie 2 07-17-2016 10:32 AM
USB devices cannot be read or enumerated with xhci-hcd psitae Linux - Newbie 5 02-12-2016 08:37 PM
check enumerated files available mzh Linux - General 4 07-21-2012 08:32 AM
MYSQL enumerated field eodchop Linux - Enterprise 0 06-08-2009 08:34 AM
C Enumerated Types / Function Pointer Errors Centinul Programming 8 11-07-2006 07:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 07:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration