diff options
| author | hathach <[email protected]> | 2026-03-19 22:23:47 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-04-06 11:17:34 +0700 |
| commit | 4c7a9fed96e0a81cc640333c1c82fee54fa4be34 (patch) | |
| tree | eef35722aefb347b9761c98cef5848ef26edb60a /examples | |
| parent | 751f465a39299ba0638c1700d1aa2d53e8d1b877 (diff) | |
remove IAR toolchain support from make build system
IAR is only supported with CMake. Remove all IAR-specific references
from the Make build system including toolchain files, SRC_S_IAR,
LD_FILE_IAR variables, and IAR toolchain detection.
Also fix GET_SECTOR_COUNT truncation in msc_file_explorer and
broken formatting in stm32f7 board_uart_write.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Diffstat (limited to 'examples')
27 files changed, 7 insertions, 180 deletions
diff --git a/examples/build_system/make/cpu/arm1176jzf-s.mk b/examples/build_system/make/cpu/arm1176jzf-s.mk index 022ccf7ad..c0cef8784 100644 --- a/examples/build_system/make/cpu/arm1176jzf-s.mk +++ b/examples/build_system/make/cpu/arm1176jzf-s.mk @@ -2,8 +2,4 @@ ifeq ($(TOOLCHAIN),gcc) CFLAGS += \ -mcpu=arm1176jzf-s \ -else ifeq ($(TOOLCHAIN),iar) - #CFLAGS += --cpu cortex-a53 - #ASFLAGS += --cpu cortex-a53 - endif diff --git a/examples/build_system/make/cpu/arm926ej-s.mk b/examples/build_system/make/cpu/arm926ej-s.mk index 5b84f514f..e0558eca7 100644 --- a/examples/build_system/make/cpu/arm926ej-s.mk +++ b/examples/build_system/make/cpu/arm926ej-s.mk @@ -2,8 +2,4 @@ ifeq ($(TOOLCHAIN),gcc) CFLAGS += \ -mcpu=arm926ej-s \ -else ifeq ($(TOOLCHAIN),iar) - #CFLAGS += --cpu cortex-a53 - #ASFLAGS += --cpu cortex-a53 - endif diff --git a/examples/build_system/make/cpu/cortex-a53.mk b/examples/build_system/make/cpu/cortex-a53.mk index 42e522ecf..20ed8f0cc 100644 --- a/examples/build_system/make/cpu/cortex-a53.mk +++ b/examples/build_system/make/cpu/cortex-a53.mk @@ -2,11 +2,4 @@ ifeq ($(TOOLCHAIN),gcc) CFLAGS += \ -mcpu=cortex-a53 \ -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-a53 \ - - ASFLAGS += \ - --cpu cortex-a53 \ - endif diff --git a/examples/build_system/make/cpu/cortex-a72.mk b/examples/build_system/make/cpu/cortex-a72.mk index 1b3d8da4a..b2b3d9181 100644 --- a/examples/build_system/make/cpu/cortex-a72.mk +++ b/examples/build_system/make/cpu/cortex-a72.mk @@ -2,11 +2,4 @@ ifeq ($(TOOLCHAIN),gcc) CFLAGS += \ -mcpu=cortex-a72 \ -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-a72 \ - - ASFLAGS += \ - --cpu cortex-a72 \ - endif diff --git a/examples/build_system/make/cpu/cortex-m0.mk b/examples/build_system/make/cpu/cortex-m0.mk index c2c33a2ee..1d618982e 100644 --- a/examples/build_system/make/cpu/cortex-m0.mk +++ b/examples/build_system/make/cpu/cortex-m0.mk @@ -9,11 +9,6 @@ else ifeq ($(TOOLCHAIN),clang) --target=arm-none-eabi \ -mcpu=cortex-m0 \ -else ifeq ($(TOOLCHAIN),iar) - # IAR Flags - CFLAGS += --cpu cortex-m0 - ASFLAGS += --cpu cortex-m0 - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m0plus.mk b/examples/build_system/make/cpu/cortex-m0plus.mk index fe8feb227..029ce09d1 100644 --- a/examples/build_system/make/cpu/cortex-m0plus.mk +++ b/examples/build_system/make/cpu/cortex-m0plus.mk @@ -9,11 +9,6 @@ else ifeq ($(TOOLCHAIN),clang) --target=arm-none-eabi \ -mcpu=cortex-m0plus \ -else ifeq ($(TOOLCHAIN),iar) - # IAR Flags - CFLAGS += --cpu cortex-m0+ - ASFLAGS += --cpu cortex-m0+ - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m23.mk b/examples/build_system/make/cpu/cortex-m23.mk index 7ab758352..b92e24401 100644 --- a/examples/build_system/make/cpu/cortex-m23.mk +++ b/examples/build_system/make/cpu/cortex-m23.mk @@ -9,11 +9,6 @@ else ifeq ($(TOOLCHAIN),clang) --target=arm-none-eabi \ -mcpu=cortex-m23 \ -else ifeq ($(TOOLCHAIN),iar) - # IAR Flags - CFLAGS += --cpu cortex-m23 - ASFLAGS += --cpu cortex-m23 - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m3.mk b/examples/build_system/make/cpu/cortex-m3.mk index b6325313f..b58f0203b 100644 --- a/examples/build_system/make/cpu/cortex-m3.mk +++ b/examples/build_system/make/cpu/cortex-m3.mk @@ -9,11 +9,6 @@ else ifeq ($(TOOLCHAIN),clang) --target=arm-none-eabi \ -mcpu=cortex-m3 \ -else ifeq ($(TOOLCHAIN),iar) - # IAR Flags - CFLAGS += --cpu cortex-m3 - ASFLAGS += --cpu cortex-m3 - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m33-nodsp-nofp.mk b/examples/build_system/make/cpu/cortex-m33-nodsp-nofp.mk index 405053dd0..858a721fd 100644 --- a/examples/build_system/make/cpu/cortex-m33-nodsp-nofp.mk +++ b/examples/build_system/make/cpu/cortex-m33-nodsp-nofp.mk @@ -10,13 +10,6 @@ else ifeq ($(TOOLCHAIN),clang) -mcpu=cortex-m33 \ -mfpu=softvp \ -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-m33+nodsp \ - - ASFLAGS += \ - --cpu cortex-m33+nodsp \ - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m33.mk b/examples/build_system/make/cpu/cortex-m33.mk index 47b0eaecd..5699fef7b 100644 --- a/examples/build_system/make/cpu/cortex-m33.mk +++ b/examples/build_system/make/cpu/cortex-m33.mk @@ -11,15 +11,6 @@ else ifeq ($(TOOLCHAIN),clang) -mcpu=cortex-m33 \ -mfpu=fpv5-sp-d16 \ -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-m33 \ - --fpu VFPv5-SP \ - - ASFLAGS += \ - --cpu cortex-m33 \ - --fpu VFPv5-SP \ - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m4-nofpu.mk b/examples/build_system/make/cpu/cortex-m4-nofpu.mk index ac2916005..62ab21e31 100644 --- a/examples/build_system/make/cpu/cortex-m4-nofpu.mk +++ b/examples/build_system/make/cpu/cortex-m4-nofpu.mk @@ -9,10 +9,6 @@ else ifeq ($(TOOLCHAIN),clang) --target=arm-none-eabi \ -mcpu=cortex-m4 -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += --cpu cortex-m4 --fpu none - ASFLAGS += --cpu cortex-m4 --fpu none - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m4.mk b/examples/build_system/make/cpu/cortex-m4.mk index 57d6e126d..e50fe00ef 100644 --- a/examples/build_system/make/cpu/cortex-m4.mk +++ b/examples/build_system/make/cpu/cortex-m4.mk @@ -11,10 +11,6 @@ else ifeq ($(TOOLCHAIN),clang) -mcpu=cortex-m4 \ -mfpu=fpv4-sp-d16 \ -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += --cpu cortex-m4 --fpu VFPv4-SP - ASFLAGS += --cpu cortex-m4 --fpu VFPv4-SP - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m55.mk b/examples/build_system/make/cpu/cortex-m55.mk index de627caed..94cca1a5e 100644 --- a/examples/build_system/make/cpu/cortex-m55.mk +++ b/examples/build_system/make/cpu/cortex-m55.mk @@ -12,15 +12,6 @@ else ifeq ($(TOOLCHAIN),clang) -mcpu=cortex-m55 \ -mfpu=fpv5-d16 \ -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-m55 \ - --fpu VFPv5_D16 \ - - ASFLAGS += \ - --cpu cortex-m55 \ - --fpu VFPv5_D16 \ - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m7-fpsp.mk b/examples/build_system/make/cpu/cortex-m7-fpsp.mk index cd42c6fb8..e79ff6d73 100644 --- a/examples/build_system/make/cpu/cortex-m7-fpsp.mk +++ b/examples/build_system/make/cpu/cortex-m7-fpsp.mk @@ -11,15 +11,6 @@ else ifeq ($(TOOLCHAIN),clang) -mcpu=cortex-m7 \ -mfpu=fpv5-sp-d16 \ -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-m7 \ - --fpu VFPv5_sp \ - - ASFLAGS += \ - --cpu cortex-m7 \ - --fpu VFPv5_sp \ - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m7.mk b/examples/build_system/make/cpu/cortex-m7.mk index 3e6116179..3bd5c1155 100644 --- a/examples/build_system/make/cpu/cortex-m7.mk +++ b/examples/build_system/make/cpu/cortex-m7.mk @@ -11,15 +11,6 @@ else ifeq ($(TOOLCHAIN),clang) -mcpu=cortex-m7 \ -mfpu=fpv5-d16 \ -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-m7 \ - --fpu VFPv5_D16 \ - - ASFLAGS += \ - --cpu cortex-m7 \ - --fpu VFPv5_D16 \ - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/cortex-m85.mk b/examples/build_system/make/cpu/cortex-m85.mk index 75e8f3aaf..d66e26418 100644 --- a/examples/build_system/make/cpu/cortex-m85.mk +++ b/examples/build_system/make/cpu/cortex-m85.mk @@ -11,15 +11,6 @@ else ifeq ($(TOOLCHAIN),clang) -mcpu=cortex-m85 \ -mfpu=fpv5-d16 \ -else ifeq ($(TOOLCHAIN),iar) - CFLAGS += \ - --cpu cortex-m85 \ - --fpu VFPv5_D16 \ - - ASFLAGS += \ - --cpu cortex-m85 \ - --fpu VFPv5_D16 \ - else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/msp430.mk b/examples/build_system/make/cpu/msp430.mk index 6daa2c38d..83a35140f 100644 --- a/examples/build_system/make/cpu/msp430.mk +++ b/examples/build_system/make/cpu/msp430.mk @@ -2,8 +2,6 @@ ifeq ($(TOOLCHAIN),gcc) # nothing to add else ifeq ($(TOOLCHAIN),clang) # nothing to add -else ifeq ($(TOOLCHAIN),iar) - # nothing to add else $(error "TOOLCHAIN is not supported") endif diff --git a/examples/build_system/make/cpu/rv32i-ilp32.mk b/examples/build_system/make/cpu/rv32i-ilp32.mk index af764afc5..6b2306008 100644 --- a/examples/build_system/make/cpu/rv32i-ilp32.mk +++ b/examples/build_system/make/cpu/rv32i-ilp32.mk @@ -8,8 +8,6 @@ else ifeq ($(TOOLCHAIN),clang) -march=rv32i_zicsr \ -mabi=ilp32 \ -else ifeq ($(TOOLCHAIN),iar) - $(error not support) endif # For freeRTOS port source diff --git a/examples/build_system/make/cpu/rv32imac-ilp32.mk b/examples/build_system/make/cpu/rv32imac-ilp32.mk index a7b2258d7..e4a3ad24f 100644 --- a/examples/build_system/make/cpu/rv32imac-ilp32.mk +++ b/examples/build_system/make/cpu/rv32imac-ilp32.mk @@ -8,9 +8,6 @@ else ifeq ($(TOOLCHAIN),clang) -march=rv32imac_zicsr_zifencei \ -mabi=ilp32 \ -else ifeq ($(TOOLCHAIN),iar) - $(error not support) - endif # For freeRTOS port source diff --git a/examples/build_system/make/toolchain/arm_iar.mk b/examples/build_system/make/toolchain/arm_iar.mk deleted file mode 100644 index 17967b41a..000000000 --- a/examples/build_system/make/toolchain/arm_iar.mk +++ /dev/null @@ -1,13 +0,0 @@ -# makefile for arm iar toolchain - -CC = iccarm -AS = iasmarm -LD = ilinkarm -OBJCOPY = ielftool --silent -SIZE = size - -# Enable extension mode (gcc compatible) -CFLAGS += -e --debug --silent - -# silent mode -ASFLAGS += -S $(addprefix -I,$(INC)) diff --git a/examples/build_system/make/toolchain/gcc_rules.mk b/examples/build_system/make/toolchain/gcc_rules.mk index fc5225503..3463cad48 100644 --- a/examples/build_system/make/toolchain/gcc_rules.mk +++ b/examples/build_system/make/toolchain/gcc_rules.mk @@ -1,5 +1,3 @@ -SRC_S += $(SRC_S_GCC) - # Assembly files can be name with upper case .S, convert it to .s SRC_S := $(SRC_S:.S=.s) @@ -9,7 +7,7 @@ SRC_S := $(SRC_S:.S=.s) OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.s=_asm.o)) OBJ += $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o)) -CFLAGS += $(CFLAGS_GCC) -MD +CFLAGS += -MD # LTO makes it difficult to analyze map file for optimizing size purpose # We will run this option in ci @@ -25,18 +23,13 @@ ifeq ($(TOOLCHAIN),clang) CFLAGS += $(CFLAGS_CLANG) LDFLAGS += $(CFLAGS) $(LDFLAGS_CLANG) else -LDFLAGS += $(CFLAGS) $(LDFLAGS_GCC) +LDFLAGS += $(CFLAGS) endif -# TODO should be removed after all examples are updated ifdef LD_FILE LDFLAGS += -Wl,-T,$(TOP)/$(LD_FILE) endif -ifdef LD_FILE_GCC -LDFLAGS += -Wl,-T,$(TOP)/$(LD_FILE_GCC) -endif - ASFLAGS += $(CFLAGS) # libc diff --git a/examples/build_system/make/toolchain/iar_rules.mk b/examples/build_system/make/toolchain/iar_rules.mk deleted file mode 100644 index 2c066f6da..000000000 --- a/examples/build_system/make/toolchain/iar_rules.mk +++ /dev/null @@ -1,44 +0,0 @@ -SRC_S += $(SRC_S_IAR) - -# Assembly files can be name with upper case .S, convert it to .s -SRC_S := $(SRC_S:.S=.s) - -# Due to GCC LTO bug https://bugs.launchpad.net/gcc-arm-embedded/+bug/1747966 -# assembly file should be placed first in linking order -# '_asm' suffix is added to object of assembly file -OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.s=_asm.o)) -OBJ += $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o)) - -# Linker script -LDFLAGS += --config $(TOP)/$(LD_FILE_IAR) - -# --------------------------------------- -# Rules -# --------------------------------------- - -# Compile .c file -$(BUILD)/obj/%.o: %.c - @echo CC $(notdir $@) - @$(CC) $(CFLAGS) -c -o $@ $< - -# ASM sources lower case .s -$(BUILD)/obj/%_asm.o: %.s - @echo AS $(notdir $@) - @$(AS) $(ASFLAGS) -c -o $@ $< - -# ASM sources upper case .S -$(BUILD)/obj/%_asm.o: %.S - @echo AS $(notdir $@) - @$(AS) $(ASFLAGS) -c -o $@ $< - -$(BUILD)/$(PROJECT).bin: $(BUILD)/$(PROJECT).elf - @echo CREATE $@ - @$(OBJCOPY) --bin $^ $@ - -$(BUILD)/$(PROJECT).hex: $(BUILD)/$(PROJECT).elf - @echo CREATE $@ - @$(OBJCOPY) --ihex $^ $@ - -$(BUILD)/$(PROJECT).elf: $(OBJ) - @echo LINK $@ - @$(LD) -o $@ $(LDFLAGS) $^ diff --git a/examples/device/net_lwip_webserver/Makefile b/examples/device/net_lwip_webserver/Makefile index 9d8e8ec77..6002039b3 100644 --- a/examples/device/net_lwip_webserver/Makefile +++ b/examples/device/net_lwip_webserver/Makefile @@ -1,7 +1,7 @@ include ../../../hw/bsp/family_support.mk # suppress warning caused by lwip -CFLAGS_GCC += \ +CFLAGS += \ -Wno-error=null-dereference \ -Wno-error=unused-parameter \ -Wno-error=unused-variable diff --git a/examples/dual/host_hid_to_device_cdc/Makefile b/examples/dual/host_hid_to_device_cdc/Makefile index a51251bf9..595cd7dec 100644 --- a/examples/dual/host_hid_to_device_cdc/Makefile +++ b/examples/dual/host_hid_to_device_cdc/Makefile @@ -8,7 +8,7 @@ INC += \ EXAMPLE_SOURCE += $(wildcard src/*.c) SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -CFLAGS_GCC += -Wno-error=cast-align -Wno-error=null-dereference +CFLAGS += -Wno-error=cast-align -Wno-error=null-dereference SRC_C += \ src/class/hid/hid_host.c \ diff --git a/examples/dual/host_info_to_device_cdc/Makefile b/examples/dual/host_info_to_device_cdc/Makefile index 659cf6ff9..3a1d87f57 100644 --- a/examples/dual/host_info_to_device_cdc/Makefile +++ b/examples/dual/host_info_to_device_cdc/Makefile @@ -8,7 +8,7 @@ INC += \ EXAMPLE_SOURCE += $(wildcard src/*.c) SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -CFLAGS_GCC += -Wno-error=cast-align -Wno-error=null-dereference +CFLAGS += -Wno-error=cast-align -Wno-error=null-dereference SRC_C += \ src/host/hub.c \ diff --git a/examples/host/msc_file_explorer/Makefile b/examples/host/msc_file_explorer/Makefile index 39d00d982..8c0b012ad 100644 --- a/examples/host/msc_file_explorer/Makefile +++ b/examples/host/msc_file_explorer/Makefile @@ -21,6 +21,6 @@ SRC_C += \ $(FATFS_PATH)/ffunicode.c \ # suppress warning caused by fatfs -CFLAGS_GCC += -Wno-error=cast-qual +CFLAGS += -Wno-error=cast-qual include ../../../hw/bsp/family_rules.mk diff --git a/examples/host/msc_file_explorer/src/msc_app.c b/examples/host/msc_file_explorer/src/msc_app.c index c7cc366b5..3f15bb84f 100644 --- a/examples/host/msc_file_explorer/src/msc_app.c +++ b/examples/host/msc_file_explorer/src/msc_app.c @@ -260,7 +260,7 @@ DRESULT disk_ioctl(BYTE pdrv, /* Physical drive nmuber (0..) */ return RES_OK; case GET_SECTOR_COUNT: - *((DWORD *)buff) = (WORD)tuh_msc_get_block_count(dev_addr, lun); + *((DWORD *)buff) = (DWORD)tuh_msc_get_block_count(dev_addr, lun); return RES_OK; case GET_SECTOR_SIZE: |
