diff --git a/hw/bsp/stm32h743eval/board.mk b/hw/bsp/stm32h743eval/board.mk index 549249d24..5044cdc08 100644 --- a/hw/bsp/stm32h743eval/board.mk +++ b/hw/bsp/stm32h743eval/board.mk @@ -7,7 +7,12 @@ CFLAGS += \ -mfpu=fpv5-d16 \ -nostdlib -nostartfiles \ -DSTM32H743xx \ - -DCFG_TUSB_MCU=OPT_MCU_STM32H7 + -DCFG_TUSB_MCU=OPT_MCU_STM32H7 \ + +# Board specific for using usb ports +CFLAGS += \ + -DCFG_BOARD_DEVICE_RHPORT_NUM=1 \ + -DCFG_BOARD_DEVICE_RHPORT_HIGHSPEED # suppress warning caused by vendor mcu driver CFLAGS += -Wno-error=maybe-uninitialized diff --git a/hw/bsp/stm32h743eval/stm32h743eval.c b/hw/bsp/stm32h743eval/stm32h743eval.c index ef9d575ac..5a7934ea2 100644 --- a/hw/bsp/stm32h743eval/stm32h743eval.c +++ b/hw/bsp/stm32h743eval/stm32h743eval.c @@ -187,8 +187,16 @@ void board_init(void) GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct); - // USB Pin Init - // PA9- VUSB, PA10- ID, PA11- DM, PA12- DP +#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE + + // USB1 HS (ULPI Phy), internal FS PHY + // PB12 ID, PB13 VBUS, PB14 DM, PB15 DP + +#endif + +#if CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE + // USB2 FS Pin Init + // PA9 VUSB, PA10 ID, PA11 DM, PA12 DP /* Configure DM DP Pins */ GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12; @@ -219,6 +227,7 @@ void board_init(void) // Enable VBUS sense (B device) via pin PA9 USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN; +#endif } //--------------------------------------------------------------------+