diff --git a/arch/arm/src/stm32/Make.defs b/arch/arm/src/stm32/Make.defs index 516cc434e3..a0a01b1037 100644 --- a/arch/arm/src/stm32/Make.defs +++ b/arch/arm/src/stm32/Make.defs @@ -65,8 +65,16 @@ CHIP_ASRCS = CHIP_CSRCS = stm32_allocateheap.c stm32_start.c stm32_rcc.c stm32_lse.c \ stm32_gpio.c stm32_exti.c stm32_flash.c stm32_irq.c \ stm32_timerisr.c stm32_dma.c stm32_lowputc.c stm32_serial.c \ - stm32_spi.c stm32_usbdev.c stm32_sdio.c stm32_tim.c stm32_i2c.c \ - stm32_waste.c + stm32_spi.c stm32_sdio.c stm32_tim.c stm32_i2c.c stm32_waste.c + +ifeq ($(CONFIG_USBDEV),y) +ifeq ($(CONFIG_STM32_USB),y) +CMN_CSRCS += stm32_usbdev.c +endif +ifeq ($(CONFIG_STM32_OTGFS),y) +CMN_CSRCS += stm32_otgfsdev.c +endif +endif ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y) CHIP_ASRCS += stm32_vectors.S diff --git a/arch/arm/src/stm32/chip/stm32_usbotgfs.h b/arch/arm/src/stm32/chip/stm32_usbotgfs.h index 8fcbd78ebb..cdf0c1014d 100644 --- a/arch/arm/src/stm32/chip/stm32_usbotgfs.h +++ b/arch/arm/src/stm32/chip/stm32_usbotgfs.h @@ -86,7 +86,7 @@ #define STM32_OTGFS_HCCHAR_OFFSET 0x0000 /* Host channel characteristics register */ #define STM32_OTGFS_HCINT_OFFSET 0x0008 /* Host channel interrupt register */ #define STM32_OTGFS_HCINTMSK_OFFSET 0x000c /* Host channel interrupt mask register */ -#define STM32_OTGFS_HCTSIZ0_OFFSET 0x0010 /* Host channel interrupt register */ +#define STM32_OTGFS_HCTSIZ_OFFSET 0x0010 /* Host channel interrupt register */ #define STM32_OTGFS_HCCHAR_OFFSET(n) (0x500 + ((n) << 5)) #define STM32_OTGFS_HCCHAR0_OFFSET 0x0500 /* Host channel-0 characteristics register */ diff --git a/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h b/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h index 5cb0f724cf..50e38f6ba1 100644 --- a/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h +++ b/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h @@ -367,12 +367,12 @@ /* OTG FS/HS */ -#define GPIO_OTGFS_DM (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN11) -#define GPIO_OTGFS_DP (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN12) -#define GPIO_OTGFS_ID (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN10) +#define GPIO_OTGFS_DM (GPIO_ALT|GPIO_FLOAT|GPIO_AF10|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11) +#define GPIO_OTGFS_DP (GPIO_ALT|GPIO_FLOAT|GPIO_AF10|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN12) +#define GPIO_OTGFS_ID (GPIO_ALT|GPIO_PULLUP|GPIO_AF10|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN10) #define GPIO_OTGFS_SCL (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN8) #define GPIO_OTGFS_SDA (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN9) -#define GPIO_OTGFS_SOF (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN8) +#define GPIO_OTGFS_SOF (GPIO_ALT|GPIO_FLOAT|GPIO_AF10|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN8) #define GPIO_OTGHS_DM (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN14) #define GPIO_OTGHS_DP (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN15)