diff options
| author | hathach <[email protected]> | 2020-05-26 12:18:18 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-05-26 12:18:36 +0700 |
| commit | 62a746bdc7dc677cabeba9ef6f1dd974de1c0791 (patch) | |
| tree | 0b49f5013c54f438bf7bb71d4c76b17fe19208f3 | |
| parent | ba9c774a2a5f784a85de1ca1212268b367046c03 (diff) | |
wip
| -rw-r--r-- | hw/bsp/stm32h743eval/board.mk | 7 | ||||
| -rw-r--r-- | hw/bsp/stm32h743eval/stm32h743eval.c | 13 |
2 files changed, 17 insertions, 3 deletions
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 } //--------------------------------------------------------------------+ |
