This commit is contained in:
hathach 2020-05-26 12:18:18 +07:00
parent ba9c774a2a
commit 62a746bdc7
2 changed files with 17 additions and 3 deletions

View File

@ -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

View File

@ -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
}
//--------------------------------------------------------------------+