summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-11-02 13:52:30 +0700
committerhathach <[email protected]>2021-11-02 13:52:30 +0700
commitaa682d730123a1191782b1a160ce25ea20580ee6 (patch)
tree1ff3cf21ce7dab21b813f5e1841cb6ab0c0ab040 /hw
parent4ea8f1441dda442d784ee57f39a0adc75bf69e56 (diff)
add fix for stm32l4 (version 3.10a) which generate transfer complete when setup recieved and control out data complete
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/stm32l476disco/board.mk6
-rw-r--r--hw/bsp/stm32l476disco/stm32l476disco.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/hw/bsp/stm32l476disco/board.mk b/hw/bsp/stm32l476disco/board.mk
index 28824efdc..8d9e267cf 100644
--- a/hw/bsp/stm32l476disco/board.mk
+++ b/hw/bsp/stm32l476disco/board.mk
@@ -21,8 +21,9 @@ CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align
# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/STM32L476VGTx_FLASH.ld
+#src/portable/st/synopsys/dcd_synopsys.c
SRC_C += \
- src/portable/st/synopsys/dcd_synopsys.c \
+ src/portable/synopsys/dwc2/dcd_dwc2.c \
$(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -52,5 +53,4 @@ JLINK_DEVICE = stm32l476vg
STM32Prog = STM32_Programmer_CLI
# flash target using on-board stlink
-flash: $(BUILD)/$(PROJECT).elf
- $(STM32Prog) --connect port=swd --write $< --go
+flash: flash-stlink
diff --git a/hw/bsp/stm32l476disco/stm32l476disco.c b/hw/bsp/stm32l476disco/stm32l476disco.c
index b18846685..bc1b6c929 100644
--- a/hw/bsp/stm32l476disco/stm32l476disco.c
+++ b/hw/bsp/stm32l476disco/stm32l476disco.c
@@ -186,8 +186,12 @@ void board_init(void)
/* Enable USB FS Clock */
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
+// // Enable VBUS sense (B device) via pin PA9
+// USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
+
+ // L476Disco use general GPIO PC11 for VBUS sensing instead of dedicated PA9 as others
+ // Disable VBUS Sense and force device mode
+ USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN;
}
//--------------------------------------------------------------------+