fix iar make build with wb and u5
This commit is contained in:
@@ -12,8 +12,8 @@ else ifeq ($(TOOLCHAIN),clang)
|
|||||||
-mfpu=fpv4-sp-d16 \
|
-mfpu=fpv4-sp-d16 \
|
||||||
|
|
||||||
else ifeq ($(TOOLCHAIN),iar)
|
else ifeq ($(TOOLCHAIN),iar)
|
||||||
CFLAGS += --cpu cortex-m4 --fpu VFPv4
|
CFLAGS += --cpu cortex-m4 --fpu VFPv4-SP
|
||||||
ASFLAGS += --cpu cortex-m4 --fpu VFPv4
|
ASFLAGS += --cpu cortex-m4 --fpu VFPv4-SP
|
||||||
|
|
||||||
else
|
else
|
||||||
$(error "TOOLCHAIN is not supported")
|
$(error "TOOLCHAIN is not supported")
|
||||||
|
@@ -22,6 +22,6 @@ SRC_C += \
|
|||||||
$(FATFS_PATH)/ffunicode.c \
|
$(FATFS_PATH)/ffunicode.c \
|
||||||
|
|
||||||
# suppress warning caused by fatfs
|
# suppress warning caused by fatfs
|
||||||
CFLAGS += -Wno-error=cast-qual
|
CFLAGS_GCC += -Wno-error=cast-qual
|
||||||
|
|
||||||
include ../../build_system/make/rules.mk
|
include ../../build_system/make/rules.mk
|
||||||
|
@@ -15,7 +15,7 @@ CFLAGS += \
|
|||||||
CROSS_COMPILE = arm-none-eabi-
|
CROSS_COMPILE = arm-none-eabi-
|
||||||
|
|
||||||
# mcu driver cause following warnings
|
# mcu driver cause following warnings
|
||||||
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
|
CFLAGS_GCC += -Wno-error=cast-qual -Wno-error=redundant-decls
|
||||||
|
|
||||||
SRC_C += \
|
SRC_C += \
|
||||||
src/portable/synopsys/dwc2/dcd_dwc2.c \
|
src/portable/synopsys/dwc2/dcd_dwc2.c \
|
||||||
|
@@ -14,7 +14,7 @@ CFLAGS += \
|
|||||||
CROSS_COMPILE = aarch64-none-elf-
|
CROSS_COMPILE = aarch64-none-elf-
|
||||||
|
|
||||||
# mcu driver cause following warnings
|
# mcu driver cause following warnings
|
||||||
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
|
CFLAGS_GCC += -Wno-error=cast-qual -Wno-error=redundant-decls
|
||||||
|
|
||||||
SRC_C += \
|
SRC_C += \
|
||||||
src/portable/synopsys/dwc2/dcd_dwc2.c \
|
src/portable/synopsys/dwc2/dcd_dwc2.c \
|
||||||
|
@@ -3,7 +3,7 @@ MCU = K32L2A41A
|
|||||||
CFLAGS += -DCPU_K32L2A41VLH1A
|
CFLAGS += -DCPU_K32L2A41VLH1A
|
||||||
|
|
||||||
# mcu driver cause following warnings
|
# mcu driver cause following warnings
|
||||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=redundant-decls -Wno-error=cast-qual
|
CFLAGS_GCC += -Wno-error=unused-parameter -Wno-error=redundant-decls -Wno-error=cast-qual
|
||||||
|
|
||||||
# All source paths should be relative to the top level.
|
# All source paths should be relative to the top level.
|
||||||
LD_FILE = $(MCU_DIR)/gcc/K32L2A41xxxxA_flash.ld
|
LD_FILE = $(MCU_DIR)/gcc/K32L2A41xxxxA_flash.ld
|
||||||
|
@@ -15,7 +15,7 @@ CFLAGS += \
|
|||||||
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
|
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
|
||||||
|
|
||||||
# mcu driver cause following warnings
|
# mcu driver cause following warnings
|
||||||
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=cast-qual
|
CFLAGS_GCC += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=cast-qual
|
||||||
|
|
||||||
MCU_DIR = hw/mcu/nxp/lpcopen/lpc15xx/lpc_chip_15xx
|
MCU_DIR = hw/mcu/nxp/lpcopen/lpc15xx/lpc_chip_15xx
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ CFLAGS += \
|
|||||||
-DRTC_EV_SUPPORT=0
|
-DRTC_EV_SUPPORT=0
|
||||||
|
|
||||||
# lpc_types.h cause following errors
|
# lpc_types.h cause following errors
|
||||||
CFLAGS += -Wno-error=strict-prototypes -Wno-error=cast-qual
|
CFLAGS_GCC += -Wno-error=strict-prototypes -Wno-error=cast-qual
|
||||||
|
|
||||||
# caused by freeRTOS port !!
|
# caused by freeRTOS port !!
|
||||||
CFLAGS += -Wno-error=maybe-uninitialized
|
CFLAGS += -Wno-error=maybe-uninitialized
|
||||||
|
@@ -12,7 +12,7 @@ CFLAGS += \
|
|||||||
-DCFG_TUSB_MCU=OPT_MCU_LPC18XX
|
-DCFG_TUSB_MCU=OPT_MCU_LPC18XX
|
||||||
|
|
||||||
# mcu driver cause following warnings
|
# mcu driver cause following warnings
|
||||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-qual
|
CFLAGS_GCC += -Wno-error=unused-parameter -Wno-error=cast-qual
|
||||||
|
|
||||||
LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
|
LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ CFLAGS += \
|
|||||||
-DCFG_TUSB_MCU=OPT_MCU_LPC40XX
|
-DCFG_TUSB_MCU=OPT_MCU_LPC40XX
|
||||||
|
|
||||||
# mcu driver cause following warnings
|
# mcu driver cause following warnings
|
||||||
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=cast-qual
|
CFLAGS_GCC += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=cast-qual
|
||||||
|
|
||||||
LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
|
LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
|
||||||
|
|
||||||
|
@@ -5,14 +5,14 @@ include ${TOP}/${BOARD_PATH}/board.mk
|
|||||||
CPU_CORE ?= cortex-m4
|
CPU_CORE ?= cortex-m4
|
||||||
|
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-flto \
|
|
||||||
-nostdlib \
|
|
||||||
-DCORE_M4 \
|
-DCORE_M4 \
|
||||||
-D__USE_LPCOPEN \
|
-D__USE_LPCOPEN \
|
||||||
-DCFG_TUSB_MCU=OPT_MCU_LPC43XX
|
-DCFG_TUSB_MCU=OPT_MCU_LPC43XX
|
||||||
|
|
||||||
# mcu driver cause following warnings
|
# mcu driver cause following warnings
|
||||||
CFLAGS += \
|
CFLAGS_GCC += \
|
||||||
|
-flto \
|
||||||
|
-nostdlib \
|
||||||
-Wno-error=unused-parameter \
|
-Wno-error=unused-parameter \
|
||||||
-Wno-error=cast-qual \
|
-Wno-error=cast-qual \
|
||||||
-Wno-error=incompatible-pointer-types \
|
-Wno-error=incompatible-pointer-types \
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
UF2_FAMILY_ID = 0x57755a57
|
UF2_FAMILY_ID = 0x57755a57
|
||||||
ST_FAMILY = f4
|
ST_FAMILY = f4
|
||||||
DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
|
|
||||||
|
|
||||||
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
|
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
|
||||||
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
|
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
|
MCU_VARIANT = stm32u585xx
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-DSTM32U585xx \
|
-DSTM32U585xx \
|
||||||
|
|
||||||
# All source paths should be relative to the top level.
|
# All source paths should be relative to the top level.
|
||||||
LD_FILE = ${FAMILY_PATH}/linker/STM32U575xx_FLASH.ld
|
LD_FILE = ${FAMILY_PATH}/linker/STM32U575xx_FLASH.ld
|
||||||
|
|
||||||
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u575xx.s
|
|
||||||
|
|
||||||
MCU_VARIANT = stm32u585xx
|
|
||||||
# For flash-jlink target
|
# For flash-jlink target
|
||||||
JLINK_DEVICE = stm32u585zi
|
JLINK_DEVICE = stm32u585zi
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
|
MCU_VARIANT = stm32u545xx
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-DSTM32U545xx \
|
-DSTM32U545xx \
|
||||||
|
|
||||||
# All source paths should be relative to the top level.
|
# All source paths should be relative to the top level.
|
||||||
LD_FILE = ${FAMILY_PATH}/linker/STM32U545xx_FLASH.ld
|
LD_FILE = ${FAMILY_PATH}/linker/STM32U545xx_FLASH.ld
|
||||||
|
|
||||||
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u545xx.s
|
|
||||||
|
|
||||||
MCU_VARIANT = stm32u545xx
|
|
||||||
# For flash-jlink target
|
# For flash-jlink target
|
||||||
JLINK_DEVICE = stm32u545re
|
JLINK_DEVICE = stm32u545re
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
|
MCU_VARIANT = stm32u575xx
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-DSTM32U575xx \
|
-DSTM32U575xx \
|
||||||
|
|
||||||
# All source paths should be relative to the top level.
|
# All source paths should be relative to the top level.
|
||||||
LD_FILE = ${FAMILY_PATH}/linker/STM32U575xx_FLASH.ld
|
LD_FILE = ${FAMILY_PATH}/linker/STM32U575xx_FLASH.ld
|
||||||
|
|
||||||
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u575xx.s
|
|
||||||
|
|
||||||
MCU_VARIANT = stm32u575xx
|
|
||||||
# For flash-jlink target
|
# For flash-jlink target
|
||||||
JLINK_DEVICE = stm32u575ai
|
JLINK_DEVICE = stm32u575ai
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
|
MCU_VARIANT = stm32u575xx
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-DSTM32U575xx \
|
-DSTM32U575xx \
|
||||||
|
|
||||||
# All source paths should be relative to the top level.
|
# All source paths should be relative to the top level.
|
||||||
LD_FILE = ${FAMILY_PATH}/linker/STM32U575xx_FLASH.ld
|
LD_FILE = ${FAMILY_PATH}/linker/STM32U575xx_FLASH.ld
|
||||||
|
|
||||||
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u575xx.s
|
|
||||||
|
|
||||||
MCU_VARIANT = stm32u575xx
|
|
||||||
# For flash-jlink target
|
# For flash-jlink target
|
||||||
JLINK_DEVICE = stm32u575zi
|
JLINK_DEVICE = stm32u575zi
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
MCU_VARIANT = stm32u5a5xx
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-DSTM32U5A5xx \
|
-DSTM32U5A5xx \
|
||||||
-DHSE_VALUE=16000000UL \
|
-DHSE_VALUE=16000000UL \
|
||||||
@@ -5,8 +6,5 @@ CFLAGS += \
|
|||||||
# All source paths should be relative to the top level.
|
# All source paths should be relative to the top level.
|
||||||
LD_FILE = ${BOARD_PATH}/STM32U5A5ZJTXQ_FLASH.ld
|
LD_FILE = ${BOARD_PATH}/STM32U5A5ZJTXQ_FLASH.ld
|
||||||
|
|
||||||
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u5a5xx.s
|
|
||||||
|
|
||||||
MCU_VARIANT = stm32u5a5xx
|
|
||||||
# For flash-jlink target
|
# For flash-jlink target
|
||||||
JLINK_DEVICE = stm32u575zi
|
JLINK_DEVICE = stm32u575zi
|
||||||
|
@@ -57,5 +57,12 @@ INC += \
|
|||||||
$(TOP)/$(ST_HAL_DRIVER)/Inc \
|
$(TOP)/$(ST_HAL_DRIVER)/Inc \
|
||||||
$(TOP)/$(BOARD_PATH)
|
$(TOP)/$(BOARD_PATH)
|
||||||
|
|
||||||
|
# Startup
|
||||||
|
SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s
|
||||||
|
SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_$(MCU_VARIANT).s
|
||||||
|
|
||||||
|
# Linker
|
||||||
|
LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf
|
||||||
|
|
||||||
# flash target using on-board stlink
|
# flash target using on-board stlink
|
||||||
flash: flash-stlink
|
flash: flash-stlink
|
||||||
|
@@ -9,14 +9,12 @@ include $(TOP)/$(BOARD_PATH)/board.mk
|
|||||||
CPU_CORE ?= cortex-m4
|
CPU_CORE ?= cortex-m4
|
||||||
|
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-flto \
|
|
||||||
-nostdlib -nostartfiles \
|
|
||||||
-DCFG_TUSB_MCU=OPT_MCU_STM32WB
|
-DCFG_TUSB_MCU=OPT_MCU_STM32WB
|
||||||
|
|
||||||
# suppress warning caused by vendor mcu driver
|
CFLAGS_GCC += \
|
||||||
CFLAGS += -Wno-error=cast-align -Wno-unused-parameter
|
-flto \
|
||||||
|
-nostdlib -nostartfiles \
|
||||||
LD_FILE ?= ${ST_CMSIS}/Source/Templates/gcc/linker/${MCU_VARIANT}_flash_cm4.ld
|
-Wno-error=cast-align -Wno-unused-parameter
|
||||||
|
|
||||||
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
|
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
|
||||||
|
|
||||||
@@ -25,19 +23,26 @@ SRC_C += \
|
|||||||
$(ST_CMSIS)/Source/Templates/system_${ST_PREFIX}.c \
|
$(ST_CMSIS)/Source/Templates/system_${ST_PREFIX}.c \
|
||||||
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal.c \
|
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal.c \
|
||||||
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_cortex.c \
|
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_cortex.c \
|
||||||
|
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_pwr.c \
|
||||||
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_pwr_ex.c \
|
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_pwr_ex.c \
|
||||||
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_rcc.c \
|
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_rcc.c \
|
||||||
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_rcc_ex.c \
|
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_rcc_ex.c \
|
||||||
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_uart.c \
|
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_uart.c \
|
||||||
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_gpio.c
|
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_gpio.c
|
||||||
|
|
||||||
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_${MCU_VARIANT}_cm4.s
|
|
||||||
|
|
||||||
INC += \
|
INC += \
|
||||||
$(TOP)/$(BOARD_PATH) \
|
$(TOP)/$(BOARD_PATH) \
|
||||||
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
|
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
|
||||||
$(TOP)/$(ST_CMSIS)/Include \
|
$(TOP)/$(ST_CMSIS)/Include \
|
||||||
$(TOP)/$(ST_HAL_DRIVER)/Inc
|
$(TOP)/$(ST_HAL_DRIVER)/Inc
|
||||||
|
|
||||||
|
# Startup
|
||||||
|
SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT)_cm4.s
|
||||||
|
SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_$(MCU_VARIANT)_cm4.s
|
||||||
|
|
||||||
|
# Linker
|
||||||
|
LD_FILE_GCC ?= ${ST_CMSIS}/Source/Templates/gcc/linker/${MCU_VARIANT}_flash_cm4.ld
|
||||||
|
LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash_cm4.icf
|
||||||
|
|
||||||
# flash target using on-board stlink
|
# flash target using on-board stlink
|
||||||
flash: flash-stlink
|
flash: flash-stlink
|
||||||
|
@@ -344,7 +344,7 @@ bool mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t
|
|||||||
msc_csw_t * p_csw = &p_msc->csw;
|
msc_csw_t * p_csw = &p_msc->csw;
|
||||||
|
|
||||||
switch (p_msc->stage) {
|
switch (p_msc->stage) {
|
||||||
case MSC_STAGE_CMD:
|
case MSC_STAGE_CMD: {
|
||||||
//------------- new CBW received -------------//
|
//------------- new CBW received -------------//
|
||||||
// Complete IN while waiting for CMD is usually Status of previous SCSI op, ignore it
|
// Complete IN while waiting for CMD is usually Status of previous SCSI op, ignore it
|
||||||
if (ep_addr != p_msc->ep_out) {
|
if (ep_addr != p_msc->ep_out) {
|
||||||
@@ -441,7 +441,8 @@ bool mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case MSC_STAGE_DATA:
|
case MSC_STAGE_DATA:
|
||||||
TU_LOG_DRV(" SCSI Data [Lun%u]\r\n", p_cbw->lun);
|
TU_LOG_DRV(" SCSI Data [Lun%u]\r\n", p_cbw->lun);
|
||||||
|
Reference in New Issue
Block a user