diff --git a/arch/arm/soc/st_stm32/stm32f2/dts.fixup b/arch/arm/soc/st_stm32/stm32f2/dts.fixup index b7a504ede74..3e4b48647bc 100644 --- a/arch/arm/soc/st_stm32/stm32f2/dts.fixup +++ b/arch/arm/soc/st_stm32/stm32f2/dts.fixup @@ -38,4 +38,10 @@ #define CONFIG_UART_STM32_UART_5_IRQ_PRI ST_STM32_UART_40005000_IRQ_0_PRIORITY #define UART_5_IRQ ST_STM32_UART_40005000_IRQ_0 +#define CONFIG_USB_BASE_ADDRESS ST_STM32_OTGFS_50000000_BASE_ADDRESS +#define CONFIG_USB_IRQ ST_STM32_OTGFS_50000000_IRQ_OTGFS +#define CONFIG_USB_IRQ_PRI ST_STM32_OTGFS_50000000_IRQ_OTGFS_PRIORITY +#define CONFIG_USB_NUM_BIDIR_ENDPOINTS ST_STM32_OTGFS_50000000_NUM_BIDIR_ENDPOINTS +#define CONFIG_USB_RAM_SIZE ST_STM32_OTGFS_50000000_RAM_SIZE + /* End of SoC Level DTS fixup file */ diff --git a/drivers/pinmux/stm32/pinmux_stm32f2.h b/drivers/pinmux/stm32/pinmux_stm32f2.h index 765392f1090..10a2d5311ae 100644 --- a/drivers/pinmux/stm32/pinmux_stm32f2.h +++ b/drivers/pinmux/stm32/pinmux_stm32f2.h @@ -40,6 +40,12 @@ #define STM32F2_PINMUX_FUNC_PA10_USART1_RX \ (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP) +#define STM32F2_PINMUX_FUNC_PA11_OTG_FS_DM \ + (STM32_PINMUX_ALT_FUNC_10 | STM32_PUSHPULL_NOPULL) + +#define STM32F2_PINMUX_FUNC_PA12_OTG_FS_DP \ + (STM32_PINMUX_ALT_FUNC_10 | STM32_PUSHPULL_NOPULL) + /* Port B */ #define STM32F2_PINMUX_FUNC_PB6_USART1_TX \ (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP) diff --git a/drivers/usb/device/Kconfig b/drivers/usb/device/Kconfig index 71c2bd32b43..11c6be44e42 100644 --- a/drivers/usb/device/Kconfig +++ b/drivers/usb/device/Kconfig @@ -38,7 +38,7 @@ config USB_DC_STM32 select USE_STM32_HAL_PCD_EX select HAS_DTS_USB help - Enable USB support on the STM32 F0, F1, F3, F4, F7, L0 and L4 family of + Enable USB support on the STM32 F0, F1, F2, F3, F4, F7, L0 and L4 family of processors. config USB_DC_SAM0 diff --git a/dts/arm/st/stm32f2.dtsi b/dts/arm/st/stm32f2.dtsi index 483a7a27cdd..0b4935c4ec5 100644 --- a/dts/arm/st/stm32f2.dtsi +++ b/dts/arm/st/stm32f2.dtsi @@ -191,6 +191,17 @@ status = "disabled"; label = "UART_5"; }; + + usbotg_fs: usb@50000000 { + compatible = "st,stm32-otgfs"; + reg = <0x50000000 0x40000>; + interrupts = <67 0>; + interrupt-names = "otgfs"; + num-bidir-endpoints = <4>; + ram-size = <1280>; + status = "disabled"; + label = "OTGFS"; + }; }; };