Skip to content

Commit b1eedf4

Browse files
committed
fix iar make build with wb and u5
1 parent eea42fd commit b1eedf4

File tree

19 files changed

+41
-39
lines changed

19 files changed

+41
-39
lines changed

examples/build_system/make/cpu/cortex-m4.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ else ifeq ($(TOOLCHAIN),clang)
1212
-mfpu=fpv4-sp-d16 \
1313

1414
else ifeq ($(TOOLCHAIN),iar)
15-
CFLAGS += --cpu cortex-m4 --fpu VFPv4
16-
ASFLAGS += --cpu cortex-m4 --fpu VFPv4
15+
CFLAGS += --cpu cortex-m4 --fpu VFPv4-SP
16+
ASFLAGS += --cpu cortex-m4 --fpu VFPv4-SP
1717

1818
else
1919
$(error "TOOLCHAIN is not supported")

examples/host/msc_file_explorer/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ SRC_C += \
2222
$(FATFS_PATH)/ffunicode.c \
2323

2424
# suppress warning caused by fatfs
25-
CFLAGS += -Wno-error=cast-qual
25+
CFLAGS_GCC += -Wno-error=cast-qual
2626

2727
include ../../build_system/make/rules.mk

hw/bsp/broadcom_32bit/family.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CFLAGS += \
1515
CROSS_COMPILE = arm-none-eabi-
1616

1717
# mcu driver cause following warnings
18-
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
18+
CFLAGS_GCC += -Wno-error=cast-qual -Wno-error=redundant-decls
1919

2020
SRC_C += \
2121
src/portable/synopsys/dwc2/dcd_dwc2.c \

hw/bsp/broadcom_64bit/family.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CFLAGS += \
1414
CROSS_COMPILE = aarch64-none-elf-
1515

1616
# mcu driver cause following warnings
17-
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
17+
CFLAGS_GCC += -Wno-error=cast-qual -Wno-error=redundant-decls
1818

1919
SRC_C += \
2020
src/portable/synopsys/dwc2/dcd_dwc2.c \

hw/bsp/kinetis_k32l2/boards/frdm_k32l2a4s/board.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ MCU = K32L2A41A
33
CFLAGS += -DCPU_K32L2A41VLH1A
44

55
# mcu driver cause following warnings
6-
CFLAGS += -Wno-error=unused-parameter -Wno-error=redundant-decls -Wno-error=cast-qual
6+
CFLAGS_GCC += -Wno-error=unused-parameter -Wno-error=redundant-decls -Wno-error=cast-qual
77

88
# All source paths should be relative to the top level.
99
LD_FILE = $(MCU_DIR)/gcc/K32L2A41xxxxA_flash.ld

hw/bsp/lpc15/family.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CFLAGS += \
1515
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
1616

1717
# mcu driver cause following warnings
18-
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=cast-qual
18+
CFLAGS_GCC += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=cast-qual
1919

2020
MCU_DIR = hw/mcu/nxp/lpcopen/lpc15xx/lpc_chip_15xx
2121

hw/bsp/lpc17/family.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CFLAGS += \
1313
-DRTC_EV_SUPPORT=0
1414

1515
# lpc_types.h cause following errors
16-
CFLAGS += -Wno-error=strict-prototypes -Wno-error=cast-qual
16+
CFLAGS_GCC += -Wno-error=strict-prototypes -Wno-error=cast-qual
1717

1818
# caused by freeRTOS port !!
1919
CFLAGS += -Wno-error=maybe-uninitialized

hw/bsp/lpc18/family.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CFLAGS += \
1212
-DCFG_TUSB_MCU=OPT_MCU_LPC18XX
1313

1414
# mcu driver cause following warnings
15-
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-qual
15+
CFLAGS_GCC += -Wno-error=unused-parameter -Wno-error=cast-qual
1616

1717
LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
1818

hw/bsp/lpc40/family.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CFLAGS += \
1313
-DCFG_TUSB_MCU=OPT_MCU_LPC40XX
1414

1515
# mcu driver cause following warnings
16-
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=cast-qual
16+
CFLAGS_GCC += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=cast-qual
1717

1818
LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
1919

hw/bsp/lpc43/family.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ include ${TOP}/${BOARD_PATH}/board.mk
55
CPU_CORE ?= cortex-m4
66

77
CFLAGS += \
8-
-flto \
9-
-nostdlib \
108
-DCORE_M4 \
119
-D__USE_LPCOPEN \
1210
-DCFG_TUSB_MCU=OPT_MCU_LPC43XX
1311

1412
# mcu driver cause following warnings
15-
CFLAGS += \
13+
CFLAGS_GCC += \
14+
-flto \
15+
-nostdlib \
1616
-Wno-error=unused-parameter \
1717
-Wno-error=cast-qual \
1818
-Wno-error=incompatible-pointer-types \

hw/bsp/stm32f4/family.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
UF2_FAMILY_ID = 0x57755a57
22
ST_FAMILY = f4
3-
DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
43

54
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
65
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1+
MCU_VARIANT = stm32u585xx
12
CFLAGS += \
23
-DSTM32U585xx \
34

45
# All source paths should be relative to the top level.
56
LD_FILE = ${FAMILY_PATH}/linker/STM32U575xx_FLASH.ld
67

7-
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u575xx.s
8-
9-
MCU_VARIANT = stm32u585xx
108
# For flash-jlink target
119
JLINK_DEVICE = stm32u585zi
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1+
MCU_VARIANT = stm32u545xx
12
CFLAGS += \
23
-DSTM32U545xx \
34

45
# All source paths should be relative to the top level.
56
LD_FILE = ${FAMILY_PATH}/linker/STM32U545xx_FLASH.ld
67

7-
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u545xx.s
8-
9-
MCU_VARIANT = stm32u545xx
108
# For flash-jlink target
119
JLINK_DEVICE = stm32u545re
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1+
MCU_VARIANT = stm32u575xx
12
CFLAGS += \
23
-DSTM32U575xx \
34

45
# All source paths should be relative to the top level.
56
LD_FILE = ${FAMILY_PATH}/linker/STM32U575xx_FLASH.ld
67

7-
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u575xx.s
8-
9-
MCU_VARIANT = stm32u575xx
108
# For flash-jlink target
119
JLINK_DEVICE = stm32u575ai
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1+
MCU_VARIANT = stm32u575xx
12
CFLAGS += \
23
-DSTM32U575xx \
34

45
# All source paths should be relative to the top level.
56
LD_FILE = ${FAMILY_PATH}/linker/STM32U575xx_FLASH.ld
67

7-
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u575xx.s
8-
9-
MCU_VARIANT = stm32u575xx
108
# For flash-jlink target
119
JLINK_DEVICE = stm32u575zi
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
MCU_VARIANT = stm32u5a5xx
12
CFLAGS += \
23
-DSTM32U5A5xx \
34
-DHSE_VALUE=16000000UL \
45

56
# All source paths should be relative to the top level.
67
LD_FILE = ${BOARD_PATH}/STM32U5A5ZJTXQ_FLASH.ld
78

8-
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32u5a5xx.s
9-
10-
MCU_VARIANT = stm32u5a5xx
119
# For flash-jlink target
1210
JLINK_DEVICE = stm32u575zi

hw/bsp/stm32u5/family.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,12 @@ INC += \
5757
$(TOP)/$(ST_HAL_DRIVER)/Inc \
5858
$(TOP)/$(BOARD_PATH)
5959

60+
# Startup
61+
SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s
62+
SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_$(MCU_VARIANT).s
63+
64+
# Linker
65+
LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf
66+
6067
# flash target using on-board stlink
6168
flash: flash-stlink

hw/bsp/stm32wb/family.mk

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ include $(TOP)/$(BOARD_PATH)/board.mk
99
CPU_CORE ?= cortex-m4
1010

1111
CFLAGS += \
12-
-flto \
13-
-nostdlib -nostartfiles \
1412
-DCFG_TUSB_MCU=OPT_MCU_STM32WB
1513

16-
# suppress warning caused by vendor mcu driver
17-
CFLAGS += -Wno-error=cast-align -Wno-unused-parameter
18-
19-
LD_FILE ?= ${ST_CMSIS}/Source/Templates/gcc/linker/${MCU_VARIANT}_flash_cm4.ld
14+
CFLAGS_GCC += \
15+
-flto \
16+
-nostdlib -nostartfiles \
17+
-Wno-error=cast-align -Wno-unused-parameter
2018

2119
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
2220

@@ -25,19 +23,26 @@ SRC_C += \
2523
$(ST_CMSIS)/Source/Templates/system_${ST_PREFIX}.c \
2624
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal.c \
2725
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_cortex.c \
26+
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_pwr.c \
2827
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_pwr_ex.c \
2928
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_rcc.c \
3029
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_rcc_ex.c \
3130
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_uart.c \
3231
$(ST_HAL_DRIVER)/Src/${ST_PREFIX}_hal_gpio.c
3332

34-
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_${MCU_VARIANT}_cm4.s
35-
3633
INC += \
3734
$(TOP)/$(BOARD_PATH) \
3835
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
3936
$(TOP)/$(ST_CMSIS)/Include \
4037
$(TOP)/$(ST_HAL_DRIVER)/Inc
4138

39+
# Startup
40+
SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT)_cm4.s
41+
SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_$(MCU_VARIANT)_cm4.s
42+
43+
# Linker
44+
LD_FILE_GCC ?= ${ST_CMSIS}/Source/Templates/gcc/linker/${MCU_VARIANT}_flash_cm4.ld
45+
LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash_cm4.icf
46+
4247
# flash target using on-board stlink
4348
flash: flash-stlink

src/class/msc/msc_device.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ bool mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t
344344
msc_csw_t * p_csw = &p_msc->csw;
345345

346346
switch (p_msc->stage) {
347-
case MSC_STAGE_CMD:
347+
case MSC_STAGE_CMD: {
348348
//------------- new CBW received -------------//
349349
// Complete IN while waiting for CMD is usually Status of previous SCSI op, ignore it
350350
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
441441
}
442442
}
443443
}
444-
break;
444+
break;
445+
}
445446

446447
case MSC_STAGE_DATA:
447448
TU_LOG_DRV(" SCSI Data [Lun%u]\r\n", p_cbw->lun);

0 commit comments

Comments
 (0)