STM32H743 with USB HS, FUSB2805 not detected - usb

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?

Related

i.MX6 ULL based device sometimes can't open USB camera

We are attempting to debug an issue that we are seeing with some devices where the camera module starts/stops working sometimes after a power cycle. A working camera can stop working and a non working camera can start working without any change to the device.
With the devices that no longer take photos we get messages as shown below in the kernel log:
[ 20.153600] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 20.398490] usb 1-1: unable to read config index 0 descriptor/all
[ 20.403538] usb 1-1: can't read configurations, error -32
[ 20.543572] usb 1-1: new high-speed USB device number 3 using ci_hdrc
[ 20.746370] usb 1-1: device descriptor read/all, error -71
[ 20.883987] usb 1-1: new high-speed USB device number 4 using ci_hdrc
[ 21.333593] usb 1-1: device not accepting address 4, error -71
some other devices will show
[ 20.243591] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 20.448903] usb 1-1: unable to read config index 0 descriptor/start: -32
[ 20.454553] usb 1-1: chopping to 0 config(s)
[ 20.478077] usb 1-1: no configuration chosen from 0 choices
On the functioning devices we see this instead
[ 19.933590] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 20.294390] uvcvideo: Found UVC 1.00 device MikrOkularFullHD (053a:9230)
[ 20.308968] input: MikrOkularFullHD as /devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1:1.0/input/input1
[ 20.320578] evbug: Connected device: input1 (MikrOkularFullHD at usb-ci_hdrc.1-1/button)
[ 20.327982] usbcore: registered new interface driver uvcvideo
[ 20.332528] USB Video Class driver (1.1.1)
We've tried rebooting the device, leaving it off for a few minutes then turning it back on (in case overcurrent was the issue) - but none of that has worked so far.
We are running Linux version 4.9.11-1.0.0+gc27010d
May be a power supply issue. Just use a powered usb hub to see if there are no problems.
If this resolves the issue, try to increase the capacitor in the usb power rail.

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:

How to use both UARTs on Raspberry Pi 3 Compute module

I am working on a project which has a Raspberry Pi 3 Compute Module integrated into a hardware design where the PCB provides access to both Serial Ports on the compute module:
One serial port with TX/RX on GPIO 14/15 (pins 51/53 of module)
One serial port with CTS/RTS/TX/RX on GPIO 31/31/32/33 (pins 34/36/46/48 of the module)
As far as I understand there is one full 16650 compatible UART available in the BCM2835 called the "PL011", and one mini-UART which is normally used to communicate with the internal BlueTooth chip.
When booting Raspbian Jesse, I see the /dev/ttyAMA0 device which seems to communicate on GPIO pins 14/15, and according to what I have read this communication runs through the PL011 full UART chip. I have tried to create a /boot/config.txt file which has the following device tree overlays:
dtoverlay=uart1,txd1_pin=32,rxd1_pin=33
enable_uart=1
This does not seem to provide me with a /dev/ttyAMA1 device. This seems consistent with the description in the /boot/overlays/README file which states:
Name: Uart1
Info: Enable uart1 in place of uart0
I did find a limited driver for the mini-UART which is fixed at 115200 baud, which seems like a driver to use the mini-UART instead of the full UART.
What I'd like to do is: without redesigning the hardware, configure the "PL011" full UART to use the CTS/RTS/TX/RX port, and the mini-UART to use the TX/RX port, so that I can use both serial ports in my application.

how can the computer distinguishes between keyboard USB and mouse USB?

Wondering how can the PC distinguish among multiple USBs. For example, when i plug my flash drive USB into my computer how can it know that it is a flash drive USB not a keyboard USB ?
Thanks in advance.
in the USB standard there are USB classes a memory stick is USB mass storage class, keyboard, mouse, joystick are USB HID class (Human Interface Device), cameras implement USB PTP (picture transfer protocol), USB-to-serial (virtual COM ports,...) is USB CDC ACM class ,...
the following link lists all USB classes for that windows has drivers https://msdn.microsoft.com/en-us/library/windows/hardware/ff538820%28v=vs.85%29.aspx
when the USB device is plugged in there is a communication between the MCU on the USB device (firmware) and the PC (USB host) . in this communication the device says which USB class it it and the host loads the fitting driver
you can sniff this communication using wireshark or see dmesg (on linux)
this communication is very low-level and not easily human-readable. there are tools like wireshark or lsusb -v for this
a USB device has to implement a special hierarchy of descriptors in which information of the internal structure of the USB device is contained. the hierachy is:
device descriptor -> configuration descriptor -> interface descriptor -> endpoint descriptor
EP0 is reserved for control transfers, else any transfer has to go to or come from an endpoint (OUT endpoint / IN endpoint)
see http://www.beyondlogic.org/usbnutshell/usb1.shtml
USB is a higly complex standard because it implements a wide functionality for a large number of different devices in one physical interface. i think the most complicated USB class standard is USB audio...

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!