STM32/OTG_HS: Allow OTG_HS port to run at FS speed.

Add "REDUCE_SPEED=1" to the compile options.
This commit is contained in:
Uwe Bonnes
2020-07-01 23:07:18 +02:00
parent 4cec866994
commit fd38178189
6 changed files with 47 additions and 15 deletions
+16 -2
View File
@@ -1,3 +1,6 @@
PORT ?= 1
REDUCE_SPEED ?= 0
CFLAGS += \
-flto \
-mthumb \
@@ -9,8 +12,19 @@ CFLAGS += \
-DSTM32F723xx \
-DHSE_VALUE=25000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F7 \
-DBOARD_DEVICE_RHPORT_NUM=1 \
-DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
-DBOARD_DEVICE_RHPORT_NUM=$(PORT)
ifeq ($(PORT), 1)
ifeq ($(REDUCE_SPEED), 0)
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
$(info "Using OTG_HS in HS mode")
else
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_FULL_SPEED
$(info "Using OTG_HS in FS mode")
endif
else
$(info "Using OTG_FS")
endif
# mcu driver cause following warnings
CFLAGS += -Wno-error=shadow -Wno-error=cast-align
+9 -4
View File
@@ -1,5 +1,5 @@
# Default is Highspeed port
PORT ?= 1
REDUCE_SPEED ?= 0
CFLAGS += \
-flto \
@@ -15,10 +15,15 @@ CFLAGS += \
-DBOARD_DEVICE_RHPORT_NUM=$(PORT)
ifeq ($(PORT), 1)
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
$(info "PORT1 High Speed")
ifeq ($(REDUCE_SPEED), 0)
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
$(info "Using OTG_HS in HS mode")
else
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_FULL_SPEED
$(info "Using OTG_HS in FS mode")
endif
else
$(info "PORT0 Full Speed")
$(info "Using OTG_FS")
endif
# mcu driver cause following warnings
+8 -2
View File
@@ -1,4 +1,5 @@
PORT ?= 0
REDUCE_SPEED ?= 0
CFLAGS += \
-flto \
@@ -14,10 +15,15 @@ CFLAGS += \
-DBOARD_DEVICE_RHPORT_NUM=$(PORT)
ifeq ($(PORT), 1)
ifeq ($(REDUCE_SPEED), 0)
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
$(info "PORT1 HS")
$(info "Using OTG_HS in HS mode")
else
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_FULL_SPEED
$(info "Using OTG_HS in FS mode")
endif
else
$(info "PORT0")
$(info "Using OTG_FS")
endif
# mcu driver cause following warnings
+10 -1
View File
@@ -1,3 +1,5 @@
REDUCE_SPEED ?= 0
CFLAGS += \
-flto \
-mthumb \
@@ -10,7 +12,14 @@ CFLAGS += \
-DHSE_VALUE=25000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F7 \
-DBOARD_DEVICE_RHPORT_NUM=1 \
-DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
ifeq ($(REDUCE_SPEED), 0)
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
$(info "Using OTG_HS in HS mode")
else
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_FULL_SPEED
$(info "Using OTG_HS in FS mode")
endif
# suppress warning caused by vendor mcu driver
CFLAGS += -Wno-error=cast-align -Wno-error=shadow