Giter Site home page Giter Site logo

Comments (9)

jfischer-no avatar jfischer-no commented on September 18, 2024 1

This is likely specific to the stm32h747i_disco board and not the driver?

stm32h747i_disco/stm32h747xx/m7 has external ulpi phy, the issue is likely in the driver

#define USB_OTG_HS_ULPI_PHY (DT_HAS_COMPAT_STATUS_OKAY(usb_ulpi_phy) && \
DT_HAS_COMPAT_STATUS_OKAY(st_stm32_otghs))

#if USB_OTG_HS_ULPI_PHY
#if defined(CONFIG_SOC_SERIES_STM32H7X)
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_USB1OTGHSULPI);
#else
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_OTGHSULPI);
#endif
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_otghs) /* USB_OTG_HS_ULPI_PHY */
/* Disable ULPI interface (for external high-speed PHY) clock in sleep/low-power mode. It is
* disabled by default in run power mode, no need to disable it.
*/
#if defined(CONFIG_SOC_SERIES_STM32H7X)
LL_AHB1_GRP1_DisableClockSleep(LL_AHB1_GRP1_PERIPH_USB1OTGHSULPI);
#else
LL_AHB1_GRP1_DisableClockLowPower(LL_AHB1_GRP1_PERIPH_OTGHSULPI);
#endif /* defined(CONFIG_SOC_SERIES_STM32H7X) */
#if USB_OTG_HS_EMB_PHY
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_OTGPHYC);
#endif
#elif defined(CONFIG_SOC_SERIES_STM32H7X) && DT_HAS_COMPAT_STATUS_OKAY(st_stm32_otgfs)
/* The USB2 controller only works in FS mode, but the ULPI clock needs
* to be disabled in sleep mode for it to work.
*/
LL_AHB1_GRP1_DisableClockSleep(LL_AHB1_GRP1_PERIPH_USB2OTGHSULPI);
#endif /* USB_OTG_HS_ULPI_PHY */

from zephyr.

henrikbrixandersen avatar henrikbrixandersen commented on September 18, 2024

CC: @erwango

from zephyr.

henrikbrixandersen avatar henrikbrixandersen commented on September 18, 2024

Please re-test with #75129

from zephyr.

ddavidebor avatar ddavidebor commented on September 18, 2024

I'm afraid the result is the same

This builds successfully, and works correctly:

west build --pristine -b stm32h747i_disco/stm32h747xx/m7 samples/subsys/usb/cdc_acm

This is not recognised by the computer, and displays no log when the USB host is connected or disconnected, and the device doesn't appear with MacOS system report / lsusb

west build --pristine -b stm32h747i_disco/stm32h747xx/m7 samples/subsys/usb/cdc_acm -DCONF_FILE=usbd_next_prj.conf

from zephyr.

erwango avatar erwango commented on September 18, 2024

@loicpoulain Would you mind having a look ?

from zephyr.

ddavidebor avatar ddavidebor commented on September 18, 2024

Please let me know if you need the development kit :-)

from zephyr.

henrikbrixandersen avatar henrikbrixandersen commented on September 18, 2024

I have tried to reproduce this error this on the stm32h735g_disco board using 768b8bb, but it seems to work fine?

  • west build -b stm32h735g_disco/stm32h735xx samples/subsys/usb/cdc_acm -- -DCONF_FILE="usbd_next_prj.conf"
  • west flash

Console log:

*** Booting Zephyr OS build v3.7.0-rc2-45-g768b8bbca30a ***
[00:00:00.010,000] <inf> cdc_acm_echo: USB device support enabled
[00:00:00.010,000] <inf> cdc_acm_echo: Wait for DTR
[00:00:00.016,000] <inf> cdc_acm_echo: USBD message: Device suspended
[00:00:00.185,000] <inf> cdc_acm_echo: USBD message: Bus reset
[00:00:07.196,000] <inf> cdc_acm_echo: USBD message: CDC ACM line coding
[00:00:07.196,000] <inf> cdc_acm_echo: Baudrate 9600

Linux dmesg logs:

[53097.516088] usb 2-3.1: new full-speed USB device number 23 using xhci_hcd
[53097.620789] usb 2-3.1: New USB device found, idVendor=2fe3, idProduct=0001, bcdDevice= 3.07
[53097.620801] usb 2-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[53097.620803] usb 2-3.1: Product: USBD CDC ACM sample
[53097.620805] usb 2-3.1: Manufacturer: Zephyr Project
[53097.620807] usb 2-3.1: SerialNumber: 383233313139511900120037
[53097.623414] cdc_acm 2-3.1:1.0: ttyACM1: USB ACM device

This is likely specific to the stm32h747i_disco board and not the driver?

from zephyr.

FRASTM avatar FRASTM commented on September 18, 2024

I suspect something around the IRQ: when one global irq is configured in the usbotg_hs node (of the stm32h745.dtsi)

			interrupts = <77 0>;
			interrupt-names = "otghs";

or when the list of interrupts is reversed:

			interrupts = <77 0>, <76 0>, <75 0>, <74 0>;
			interrupt-names = "otghs", "wkup", "ep1_in", "ep1_out";

The plug in the usb_otg_hs connector is detected :

*** Booting Zephyr OS build v3.7.0-rc2-455-g67544a6d2df3 ***                                                         
[00:00:00.010,000] <inf> cdc_acm_echo: USB device support enabled                                                    
[00:00:00.010,000] <inf> cdc_acm_echo: Wait for DTR                                                                  
[00:00:00.016,000] <inf> cdc_acm_echo: USBD message: Device suspended                                                
[00:00:01.726,000] <inf> cdc_acm_echo: USBD message: Bus reset                                                       
[00:00:01.807,000] <inf> cdc_acm_echo: USBD message: Bus reset                                                       
[00:00:01.907,000] <inf> cdc_acm_echo: USBD message: Bus reset                                                       
[00:00:01.986,000] <inf> cdc_acm_echo: USBD message: Bus reset                                                       
[00:00:02.077,000] <wrn> udc: Spurious suspend/resume event                                                          
[00:00:02.077,000] <inf> cdc_acm_echo: USBD message: Device suspended                                                
[00:00:02.402,000] <inf> cdc_acm_echo: USBD message: Bus reset                                                       
[00:00:02.423,000] <inf> cdc_acm_echo: USBD message: Bus reset                                                       
[00:00:02.711,000] <inf> cdc_acm_echo: USBD message: Bus reset                                                       
[00:00:02.802,000] <wrn> udc: Spurious suspend/resume event                                                          
[00:00:02.802,000] <inf> cdc_acm_echo: USBD message: Device suspended 

from zephyr.

ddavidebor avatar ddavidebor commented on September 18, 2024

Thank you guys !

from zephyr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.