Hi!
I'm currently trying to get USB on a STM32G0B0 running. While booting i get the following error on the Linux Workstation:
[ 691.189913] usb 1-5.2: new full-speed USB device number 15 using xhci_hcd
[ 691.277922] usb 1-5.2: device descriptor read/64, error -32
[ 691.469995] usb 1-5.2: device descriptor read/64, error -32
[ 691.661146] usb 1-5.2: new full-speed USB device number 16 using xhci_hcd
[ 691.737987] usb 1-5.2: device descriptor read/64, error -32
[ 691.929996] usb 1-5.2: device descriptor read/64, error -32
[ 692.042587] usb 1-5-port2: attempt power cycle
[ 692.661884] usb 1-5.2: new full-speed USB device number 17 using xhci_hcd
[ 692.662050] usb 1-5.2: Device not responding to setup address.
[ 692.870040] usb 1-5.2: Device not responding to setup address.
[ 693.077908] usb 1-5.2: device not accepting address 17, error -71
[ 693.157913] usb 1-5.2: new full-speed USB device number 18 using xhci_hcd
[ 693.158048] usb 1-5.2: Device not responding to setup address.
[ 693.366043] usb 1-5.2: Device not responding to setup address.
[ 693.573869] usb 1-5.2: device not accepting address 18, error -71
[ 693.574633] usb 1-5-port2: unable to enumerate USB device
I use the following dev tree clock config:
/* clock config for external 8 MHz crystal and 48 MHz system clock for USB */
&clk_hse {
status = "okay";
clock-frequency = <DT_FREQ_M(8)>;
};
&pll {
div-m = <1>;
mul-n = <12>;
div-p = <2>;
div-q = <2>;
div-r = <2>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(48)>;
ahb-prescaler = <1>;
apb1-prescaler = <1>;
};
/ {
chosen {
zephyr,console = &cdc_acm_uart0;
};
};
with the following app overlay:
&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
the following def and project configuration is applied:
# Zephyr Kernel Configuration
CONFIG_SOC_SERIES_STM32G0X=y
CONFIG_SOC_STM32G0B0XX=y
# Enable MPU
CONFIG_ARM_MPU=y
# Serial Drivers
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Pinmux Driver
CONFIG_PINMUX=y
# GPIO Controller
CONFIG_GPIO=y
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# 48 MHz system clock (48 MHz is max for USB)
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
# config peripherals
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_SPI=n
CONFIG_I2C=n
# configs for USB console
# CONFIG_USB=y
CONFIG_USB_DEVICE_DRIVER=y
CONFIG_USB_DC_STM32=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="#arve USB console"
CONFIG_USB_CDC_ACM=y
CONFIG_USB_UART_CONSOLE=y
CONFIG_USB_CDC_ACM_LOG_LEVEL_ERR=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_LINE_CTRL=y
#CONFIG_UART_CONSOLE_ON_DEV_NAME="CDC_ACM"
CONFIG_USB_COMPOSITE_DEVICE=n
CONFIG_USB_MASS_STORAGE=n
# config logging
CONFIG_LOG=y
CONFIG_PRINTK=y
CONFIG_LOG_PRINTK=y
CONFIG_LOG_BUFFER_SIZE=2048
The application is a simple blinky with usb console which works perfectly on an STM32H743vi.
The STM32G0B0 is on a custom boad which seems to work perfectly with internal and external clock.
Many thanks for your help in advance!
BR
Thomas