USB on embedded Linux - TI hub TUSB2046B doesn't detect USB devices - usb

I have a problem on embedded platform with very limited toolchain. I have TI Hub connected to USB host on chip. This hub seems to be detected properly, but sierra wireless SL6087 device that I connect to it, doesn't appear in system. Unfortunately I can't use USB Device Filesystem - I have no /proc/bus/usb. What I can do is read /sys direct.
I get following system log with and without modul connected. I also don't see any communication on D+ and D- lines. kernel 2.6.21.
# dmesg | grep -e hub -e usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usbmon: debugfs is not available
rt3xxx-ohci rt3xxx-ohci: roothub.a 02000202 POTPGT=2 NPS NDP=2(2)
rt3xxx-ohci rt3xxx-ohci: roothub.b 00000000 PPCM=0000 DR=0000
rt3xxx-ohci rt3xxx-ohci: roothub.status 00008000 DRWE
rt3xxx-ohci rt3xxx-ohci: roothub.portstatus [0] 0x00000100 PPS
rt3xxx-ohci rt3xxx-ohci: roothub.portstatus [1] 0x00000100 PPS
usb usb1: default language 0x0409
usb usb1: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: RT3xxx OHCI Controller
usb usb1: Manufacturer: Linux 2.6.21 ohci_hcd
usb usb1: SerialNumber: rt3xxx-ohci
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: 2 ports detected
hub 1-0:1.0: standalone hub
hub 1-0:1.0: no power switching (usb 1.0)
hub 1-0:1.0: global over-current protection
hub 1-0:1.0: power on to power good time: 4ms
hub 1-0:1.0: local power source is good
hub 1-0:1.0: no over-current condition exists
hub 1-0:1.0: trying to enable port power on non-switchable hub
hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0000
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
drivers/usb/serial/usb-serial.c: USB Serial support registered for Sierra USB modem
usbcore: registered new interface driver sierra
drivers/usb/serial/sierra.c: USB Driver for Sierra Wireless USB modems: v.1.7.40

Check your VBUS. Are you getting the +5V going to your devices?
When you connect the device, is there any log file change? These are the things I would try. Sometimes it is as simple as following an enable/reset line on the schematic and setting a GPIO properly.
NOTE: If you do get a log file change when you insert the device, then you probably are just missing the other side of the process; the driver.

Related

STM32H743 with USB HS, FUSB2805 not detected

I have a custom board with STM32H743VIT6 connected to an external USB HS PHY, the FUSB2805MLX.
I am trying to run a bare minimum example setup in STM32CubeMx. Just including a USB HS connection and the device in USB VCP mode.
The pin setup is correct, and the external clocks on the PHY are correct (26MHz in, generates 60MHz on CLK line between MCU and PHY).
I can see that the 60Mhz line is shut down after the call to USBD_Start(&hUsbDeviceHs)
The data lines are pulled high at the same time.
The relevant pinout is:
PA3 -> USB_OTG_HS_ULPI_DO
PA5 -> USB_OTG_HS_ULPI_CK
PB0 -> USB_OTG_HS_ULPI_D1
PB1 -> USB_OTG_HS_ULPI_D2
PB5 -> USB_OTG_HS_ULPI_D7
PB10 -> USB_OTG_HS_ULPI_D3
PB11 -> USB_OTG_HS_ULPI_D4
PB12 -> USB_OTG_HS_ULPI_D5
PB13 -> USB_OTG_HS_ULPI_D6
PC0 -> USB_OTG_HS_ULPI_STP
PC2_C -> USB_OTG_HS_ULPI_DIR
PC3_C -> USB_OTG_HS_ULPI_NXT
However, i cannot get this to work.
The code runs without errors and debugging through it doesn't give me any idea of what might be wrong. All functions return with HAL_OK
The computer does not detect the USB device.
sudo dmesg | grep usb gives the following output
[27482.966148] usb usb3-port7: attempt power cycle
[27483.622018] usb 3-7: new low-speed USB device number 32 using xhci_hcd
[27483.622532] usb 3-7: Device not responding to setup address.
[27483.830337] usb 3-7: Device not responding to setup address.
[27484.041933] usb 3-7: device not accepting address 32, error -71
[27484.173925] usb 3-7: new low-speed USB device number 33 using xhci_hcd
[27484.174414] usb 3-7: Device not responding to setup address.
[27484.382364] usb 3-7: Device not responding to setup address.
[27484.589893] usb 3-7: device not accepting address 33, error -71
[27484.590002] usb usb3-port7: unable to enumerate USB device
[81863.025532] usb 3-3: reset full-speed USB device number 3 using xhci_hcd
[82185.873876] usb 3-3: reset full-speed USB device number 3 using xhci_hcd
[82306.336339] usb 3-3: reset full-speed USB device number 3 using xhci_hcd
[82758.471075] usb 3-3: reset full-speed USB device number 3 using xhci_hcd
It's the same using the USB_DEVICE Middleware in Mass Storace Class mode.
Are there any tricks to getting ULPI USB HS to work on this MCU?

STM32 USB connection problem on windows 7

I have a board based on stm32f103cb with a USB connection in CDC device mode to connect with PC.
On windows 10 this board is recognized as a virtual com port but in windows 7 it is not.
I used Keil IDE and CMSIS library to configure the project.
One pin is defined as output to connect USB D+ pin via a resistor to 3.3V.
I installed STM32 USB Virtual COM port driver Win7 but anyway it is not working.
Windows 7 throws error code 29.
Any ideas or info very much appreciated.

how to hotplug USB device on Qemu 4.2.0?

I have Qemu 4.2.0 with Debian Testing Bullseye and Kernel 5.4.0 and I need to hotplug and unplug an USB device.
Currently I attach my USB device with
qemu... -usb -device usb-host,hostbus=x,hostaddr=y
but when I physically remove the device I can't longer detect it from within the VM (Win7).
So, what should I do to send a plug/unplug usb signal to the virtual machine??
You can do plug/unplug via qemu monitor. see https://en.wikibooks.org/wiki/QEMU/Monitor.
To hot plug a usb device, type bellow in qemu monitor:
(qemu) device_add usb-host,hostbus=2,hostport=1.2.2,id=idofyourdevice
To remove a usb device, type bellow in qemu monitor:
(qemu) device_del idofyourdevice

List UART -> COM converter in Windows Device Portal

I have Raspberry Pi 3 plate with connected USB to UART (COM) converter.
The power led on the USB stick is ON.
I can not find the converter in Windows Device Portal.
In both: connected and disconnected states I see just two UART related records in Device Manager:
(ID:ACPI\BCM2835\0, Class:System, Manufacturer:Microsoft, StatusCode:25165834)
>BCM283x Mini UART Serial Device
(ID:ACPI\BCM2836\0, Class:Ports, Manufacturer:Microsoft, StatusCode:25182218)
>ARM PL011 UART Device Driver
(ID:ACPI\BCM2837\4, Class:System, Manufacturer:Microsoft, StatusCode:25165834)
Also I use git diff between saved device lists and there is no difference between the case I connect USB stick and disconnect it.
Where can I see the device in the list?
UPDATE
Here I print all found devices:
First you need make sure your USB to UART (COM) converter is supported on Windows IoT Core. Please check the hardware compatibility list. The CP2102 USB 2.0 to TTL Module Serial Converter is supported.
I use CP2102 USB to UART Bridge Converter and it also works. Use the SerialUART sample can list two device: one is on-board PL011 UART Device and the other is mine.
From device portal:

Getting Hotplug react when plugging 3G netstick (with mdev)

I'm trying to get a device running embedded linux V-2.6.31 to automatically recognize when a Huawei 3G usb stick is plugged to it, run usb_modeswitch, and communicate with the module.
it seems that usb_modeswitch doesn't work well in a system that has mdev, since the path /dev/bus/usb is only being created with udev.
I found a script that create this path and enable usb_modeswitch to work properly.
now, all i need is automation of this process, e.g., when plugging the 3G module, hotplug will first call my script, and then usb_modeswitch.
the problem is that when plugging the 3G module nothing happens when the enumeration is done (the hotplug wont run), see trace:
[83175.520000] usb 2-1: new full speed USB device using bcm5892-ohci:PORT-2 and address 3
[83175.730000] usb 2-1: not running at top speed; connect to a high speed hub
[83175.750000] usb 2-1: New USB device found, idVendor=12d1, idProduct=1f1c
[83175.760000] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[83175.770000] usb 2-1: Product: HUAWEI Mobile
[83175.770000] usb 2-1: Manufacturer: Vodafone(Huawei)
[83175.780000] usb 2-1: SerialNumber: FFFFFFFFFFFFFFFF
[83175.800000] usb 2-1: configuration #1 chosen from 2 choices
[83175.870000] scsi1 : SCSI emulation for USB Mass Storage devices
[83180.910000] scsi 1:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
I'm not sure what is wrong, is there something i didn't enable? is there a KO that i need to load in order for it to work?
Thank you in advance!