cbrake
August 17, 2023, 9:22pm
1
We’ve been using Zephyr on a custom STM32H743 board with fairly good results. We continue to have USB high-speed problems so I wanted to compare the operation to a STM32H743 board running full-speed USB. The Nucleo board is supported in Zephyr and the CDC-ACM sample compiled and ran perfectly with the following build commands:
west build -b nucleo_h743zi samples/subsys/usb/cdc_acm -p && west flash
So back to debugging high-speed USB …
1 Like
Am I correct in thinking that the STM32H7 chips do not have a USB high-speed PHY, and therefore you have to use an external phy?
I have also been considering USB on ZephyrRTOS, but am not sure about the quality of the stack, have you faced any issues, or have any concerns?
cbrake
August 23, 2023, 2:14pm
3
Hi @nicstarke – welcome to the TMPDIR community!
Correct, the STM32H7 requires an external phy for HS USB.
Yes, we are working through some issues, but I think some of them are hardware-related. You can follow the progress here:
opened 10:15PM - 02 May 23 UTC
bug
priority: low
area: Drivers
area: USB
platform: STM32
**Describe the bug**
We have a custom STM32H743 board configured for High-Spe… ed USB CDC ACM Uart. The device will enumerate and we can receive data from the devices, but can't send data.
We have tried it on a NUCLEO-H743ZI2 (full speed) and it works fine there, so it may be related to the high speed with external ULPI PHY.
The Custom High-Speed USB board does work with TinyUSB running under FreeRTOS, so the hardware has been proven with that software. We are in the process of transitioning from FreeRTOS to Zephyr.
**To Reproduce**
Steps to reproduce the behavior:
We ran the `samples/subsys/usb/cdc_acm` on the custom board and it does not echo data back. We have modified the test to send some data from the device to the host and that works fine, but it does not receive data.
We never see the UART (USB CDC ACM) callback functions called on the device to indicate data is received.
**Expected behavior**
We need data flowing from host -> device.
One interesting point is that with a USB sniffer, we don't see the data the host sends on the USB bus. If we are sending from a terminal, it blocks like the driver never sent the data. Will add USB traces in a bit.
**Impact**
What impact does this issue have on your progress: showstopper
**Logs and console output**
Will post USB and other traces in additional comments.
**Environment (please complete the following information):**
- OS: Linux
- Toolchain: Zephyr SDK
- Commit: ef3d01d16fd462805565d83443db7a7bd38d306d (recent Zephyr HEAD)
**Additional context**
See DTS and config:
[custom_board_conifg.zip](https://github.com/zephyrproject-rtos/zephyr/files/11378069/custom_board_conifg.zip)
Possibly related issues:
* https://github.com/zephyrproject-rtos/zephyr/issues/52420
* https://github.com/zephyrproject-rtos/zephyr/issues/54162
I plan to write a bandwidth test app once I have the STM32H747I-DISCO dev board up.
cbrake
August 24, 2023, 8:40pm
4
STM32H747I-DISCO development board arrived with HS USB:
I’m always amazed at how quick and easy it is to build and program Zephyr on these things:
west build -b stm32h747i_disco_m7 samples/subsys/usb/cdc_acm && west flash
With the cdc_acm
sample, HS USB is behaving well.
1 Like
cbrake
September 13, 2023, 8:15pm
5
Discovered the power to the USB Phy IO power was floating, so after we fixed that, the USB on our custom STM32H7 board is now reliable and matches dev boards. The odd thing is that it worked fine on some boards, so enough power must have been leaking from other paths to be marginal.
khem
September 14, 2023, 3:13am
6
wow ! these are hard issues to nail down.