Skip to content

nucleo_wba65ri: USB device support is missing #96705

@stefanb2

Description

@stefanb2

Is your feature request related to a problem? Please describe.

To quote from DS14726 - STM32WBA6xxx Datasheet:

Communication peripherals

  • One USB OTG high-speed with embedded PHY

nucleo_wba65ri has a 2nd USB-C connector for the SoC. But the necessary devicetree definitions, SoC USB devicetree macros and (maybe) STM32 USB driver support are missing, so you can't use it.

NOTE: this issue was first raised in discussion item #90098

Describe the solution you'd like

I would like to build zephyr/samples/subsys/usb/cdc_acm for nucleo_wba65ri.

Describe alternatives you've considered

I tried to get the USB support to work for nucleo_wba65ri by adding the following file to the Zephyr tree. This is derived from STM32H745 devicetree with changes from RM0515 document. It is probably not 100% correct yet. But at least the build progresses until it fails on the STM32 USB driver code due to missing low-level defines for the SoC:

/*
 * zephyr/samples/subsys/usb/cdc_acm/boards/nucleo_wba65ri.overlay
 */

#define USB_SEL(val) STM32_DT_CLOCK_SELECT((val), 3, 28, CCIPR2_REG)

/ {
        soc {
                usbotg_hs: usb@42060000 {
                        compatible = "st,stm32-otghs";
                        reg = <0x42060000 0x40000>;
                        interrupts = <74 0>, <75 0>, <76 0>, <77 0>;
                        interrupt-names = "ep1_out", "ep1_in", "wkup", "otghs";
                        num-bidir-endpoints = <9>;
                        ram-size = <4096>;
                        maximum-speed = "high-speed";
                        clocks = <&rcc STM32_CLOCK(AHB1, 25U)>,
                                 <&rcc STM32_SRC_HSE USB_SEL(0)>;
                        phys = <&otghs_fs_phy>;
                        status = "disabled";
                };
        };

        otghs_fs_phy: otghs_fs_phy {
                compatible = "usb-nop-xceiv";
                #phy-cells = <0>;
        };
};

zephyr_udc0: &usbotg_hs {
        pinctrl-0 = <&usb_otg_hs_dm_pd7 &usb_otg_hs_dp_pd6>;
        pinctrl-names = "default";
        status = "okay";
};

&zephyr_udc0 {
        cdc_acm_uart0 {
                compatible = "zephyr,cdc-acm-uart";
                label = "Zephyr USB CDC-ACM";
        };
};

I tested with Zephyr 4.2.99 @ 6c75315c86132740091fe4353000bdac293bd8dd

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions