From 9bf18d080b202e8e09bd76f32272b1dbfabfa3b9 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 14 Oct 2025 15:14:43 +0700 Subject: move make.mk to hw/bsp/family_support.mk --- examples/build_system/make/make.mk | 190 ------------------------------------- 1 file changed, 190 deletions(-) delete mode 100644 examples/build_system/make/make.mk (limited to 'examples/build_system/make') diff --git a/examples/build_system/make/make.mk b/examples/build_system/make/make.mk deleted file mode 100644 index 4f5d3242e..000000000 --- a/examples/build_system/make/make.mk +++ /dev/null @@ -1,190 +0,0 @@ -# --------------------------------------- -# Common make definition for all examples -# --------------------------------------- - -# upper helper function -to_upper = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$(subst -,_,$(1)))))))))))))))))))))))))))) - -#------------------------------------------------------------- -# Toolchain -# Can be changed via TOOLCHAIN=gcc|iar or CC=arm-none-eabi-gcc|iccarm|clang -#------------------------------------------------------------- -ifneq (,$(findstring clang,$(CC))) - TOOLCHAIN = clang -else ifneq (,$(findstring iccarm,$(CC))) - TOOLCHAIN = iar -else ifneq (,$(findstring gcc,$(CC))) - TOOLCHAIN = gcc -endif - -# Default to GCC -ifndef TOOLCHAIN - TOOLCHAIN = gcc -endif - -#-------------- TOP and CURRENT_PATH ------------ - -# Set TOP to be the path to get from the current directory (where make was invoked) to the top of the tree. -# $(lastword $(MAKEFILE_LIST)) returns the name of this makefile relative to where make was invoked. -THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST)) - -# strip off /examples/build_system/make to get for example ../../.. -# and Set TOP to an absolute path -TOP = $(abspath $(subst make.mk,../../..,$(THIS_MAKEFILE))) - -# Set CURRENT_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc_freertos -CURRENT_PATH = $(subst $(TOP)/,,$(abspath .)) - -#-------------- Linux/Windows ------------ - -# Detect whether shell style is windows or not -# https://stackoverflow.com/questions/714100/os-detecting-makefile/52062069#52062069 -ifeq '$(findstring ;,$(PATH))' ';' -# PATH contains semicolon - so we're definitely on Windows. -CMDEXE := 1 - -# makefile shell commands should use syntax for DOS CMD, not unix sh -# Force DOS command shell on Windows. -SHELL := cmd.exe -endif - -ifeq ($(CMDEXE),1) - CP = copy - RM = del - MKDIR = mkdir - PYTHON = python -else - CP = cp - RM = rm - MKDIR = mkdir - PYTHON = python3 -endif - - -# Build directory -BUILD := _build/$(BOARD) - -PROJECT := $(notdir $(CURDIR)) -BIN := $(TOP)/_bin/$(BOARD)/$(notdir $(CURDIR)) - -#------------------------------------------------------------- -# Board / Family -#------------------------------------------------------------- - -# Board without family -ifneq ($(wildcard $(TOP)/hw/bsp/$(BOARD)/board.mk),) - BOARD_PATH := hw/bsp/$(BOARD) - FAMILY := -endif - -# Board within family -ifeq ($(BOARD_PATH),) - BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/*/boards/$(BOARD))) - FAMILY := $(word 3, $(subst /, ,$(BOARD_PATH))) - FAMILY_PATH = hw/bsp/$(FAMILY) -endif - -ifeq ($(BOARD_PATH),) - $(info You must provide a BOARD parameter with 'BOARD=') - $(error Invalid BOARD specified) -endif - -ifeq ($(FAMILY),) - include $(TOP)/hw/bsp/$(BOARD)/board.mk -else - # Include Family and Board specific defs - include $(TOP)/$(FAMILY_PATH)/family.mk - SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c)) -endif - -#------------------------------------------------------------- -# Source files and compiler flags -#------------------------------------------------------------- -# tinyusb makefile -include $(TOP)/src/tinyusb.mk -SRC_C += $(TINYUSB_SRC_C) - -# Include all source C in family & board folder -SRC_C += hw/bsp/board.c -SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(BOARD_PATH)/*.c)) - -INC += \ - $(TOP)/$(FAMILY_PATH) \ - $(TOP)/src \ - -BOARD_UPPER = $(call to_upper,$(BOARD)) -CFLAGS += -DBOARD_$(BOARD_UPPER) - -ifdef CFLAGS_CLI - CFLAGS += $(CFLAGS_CLI) -endif - -# use max3421 as host controller -ifeq (${MAX3421_HOST},1) - SRC_C += src/portable/analog/max3421/hcd_max3421.c - CFLAGS += -DCFG_TUH_MAX3421=1 -endif - -# Log level is mapped to TUSB DEBUG option -ifneq ($(LOG),) - CFLAGS += -DCFG_TUSB_DEBUG=$(LOG) -endif - -# Logger: default is uart, can be set to rtt or swo -ifeq ($(LOGGER),rtt) - CFLAGS += -DLOGGER_RTT - #CFLAGS += -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL - INC += $(TOP)/lib/SEGGER_RTT/RTT - SRC_C += lib/SEGGER_RTT/RTT/SEGGER_RTT.c -endif -ifeq ($(LOGGER),swo) - CFLAGS += -DLOGGER_SWO -else - CFLAGS += -DLOGGER_UART -endif - -# CPU specific flags -ifdef CPU_CORE - include ${TOP}/examples/build_system/make/cpu/$(CPU_CORE).mk -endif - -# toolchain specific -include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN).mk - -#---------------------- FreeRTOS ----------------------- -FREERTOS_SRC = lib/FreeRTOS-Kernel -FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC) - -ifeq ($(RTOS),freertos) - SRC_C += \ - $(FREERTOS_SRC)/list.c \ - $(FREERTOS_SRC)/queue.c \ - $(FREERTOS_SRC)/tasks.c \ - $(FREERTOS_SRC)/timers.c \ - $(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.c)) - - SRC_S += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s)) - INC += \ - $(TOP)/hw/bsp/$(FAMILY)/FreeRTOSConfig \ - $(TOP)/$(FREERTOS_SRC)/include \ - $(TOP)/$(FREERTOS_PORTABLE_SRC) - - CFLAGS += -DCFG_TUSB_OS=OPT_OS_FREERTOS - - # Suppress FreeRTOSConfig.h warnings - CFLAGS_GCC += -Wno-error=redundant-decls - - # Suppress FreeRTOS source warnings - CFLAGS_GCC += -Wno-error=cast-qual - - # FreeRTOS (lto + Os) linker issue - LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext -endif - -#---------------- Helper ---------------- -check_defined = \ - $(strip $(foreach 1,$1, \ - $(call __check_defined,$1,$(strip $(value 2))))) -__check_defined = \ - $(if $(value $1),, \ - $(error Undefined make flag: $1$(if $2, ($2)))) -- cgit v1.3.1 From c48bbfab5e9ae9a417e30b0f9c0280d6f662b01c Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 14 Oct 2025 17:53:55 +0700 Subject: more make refactor --- examples/build_system/make/rules.mk | 195 --------------------- examples/device/audio_4_channel_mic/Makefile | 6 +- .../device/audio_4_channel_mic_freertos/Makefile | 6 +- examples/device/audio_test/Makefile | 6 +- examples/device/audio_test_freertos/Makefile | 6 +- examples/device/audio_test_multi_rate/Makefile | 6 +- examples/device/board_test/Makefile | 6 +- examples/device/cdc_dual_ports/Makefile | 6 +- examples/device/cdc_msc/Makefile | 6 +- examples/device/cdc_msc_freertos/Makefile | 6 +- examples/device/cdc_uac2/Makefile | 6 +- examples/device/dfu/Makefile | 6 +- examples/device/dfu_runtime/Makefile | 6 +- examples/device/dynamic_configuration/Makefile | 6 +- examples/device/hid_boot_interface/Makefile | 6 +- examples/device/hid_composite/Makefile | 6 +- examples/device/hid_composite_freertos/Makefile | 6 +- examples/device/hid_generic_inout/Makefile | 6 +- examples/device/hid_multiple_interface/Makefile | 6 +- examples/device/midi_test/Makefile | 6 +- examples/device/midi_test_freertos/Makefile | 6 +- examples/device/msc_dual_lun/Makefile | 6 +- examples/device/mtp/Makefile | 6 +- examples/device/net_lwip_webserver/Makefile | 5 +- examples/device/uac2_headset/Makefile | 6 +- examples/device/uac2_speaker_fb/Makefile | 6 +- examples/device/usbtmc/Makefile | 6 +- examples/device/video_capture/Makefile | 6 +- examples/device/video_capture_2ch/Makefile | 6 +- examples/device/webusb_serial/Makefile | 6 +- examples/dual/host_hid_to_device_cdc/Makefile | 6 +- examples/dual/host_info_to_device_cdc/Makefile | 6 +- examples/host/bare_api/Makefile | 6 +- examples/host/cdc_msc_hid/Makefile | 6 +- examples/host/cdc_msc_hid_freertos/Makefile | 6 +- examples/host/device_info/Makefile | 6 +- examples/host/hid_controller/Makefile | 6 +- examples/host/midi_rx/Makefile | 6 +- examples/host/msc_file_explorer/Makefile | 5 +- examples/typec/power_delivery/Makefile | 10 +- hw/bsp/family_rules.mk | 177 +++++++++++++++++++ hw/bsp/family_support.mk | 8 +- test/fuzz/device/cdc/Makefile | 6 +- test/fuzz/device/msc/Makefile | 6 +- test/fuzz/device/net/Makefile | 5 +- test/fuzz/make.mk | 6 +- 46 files changed, 310 insertions(+), 329 deletions(-) delete mode 100644 examples/build_system/make/rules.mk create mode 100644 hw/bsp/family_rules.mk (limited to 'examples/build_system/make') diff --git a/examples/build_system/make/rules.mk b/examples/build_system/make/rules.mk deleted file mode 100644 index 86de17b6c..000000000 --- a/examples/build_system/make/rules.mk +++ /dev/null @@ -1,195 +0,0 @@ -# --------------------------------------- -# Common make rules for all examples -# --------------------------------------- - -# Set all as default goal -.DEFAULT_GOAL := all - -# ---------------- GNU Make Start ----------------------- -# ESP32-Sx and RP2040 has its own CMake build system -ifeq (,$(findstring $(FAMILY),espressif rp2040)) - -# --------------------------------------- -# Rules -# --------------------------------------- - -all: $(BUILD)/$(PROJECT).bin $(BUILD)/$(PROJECT).hex size - -uf2: $(BUILD)/$(PROJECT).uf2 - -# We set vpath to point to the top of the tree so that the source files -# can be located. By following this scheme, it allows a single build rule -# to be used to compile all .c files. -vpath %.c . $(TOP) -vpath %.s . $(TOP) -vpath %.S . $(TOP) - -include ${TOP}/examples/build_system/make/toolchain/$(TOOLCHAIN)_rules.mk - -# --------------------------------------- -# Compiler Flags -# --------------------------------------- - -CFLAGS += $(addprefix -I,$(INC)) - -# Verbose mode -ifeq ("$(V)","1") -$(info CFLAGS $(CFLAGS) ) $(info ) -$(info LDFLAGS $(LDFLAGS)) $(info ) -$(info ASFLAGS $(ASFLAGS)) $(info ) -endif - - -OBJ_DIRS = $(sort $(dir $(OBJ))) -$(OBJ): | $(OBJ_DIRS) -$(OBJ_DIRS): -ifeq ($(CMDEXE),1) - -@$(MKDIR) $(subst /,\,$@) -else - @$(MKDIR) -p $@ -endif - -# UF2 generation, iMXRT need to strip to text only before conversion -ifneq ($(FAMILY),imxrt) -$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).hex - @echo CREATE $@ - $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -c -o $@ $^ -endif - -copy-artifact: $(BUILD)/$(PROJECT).bin $(BUILD)/$(PROJECT).hex $(BUILD)/$(PROJECT).uf2 - -endif -# ---------------- GNU Make End ----------------------- - -.PHONY: clean -clean: -ifeq ($(CMDEXE),1) - rd /S /Q $(subst /,\,$(BUILD)) -else - $(RM) -rf $(BUILD) -endif - -# get depenecies -.PHONY: get-deps -get-deps: - $(PYTHON) $(TOP)/tools/get_deps.py ${FAMILY} - -.PHONY: size -size: $(BUILD)/$(PROJECT).elf - -@echo '' - @$(SIZE) $< - -@echo '' - -# linkermap must be install previously at https://github.com/hathach/linkermap -linkermap: $(BUILD)/$(PROJECT).elf - @linkermap -v $<.map - -# --------------------------------------- -# Flash Targets -# --------------------------------------- - -# --------------- Jlink ----------------- -ifeq ($(OS),Windows_NT) - JLINKEXE = JLink.exe -else - JLINKEXE = JLinkExe -endif - -# Jlink Interface -JLINK_IF ?= swd - -# Jlink script -$(BUILD)/$(BOARD).jlink: $(BUILD)/$(PROJECT).hex - @echo halt > $@ - @echo loadfile $^ >> $@ - @echo r >> $@ - @echo go >> $@ - @echo exit >> $@ - -# Flash using jlink -flash-jlink: $(BUILD)/$(BOARD).jlink - $(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $< - -# --------------- stm32 cube programmer ----------------- -# Flash STM32 MCU using stlink with STM32 Cube Programmer CLI -flash-stlink: $(BUILD)/$(PROJECT).elf - STM32_Programmer_CLI --connect port=swd --write $< --go - -# --------------- xfel ----------------- -$(BUILD)/$(PROJECT)-sunxi.bin: $(BUILD)/$(PROJECT).bin - $(PYTHON) $(TOP)/tools/mksunxi.py $< $@ - -flash-xfel: $(BUILD)/$(PROJECT)-sunxi.bin - xfel spinor write 0 $< - xfel reset - -# --------------- pyocd ----------------- -PYOCD_OPTION ?= -flash-pyocd: $(BUILD)/$(PROJECT).hex - pyocd flash -t $(PYOCD_TARGET) $(PYOCD_OPTION) $< - #pyocd reset -t $(PYOCD_TARGET) - -# --------------- openocd ----------------- -OPENOCD_OPTION ?= -flash-openocd: $(BUILD)/$(PROJECT).elf - openocd $(OPENOCD_OPTION) -c "program $< verify reset exit" - -# --------------- openocd-wch ----------------- -# wch-linke is not supported yet in official openOCD yet. We need to either use -# 1. download openocd as part of mounriver studio http://www.mounriver.com/download or -# 2. compiled from https://github.com/hathach/riscv-openocd-wch or -# https://github.com/dragonlock2/miscboards/blob/main/wch/SDK/riscv-openocd.tar.xz -# with ./configure --disable-werror --enable-wlinke --enable-ch347=no -OPENOCD_WCH ?= /home/${USER}/app/riscv-openocd-wch/src/openocd -OPENOCD_WCH_OPTION ?= -flash-openocd-wch: $(BUILD)/$(PROJECT).elf - $(OPENOCD_WCH) $(OPENOCD_WCH_OPTION) -c init -c halt -c "flash write_image $<" -c reset -c exit - -# --------------- wlink-rs ----------------- -# flash with https://github.com/ch32-rs/wlink -WLINK_RS ?= wlink -flash-wlink-rs: $(BUILD)/$(PROJECT).elf - $(WLINK_RS) flash $< - -# --------------- dfu-util ----------------- -DFU_UTIL_OPTION ?= -a 0 -flash-dfu-util: $(BUILD)/$(PROJECT).bin - dfu-util -R $(DFU_UTIL_OPTION) -D $< - -# --------------- Black Magic ----------------- -# This symlink is created by https://github.com/blacksphere/blackmagic/blob/master/driver/99-blackmagic.rules -BMP ?= /dev/ttyBmpGdb - -flash-bmp: $(BUILD)/$(PROJECT).elf - $(GDB) --batch -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' -ex load $< - -debug-bmp: $(BUILD)/$(PROJECT).elf - $(GDB) -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' $< - -# --------------- TI Uniflash ----------------- -DSLITE ?= dslite.sh -flash-uniflash: $(BUILD)/$(PROJECT).hex - ${DSLITE} ${UNIFLASH_OPTION} -f $< - -#-------------- Artifacts -------------- - -# Create binary directory -$(BIN): -ifeq ($(CMDEXE),1) - @$(MKDIR) $(subst /,\,$@) -else - @$(MKDIR) -p $@ -endif - -# Copy binaries .elf, .bin, .hex, .uf2 to BIN for upload -# due to large size of combined artifacts, only uf2 is uploaded for now -copy-artifact: $(BIN) - @$(CP) $(BUILD)/$(PROJECT).uf2 $(BIN) - #@$(CP) $(BUILD)/$(PROJECT).bin $(BIN) - #@$(CP) $(BUILD)/$(PROJECT).hex $(BIN) - #@$(CP) $(BUILD)/$(PROJECT).elf $(BIN) - -# Print out the value of a make variable. -# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile -print-%: - @echo $* = $($*) diff --git a/examples/device/audio_4_channel_mic/Makefile b/examples/device/audio_4_channel_mic/Makefile index 4cf2d9e49..31e2c6f44 100644 --- a/examples/device/audio_4_channel_mic/Makefile +++ b/examples/device/audio_4_channel_mic/Makefile @@ -2,13 +2,13 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += \ src/main.c \ src/usb_descriptors.c \ -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/audio_4_channel_mic_freertos/Makefile b/examples/device/audio_4_channel_mic_freertos/Makefile index 13c637977..3c421af74 100644 --- a/examples/device/audio_4_channel_mic_freertos/Makefile +++ b/examples/device/audio_4_channel_mic_freertos/Makefile @@ -3,13 +3,13 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE = \ src/main.c \ src/usb_descriptors.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/audio_test/Makefile b/examples/device/audio_test/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/audio_test/Makefile +++ b/examples/device/audio_test/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/audio_test_freertos/Makefile b/examples/device/audio_test_freertos/Makefile index 13c637977..3c421af74 100644 --- a/examples/device/audio_test_freertos/Makefile +++ b/examples/device/audio_test_freertos/Makefile @@ -3,13 +3,13 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE = \ src/main.c \ src/usb_descriptors.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/audio_test_multi_rate/Makefile b/examples/device/audio_test_multi_rate/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/audio_test_multi_rate/Makefile +++ b/examples/device/audio_test_multi_rate/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/board_test/Makefile b/examples/device/board_test/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/board_test/Makefile +++ b/examples/device/board_test/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/cdc_dual_ports/Makefile b/examples/device/cdc_dual_ports/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/cdc_dual_ports/Makefile +++ b/examples/device/cdc_dual_ports/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/cdc_msc/Makefile b/examples/device/cdc_msc/Makefile index eb548f018..de50d118f 100644 --- a/examples/device/cdc_msc/Makefile +++ b/examples/device/cdc_msc/Makefile @@ -2,7 +2,7 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += \ @@ -10,6 +10,6 @@ EXAMPLE_SOURCE += \ src/msc_disk.c \ src/usb_descriptors.c \ -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/cdc_msc_freertos/Makefile b/examples/device/cdc_msc_freertos/Makefile index 41960e64c..dbab13395 100644 --- a/examples/device/cdc_msc_freertos/Makefile +++ b/examples/device/cdc_msc_freertos/Makefile @@ -3,7 +3,7 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE = \ @@ -11,6 +11,6 @@ EXAMPLE_SOURCE = \ src/msc_disk.c \ src/usb_descriptors.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/cdc_uac2/Makefile b/examples/device/cdc_uac2/Makefile index 539077d6c..6276be8d0 100644 --- a/examples/device/cdc_uac2/Makefile +++ b/examples/device/cdc_uac2/Makefile @@ -2,7 +2,7 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += \ @@ -11,6 +11,6 @@ EXAMPLE_SOURCE += \ src/uac2_app.c \ src/usb_descriptors.c \ -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/dfu/Makefile b/examples/device/dfu/Makefile index ad7a37b79..9e1eab4a2 100644 --- a/examples/device/dfu/Makefile +++ b/examples/device/dfu/Makefile @@ -2,13 +2,13 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE = \ src/main.c \ src/usb_descriptors.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/dfu_runtime/Makefile b/examples/device/dfu_runtime/Makefile index 72bd56ede..1a4b428dc 100644 --- a/examples/device/dfu_runtime/Makefile +++ b/examples/device/dfu_runtime/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/dynamic_configuration/Makefile b/examples/device/dynamic_configuration/Makefile index 72bd56ede..1a4b428dc 100644 --- a/examples/device/dynamic_configuration/Makefile +++ b/examples/device/dynamic_configuration/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/hid_boot_interface/Makefile b/examples/device/hid_boot_interface/Makefile index ad7a37b79..9e1eab4a2 100644 --- a/examples/device/hid_boot_interface/Makefile +++ b/examples/device/hid_boot_interface/Makefile @@ -2,13 +2,13 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE = \ src/main.c \ src/usb_descriptors.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/hid_composite/Makefile b/examples/device/hid_composite/Makefile index 72bd56ede..1a4b428dc 100644 --- a/examples/device/hid_composite/Makefile +++ b/examples/device/hid_composite/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/hid_composite_freertos/Makefile b/examples/device/hid_composite_freertos/Makefile index 13c637977..3c421af74 100644 --- a/examples/device/hid_composite_freertos/Makefile +++ b/examples/device/hid_composite_freertos/Makefile @@ -3,13 +3,13 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE = \ src/main.c \ src/usb_descriptors.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/hid_generic_inout/Makefile b/examples/device/hid_generic_inout/Makefile index 72bd56ede..1a4b428dc 100644 --- a/examples/device/hid_generic_inout/Makefile +++ b/examples/device/hid_generic_inout/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/hid_multiple_interface/Makefile b/examples/device/hid_multiple_interface/Makefile index 72bd56ede..1a4b428dc 100644 --- a/examples/device/hid_multiple_interface/Makefile +++ b/examples/device/hid_multiple_interface/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/midi_test/Makefile b/examples/device/midi_test/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/midi_test/Makefile +++ b/examples/device/midi_test/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/midi_test_freertos/Makefile b/examples/device/midi_test_freertos/Makefile index 704d319d2..ebacfecdf 100644 --- a/examples/device/midi_test_freertos/Makefile +++ b/examples/device/midi_test_freertos/Makefile @@ -3,13 +3,13 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += \ src/main.c \ src/usb_descriptors.c \ -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/msc_dual_lun/Makefile b/examples/device/msc_dual_lun/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/msc_dual_lun/Makefile +++ b/examples/device/msc_dual_lun/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/mtp/Makefile b/examples/device/mtp/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/mtp/Makefile +++ b/examples/device/mtp/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/net_lwip_webserver/Makefile b/examples/device/net_lwip_webserver/Makefile index 82c946b14..9d8e8ec77 100644 --- a/examples/device/net_lwip_webserver/Makefile +++ b/examples/device/net_lwip_webserver/Makefile @@ -8,7 +8,6 @@ CFLAGS_GCC += \ INC += \ src \ - $(TOP)/hw \ $(TOP)/lib/lwip/src/include \ $(TOP)/lib/lwip/src/include/ipv4 \ $(TOP)/lib/lwip/src/include/lwip/apps \ @@ -16,7 +15,7 @@ INC += \ # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) # lwip sources SRC_C += \ @@ -66,4 +65,4 @@ SRC_C += \ lib/networking/dnserver.c \ lib/networking/rndis_reports.c -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/uac2_headset/Makefile b/examples/device/uac2_headset/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/uac2_headset/Makefile +++ b/examples/device/uac2_headset/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/uac2_speaker_fb/Makefile b/examples/device/uac2_speaker_fb/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/uac2_speaker_fb/Makefile +++ b/examples/device/uac2_speaker_fb/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/usbtmc/Makefile b/examples/device/usbtmc/Makefile index 72bd56ede..1a4b428dc 100644 --- a/examples/device/usbtmc/Makefile +++ b/examples/device/usbtmc/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/video_capture/Makefile b/examples/device/video_capture/Makefile index 288e9ffc3..6c248ab7b 100644 --- a/examples/device/video_capture/Makefile +++ b/examples/device/video_capture/Makefile @@ -9,10 +9,10 @@ endif INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/video_capture_2ch/Makefile b/examples/device/video_capture_2ch/Makefile index 288e9ffc3..6c248ab7b 100644 --- a/examples/device/video_capture_2ch/Makefile +++ b/examples/device/video_capture_2ch/Makefile @@ -9,10 +9,10 @@ endif INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/device/webusb_serial/Makefile b/examples/device/webusb_serial/Makefile index e8cacd359..035e90308 100644 --- a/examples/device/webusb_serial/Makefile +++ b/examples/device/webusb_serial/Makefile @@ -2,10 +2,10 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/dual/host_hid_to_device_cdc/Makefile b/examples/dual/host_hid_to_device_cdc/Makefile index 76c6db0ac..a51251bf9 100644 --- a/examples/dual/host_hid_to_device_cdc/Makefile +++ b/examples/dual/host_hid_to_device_cdc/Makefile @@ -2,11 +2,11 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) CFLAGS_GCC += -Wno-error=cast-align -Wno-error=null-dereference @@ -15,4 +15,4 @@ SRC_C += \ src/host/hub.c \ src/host/usbh.c -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/dual/host_info_to_device_cdc/Makefile b/examples/dual/host_info_to_device_cdc/Makefile index 071185c88..659cf6ff9 100644 --- a/examples/dual/host_info_to_device_cdc/Makefile +++ b/examples/dual/host_info_to_device_cdc/Makefile @@ -2,11 +2,11 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) CFLAGS_GCC += -Wno-error=cast-align -Wno-error=null-dereference @@ -14,4 +14,4 @@ SRC_C += \ src/host/hub.c \ src/host/usbh.c -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/host/bare_api/Makefile b/examples/host/bare_api/Makefile index e6408c77a..f8292385e 100644 --- a/examples/host/bare_api/Makefile +++ b/examples/host/bare_api/Makefile @@ -2,12 +2,12 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += \ src/main.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/host/cdc_msc_hid/Makefile b/examples/host/cdc_msc_hid/Makefile index b6036fa26..d72e91e74 100644 --- a/examples/host/cdc_msc_hid/Makefile +++ b/examples/host/cdc_msc_hid/Makefile @@ -2,7 +2,7 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE = \ @@ -11,6 +11,6 @@ EXAMPLE_SOURCE = \ src/main.c \ src/msc_app.c \ -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/host/cdc_msc_hid_freertos/Makefile b/examples/host/cdc_msc_hid_freertos/Makefile index 4e8c8b116..2e323ed56 100644 --- a/examples/host/cdc_msc_hid_freertos/Makefile +++ b/examples/host/cdc_msc_hid_freertos/Makefile @@ -3,7 +3,7 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE = \ @@ -12,6 +12,6 @@ EXAMPLE_SOURCE = \ src/main.c \ src/msc_app.c \ -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/host/device_info/Makefile b/examples/host/device_info/Makefile index e6408c77a..f8292385e 100644 --- a/examples/host/device_info/Makefile +++ b/examples/host/device_info/Makefile @@ -2,12 +2,12 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += \ src/main.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/host/hid_controller/Makefile b/examples/host/hid_controller/Makefile index f82054e8c..732520c63 100644 --- a/examples/host/hid_controller/Makefile +++ b/examples/host/hid_controller/Makefile @@ -2,13 +2,13 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += \ src/hid_app.c \ src/main.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/host/midi_rx/Makefile b/examples/host/midi_rx/Makefile index e6408c77a..f8292385e 100644 --- a/examples/host/midi_rx/Makefile +++ b/examples/host/midi_rx/Makefile @@ -2,12 +2,12 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source EXAMPLE_SOURCE += \ src/main.c -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/host/msc_file_explorer/Makefile b/examples/host/msc_file_explorer/Makefile index 0f87d848d..39d00d982 100644 --- a/examples/host/msc_file_explorer/Makefile +++ b/examples/host/msc_file_explorer/Makefile @@ -4,7 +4,6 @@ FATFS_PATH = lib/fatfs/source INC += \ src \ - $(TOP)/hw \ $(TOP)/$(FATFS_PATH) \ $(TOP)/lib/embedded-cli \ @@ -13,7 +12,7 @@ EXAMPLE_SOURCE = \ src/main.c \ src/msc_app.c \ -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) # FatFS source SRC_C += \ @@ -24,4 +23,4 @@ SRC_C += \ # suppress warning caused by fatfs CFLAGS_GCC += -Wno-error=cast-qual -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/examples/typec/power_delivery/Makefile b/examples/typec/power_delivery/Makefile index e8cacd359..7f65c689a 100644 --- a/examples/typec/power_delivery/Makefile +++ b/examples/typec/power_delivery/Makefile @@ -2,10 +2,12 @@ include ../../../hw/bsp/family_support.mk INC += \ src \ - $(TOP)/hw \ + # Example source -EXAMPLE_SOURCE += $(wildcard src/*.c) -SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) +EXAMPLE_SOURCE += \ + src/main.c + +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE)) -include ../../build_system/make/rules.mk +include ../../../hw/bsp/family_rules.mk diff --git a/hw/bsp/family_rules.mk b/hw/bsp/family_rules.mk new file mode 100644 index 000000000..ccf49dd0e --- /dev/null +++ b/hw/bsp/family_rules.mk @@ -0,0 +1,177 @@ +# --------------------------------------- +# Common make rules for all examples +# --------------------------------------- + +# Set all as default goal +.DEFAULT_GOAL := all + +# ---------------- GNU Make Start ----------------------- +# ESP32-Sx and RP2040 has its own CMake build system +ifeq (,$(findstring $(FAMILY),espressif rp2040)) + +# --------------------------------------- +# Rules +# --------------------------------------- + +all: $(BUILD)/$(PROJECT).bin $(BUILD)/$(PROJECT).hex size + +uf2: $(BUILD)/$(PROJECT).uf2 + +# We set vpath to point to the top of the tree so that the source files +# can be located. By following this scheme, it allows a single build rule +# to be used to compile all .c files. +vpath %.c . $(TOP) +vpath %.s . $(TOP) +vpath %.S . $(TOP) + +include ${TOP}/examples/build_system/make/toolchain/$(TOOLCHAIN)_rules.mk + +# --------------------------------------- +# Compiler Flags +# --------------------------------------- + +CFLAGS += $(addprefix -I,$(INC)) + +# Verbose mode +ifeq ("$(V)","1") +$(info CFLAGS $(CFLAGS) ) $(info ) +$(info LDFLAGS $(LDFLAGS)) $(info ) +$(info ASFLAGS $(ASFLAGS)) $(info ) +endif + + +OBJ_DIRS = $(sort $(dir $(OBJ))) +$(OBJ): | $(OBJ_DIRS) +$(OBJ_DIRS): +ifeq ($(CMDEXE),1) + -@$(MKDIR) $(subst /,\,$@) +else + @$(MKDIR) -p $@ +endif + +# UF2 generation, iMXRT need to strip to text only before conversion +ifneq ($(FAMILY),imxrt) +$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).hex + @echo CREATE $@ + $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -c -o $@ $^ +endif + +copy-artifact: $(BUILD)/$(PROJECT).bin $(BUILD)/$(PROJECT).hex $(BUILD)/$(PROJECT).uf2 + +endif +# ---------------- GNU Make End ----------------------- + +.PHONY: clean +clean: +ifeq ($(CMDEXE),1) + rd /S /Q $(subst /,\,$(BUILD)) +else + $(RM) -rf $(BUILD) +endif + +# get depenecies +.PHONY: get-deps +get-deps: + $(PYTHON) $(TOP)/tools/get_deps.py ${FAMILY} + +.PHONY: size +size: $(BUILD)/$(PROJECT).elf + -@echo '' + @$(SIZE) $< + -@echo '' + +# linkermap must be install previously at https://github.com/hathach/linkermap +linkermap: $(BUILD)/$(PROJECT).elf + @linkermap -v $<.map + +# --------------------------------------- +# Flash Targets +# --------------------------------------- + +# --------------- Jlink ----------------- +ifeq ($(OS),Windows_NT) + JLINKEXE = JLink.exe +else + JLINKEXE = JLinkExe +endif + +# Jlink Interface +JLINK_IF ?= swd + +# Jlink script +$(BUILD)/$(BOARD).jlink: $(BUILD)/$(PROJECT).hex + @echo halt > $@ + @echo loadfile $^ >> $@ + @echo r >> $@ + @echo go >> $@ + @echo exit >> $@ + +# Flash using jlink +flash-jlink: $(BUILD)/$(BOARD).jlink + $(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $< + +# --------------- stm32 cube programmer ----------------- +# Flash STM32 MCU using stlink with STM32 Cube Programmer CLI +flash-stlink: $(BUILD)/$(PROJECT).elf + STM32_Programmer_CLI --connect port=swd --write $< --go + +# --------------- xfel ----------------- +$(BUILD)/$(PROJECT)-sunxi.bin: $(BUILD)/$(PROJECT).bin + $(PYTHON) $(TOP)/tools/mksunxi.py $< $@ + +flash-xfel: $(BUILD)/$(PROJECT)-sunxi.bin + xfel spinor write 0 $< + xfel reset + +# --------------- pyocd ----------------- +PYOCD_OPTION ?= +flash-pyocd: $(BUILD)/$(PROJECT).hex + pyocd flash -t $(PYOCD_TARGET) $(PYOCD_OPTION) $< + #pyocd reset -t $(PYOCD_TARGET) + +# --------------- openocd ----------------- +OPENOCD_OPTION ?= +flash-openocd: $(BUILD)/$(PROJECT).elf + openocd $(OPENOCD_OPTION) -c "program $< verify reset exit" + +# --------------- openocd-wch ----------------- +# wch-linke is not supported yet in official openOCD yet. We need to either use +# 1. download openocd as part of mounriver studio http://www.mounriver.com/download or +# 2. compiled from https://github.com/hathach/riscv-openocd-wch or +# https://github.com/dragonlock2/miscboards/blob/main/wch/SDK/riscv-openocd.tar.xz +# with ./configure --disable-werror --enable-wlinke --enable-ch347=no +OPENOCD_WCH ?= /home/${USER}/app/riscv-openocd-wch/src/openocd +OPENOCD_WCH_OPTION ?= +flash-openocd-wch: $(BUILD)/$(PROJECT).elf + $(OPENOCD_WCH) $(OPENOCD_WCH_OPTION) -c init -c halt -c "flash write_image $<" -c reset -c exit + +# --------------- wlink-rs ----------------- +# flash with https://github.com/ch32-rs/wlink +WLINK_RS ?= wlink +flash-wlink-rs: $(BUILD)/$(PROJECT).elf + $(WLINK_RS) flash $< + +# --------------- dfu-util ----------------- +DFU_UTIL_OPTION ?= -a 0 +flash-dfu-util: $(BUILD)/$(PROJECT).bin + dfu-util -R $(DFU_UTIL_OPTION) -D $< + +# --------------- Black Magic ----------------- +# This symlink is created by https://github.com/blacksphere/blackmagic/blob/master/driver/99-blackmagic.rules +BMP ?= /dev/ttyBmpGdb + +flash-bmp: $(BUILD)/$(PROJECT).elf + $(GDB) --batch -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' -ex load $< + +debug-bmp: $(BUILD)/$(PROJECT).elf + $(GDB) -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' $< + +# --------------- TI Uniflash ----------------- +DSLITE ?= dslite.sh +flash-uniflash: $(BUILD)/$(PROJECT).hex + ${DSLITE} ${UNIFLASH_OPTION} -f $< + +# Print out the value of a make variable. +# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile +print-%: + @echo $* = $($*) diff --git a/hw/bsp/family_support.mk b/hw/bsp/family_support.mk index 757982b85..2e236dc4a 100644 --- a/hw/bsp/family_support.mk +++ b/hw/bsp/family_support.mk @@ -22,7 +22,7 @@ ifndef TOOLCHAIN TOOLCHAIN = gcc endif -#-------------- TOP and CURRENT_PATH ------------ +#-------------- TOP and EXAMPLE_PATH ------------ # Set TOP to be the path to get from the current directory (where make was invoked) to the top of the tree. # $(lastword $(MAKEFILE_LIST)) returns the name of this makefile relative to where make was invoked. @@ -31,8 +31,8 @@ THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST)) # Set TOP to an absolute path TOP = $(abspath $(subst family_support.mk,../..,$(THIS_MAKEFILE))) -# Set CURRENT_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc_freertos -CURRENT_PATH = $(subst $(TOP)/,,$(abspath .)) +# Set EXAMPLE_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc +EXAMPLE_PATH = $(subst $(TOP)/,,$(abspath .)) #-------------- Linux/Windows ------------ # Detect whether shell style is windows or not @@ -62,7 +62,6 @@ endif BUILD := _build/$(BOARD) PROJECT := $(notdir $(CURDIR)) -BIN := $(TOP)/_bin/$(BOARD)/$(notdir $(CURDIR)) #------------------------------------------------------------- # Board / Family @@ -108,6 +107,7 @@ SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(BOARD_PATH)/*.c)) INC += \ $(TOP)/$(FAMILY_PATH) \ $(TOP)/src \ + $(TOP)/hw \ BOARD_UPPER = $(call to_upper,$(BOARD)) CFLAGS += -DBOARD_$(BOARD_UPPER) diff --git a/test/fuzz/device/cdc/Makefile b/test/fuzz/device/cdc/Makefile index 7071df057..d448907f0 100644 --- a/test/fuzz/device/cdc/Makefile +++ b/test/fuzz/device/cdc/Makefile @@ -2,10 +2,10 @@ include ../../make.mk INC += \ src \ - $(TOP)/hw \ + # Example source -SRC_C += $(addprefix $(CURRENT_PATH)/, $(wildcard src/*.c)) -SRC_CXX += $(addprefix $(CURRENT_PATH)/, $(wildcard src/*.cc)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(wildcard src/*.c)) +SRC_CXX += $(addprefix $(EXAMPLE_PATH)/, $(wildcard src/*.cc)) include ../../rules.mk diff --git a/test/fuzz/device/msc/Makefile b/test/fuzz/device/msc/Makefile index 7071df057..d448907f0 100644 --- a/test/fuzz/device/msc/Makefile +++ b/test/fuzz/device/msc/Makefile @@ -2,10 +2,10 @@ include ../../make.mk INC += \ src \ - $(TOP)/hw \ + # Example source -SRC_C += $(addprefix $(CURRENT_PATH)/, $(wildcard src/*.c)) -SRC_CXX += $(addprefix $(CURRENT_PATH)/, $(wildcard src/*.cc)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(wildcard src/*.c)) +SRC_CXX += $(addprefix $(EXAMPLE_PATH)/, $(wildcard src/*.cc)) include ../../rules.mk diff --git a/test/fuzz/device/net/Makefile b/test/fuzz/device/net/Makefile index 2161ad3f1..45c684eec 100644 --- a/test/fuzz/device/net/Makefile +++ b/test/fuzz/device/net/Makefile @@ -8,15 +8,14 @@ CFLAGS += \ INC += \ src \ - $(TOP)/hw \ $(TOP)/lib/lwip/src/include \ $(TOP)/lib/lwip/src/include/ipv4 \ $(TOP)/lib/lwip/src/include/lwip/apps \ $(TOP)/lib/networking # Example source -SRC_C += $(addprefix $(CURRENT_PATH)/, $(wildcard src/*.c)) -SRC_CXX += $(addprefix $(CURRENT_PATH)/, $(wildcard src/*.cc)) +SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(wildcard src/*.c)) +SRC_CXX += $(addprefix $(EXAMPLE_PATH)/, $(wildcard src/*.cc)) # lwip sources SRC_C += \ diff --git a/test/fuzz/make.mk b/test/fuzz/make.mk index e9aa80bf1..733a57134 100644 --- a/test/fuzz/make.mk +++ b/test/fuzz/make.mk @@ -2,7 +2,7 @@ # Common make definition for all examples # --------------------------------------- -#-------------- TOP and CURRENT_PATH ------------ +#-------------- TOP and EXAMPLE_PATH ------------ # Set TOP to be the path to get from the current directory (where make was # invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns @@ -13,8 +13,8 @@ THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST)) # and Set TOP to an absolute path TOP = $(abspath $(subst make.mk,../..,$(THIS_MAKEFILE))) -# Set CURRENT_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc_freertos -CURRENT_PATH = $(subst $(TOP)/,,$(abspath .)) +# Set EXAMPLE_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc_freertos +EXAMPLE_PATH = $(subst $(TOP)/,,$(abspath .)) # Detect whether shell style is windows or not # https://stackoverflow.com/questions/714100/os-detecting-makefile/52062069#52062069 -- cgit v1.3.1 From e7105b1fa3ccd8200fe7fb8b0759d00afc9b07c1 Mon Sep 17 00:00:00 2001 From: Ha Thach Date: Thu, 4 Dec 2025 21:34:10 +0700 Subject: fine tune ci to build more with circleci (#3386) * fine tune ci to build more with circleci * skip make for arm-iar, esp-idf * skip make + clang for circleci since llvm-objcopy got killed due to memory issue. --- .circleci/config.yml | 51 ++++++++++-------- .circleci/config2.yml | 15 +++++- .github/workflows/build.yml | 60 +++------------------- .github/workflows/build_util.yml | 3 ++ examples/build_system/make/toolchain/gcc_common.mk | 3 ++ hw/bsp/kinetis_k/family.mk | 6 ++- hw/bsp/kinetis_kl/family.mk | 6 ++- tools/build.py | 8 +-- tools/metrics.py | 19 +++---- 9 files changed, 74 insertions(+), 97 deletions(-) (limited to 'examples/build_system/make') diff --git a/.circleci/config.yml b/.circleci/config.yml index 580f5fe2e..d04a33959 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,25 +18,34 @@ jobs: MATRIX_JSON=$(python .github/workflows/ci_set_matrix.py) echo "MATRIX_JSON=$MATRIX_JSON" - BUILDSYSTEM_TOOLCHAIN=( - "cmake aarch64-gcc" - "cmake arm-clang" - "cmake arm-gcc" - "cmake esp-idf" - "cmake msp430-gcc" - "cmake riscv-gcc" + BUILDSYSTEM_LIST=( + "cmake" + "make" + ) + + TOOLCHAIN_LIST=( + "aarch64-gcc" + "arm-clang" + "arm-gcc" + "esp-idf" + "msp430-gcc" + "riscv-gcc" ) # only build IAR if not forked PR, since IAR token is not shared if [ -z $CIRCLE_PR_USERNAME ]; then - BUILDSYSTEM_TOOLCHAIN+=("cmake arm-iar") + TOOLCHAIN_LIST+=("arm-iar") fi gen_build_entry() { local build_system="$1" local toolchain="$2" local family="$3" - local resource_class="$4" + local build_args="" + + if [[ "$toolchain" == "arm-iar" || "$build_system" == "make" ]]; then + build_args="--one-per-family" + fi if [[ "$toolchain" == "esp-idf" ]]; then echo " - build-vm:" >> .circleci/config2.yml @@ -49,17 +58,21 @@ jobs: echo " build-system: ['$build_system']" >> .circleci/config2.yml echo " toolchain: ['$toolchain']" >> .circleci/config2.yml echo " family: $family" >> .circleci/config2.yml - echo " resource_class: ['$resource_class']" >> .circleci/config2.yml + echo " resource_class: ['large']" >> .circleci/config2.yml + echo " build-args: ['$build_args']" >> .circleci/config2.yml } - for e in "${BUILDSYSTEM_TOOLCHAIN[@]}"; do - e_arr=($e) - build_system="${e_arr[0]}" - toolchain="${e_arr[1]}" - FAMILY=$(echo $MATRIX_JSON | jq -r ".\"$toolchain\"") - echo "FAMILY_${toolchain}=$FAMILY" + for build_system in "${BUILDSYSTEM_LIST[@]}"; do + for toolchain in "${TOOLCHAIN_LIST[@]}"; do + # make does not support these toolchains + if [ "$build_system" == "make" ] && { [ "$toolchain" == "arm-clang" ] || [ "$toolchain" == "arm-iar" ] || [ "$toolchain" == "esp-idf" ]; }; then + continue + fi - gen_build_entry "$build_system" "$toolchain" "$FAMILY" "large" + FAMILY=$(echo $MATRIX_JSON | jq -r ".\"$toolchain\"") + echo "FAMILY_${toolchain}=$FAMILY" + gen_build_entry "$build_system" "$toolchain" "$FAMILY" + done done - continuation/continue: @@ -67,9 +80,5 @@ jobs: workflows: set-matrix: - # Only build PR here, Push will be built by github action. - when: - and: - - not: << pipeline.git.branch.is_default >> jobs: - set-matrix diff --git a/.circleci/config2.yml b/.circleci/config2.yml index 869597289..77bc4f790 100644 --- a/.circleci/config2.yml +++ b/.circleci/config2.yml @@ -66,6 +66,9 @@ commands: type: string family: type: string + build-args: + type: string + default: "" steps: - checkout @@ -107,7 +110,7 @@ commands: no_output_timeout: 20m command: | if [ << parameters.toolchain >> == esp-idf ]; then - docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.2 python tools/build.py << parameters.family >> + docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.2 python tools/build.py << parameters.build-args >> << parameters.family >> else # Toolchain option default is gcc if [ << parameters.toolchain >> == arm-clang ]; then @@ -121,7 +124,7 @@ commands: # circleci docker return $nproc as 36 core, limit parallel to 4 (resource-class = large) # Required for IAR, also prevent crashed/killed by docker - python tools/build.py -s << parameters.build-system >> $TOOLCHAIN_OPTION -j 4 << parameters.family >> + python tools/build.py -s << parameters.build-system >> $TOOLCHAIN_OPTION -j 4 << parameters.build-args >> << parameters.family >> fi jobs: @@ -137,6 +140,9 @@ jobs: type: string family: type: string + build-args: + type: string + default: "" docker: - image: cimg/base:current @@ -147,6 +153,7 @@ jobs: build-system: << parameters.build-system >> toolchain: << parameters.toolchain >> family: << parameters.family >> + build-args: << parameters.build-args >> # Build using VM build-vm: @@ -160,6 +167,9 @@ jobs: type: string family: type: string + build-args: + type: string + default: "" machine: image: ubuntu-2404:current @@ -170,6 +180,7 @@ jobs: build-system: << parameters.build-system >> toolchain: << parameters.toolchain >> family: << parameters.family >> + build-args: << parameters.build-args >> workflows: build: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77f2d573f..a1bacbc27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,10 +56,11 @@ jobs: echo "hil_matrix=$HIL_MATRIX_JSON" echo "hil_matrix=$HIL_MATRIX_JSON" >> $GITHUB_OUTPUT - # --------------------------------------- - # Build CMake: only one-per-family. - # Full built is done by CircleCI in PR - # --------------------------------------- + # ------------------------------------------------------------------------------ + # CMake build: only one-per-family. Full built is done by CircleCI in PR + # Note: + # For Make and IAR build: will be done on CircleCI only (one-per-family too) + # ------------------------------------------------------------------------------ cmake: needs: set-matrix uses: ./.github/workflows/build_util.yml @@ -70,7 +71,7 @@ jobs: - 'aarch64-gcc' #- 'arm-clang' - 'arm-gcc' - - 'esp-idf' + #- 'esp-idf' - 'msp430-gcc' - 'riscv-gcc' with: @@ -137,52 +138,6 @@ jobs: header: code-metrics path: metrics_compare.md - - # --------------------------------------- - # Build Make: only build on push with one-per-family - # --------------------------------------- - make: - if: github.event_name == 'push' - needs: set-matrix - uses: ./.github/workflows/build_util.yml - strategy: - fail-fast: false - matrix: - toolchain: - - 'aarch64-gcc' - #- 'arm-clang' - - 'arm-gcc' - - 'msp430-gcc' - - 'riscv-gcc' - - 'rx-gcc' - with: - build-system: 'make' - toolchain: ${{ matrix.toolchain }} - build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain]) }} - one-per-family: true - - # --------------------------------------- - # Build IAR - # Since IAR Token secret is not passed to forked PR, only build non-forked PR with make. - # cmake is built by circle-ci. Due to IAR limit capacity, only build oe per family - # --------------------------------------- - arm-iar: - if: false # disable for now since we got reach capacity limit too often - #if: github.event_name == 'push' && github.repository_owner == 'hathach' - needs: set-matrix - uses: ./.github/workflows/build_util.yml - secrets: inherit - strategy: - fail-fast: false - matrix: - build-system: - - 'make' - with: - build-system: ${{ matrix.build-system }} - toolchain: 'arm-iar' - build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)['arm-iar']) }} - one-per-family: true - # --------------------------------------- # Build Make/CMake on Windows/MacOS # --------------------------------------- @@ -193,10 +148,9 @@ jobs: fail-fast: false matrix: os: [ windows-latest, macos-latest ] - build-system: [ 'make', 'cmake' ] with: os: ${{ matrix.os }} - build-system: ${{ matrix.build-system }} + build-system: 'cmake-make' toolchain: 'arm-gcc-${{ matrix.os }}' build-args: '["stm32h7"]' one-per-family: true diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml index 36043a1d5..2fc0eead0 100644 --- a/.github/workflows/build_util.yml +++ b/.github/workflows/build_util.yml @@ -68,6 +68,9 @@ jobs: run: | if [ "$TOOLCHAIN" == "esp-idf" ]; then docker run --rm -v $PWD:/project -w /project espressif/idf:tinyusb python tools/build.py ${{ matrix.arg }} + elif [ "${{ inputs.build-system }}" == "cmake-make" ] || [ "${{ inputs.build-system }}" == "make-cmake" ]; then + python tools/build.py -s make ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }} + python tools/build.py -s cmake ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }} else python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }} fi diff --git a/examples/build_system/make/toolchain/gcc_common.mk b/examples/build_system/make/toolchain/gcc_common.mk index 0cbb6774d..42fd01183 100644 --- a/examples/build_system/make/toolchain/gcc_common.mk +++ b/examples/build_system/make/toolchain/gcc_common.mk @@ -31,6 +31,9 @@ CFLAGS += \ -Wreturn-type \ -Wredundant-decls \ +CFLAGS_CLANG += \ + -Wno-error=unknown-warning-option + # -Wmissing-prototypes \ # conversion is too strict for most mcu driver, may be disable sign/int/arith-conversion # -Wconversion diff --git a/hw/bsp/kinetis_k/family.mk b/hw/bsp/kinetis_k/family.mk index e95cdb717..7a51a77d8 100644 --- a/hw/bsp/kinetis_k/family.mk +++ b/hw/bsp/kinetis_k/family.mk @@ -9,11 +9,13 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_KINETIS_K \ LDFLAGS += \ - -nostartfiles \ - --specs=nosys.specs --specs=nano.specs \ -Wl,--defsym,__stack_size__=0x400 \ -Wl,--defsym,__heap_size__=0 +LDFLAGS_GCC += \ + -nostartfiles \ + --specs=nosys.specs --specs=nano.specs \ + SRC_C += \ src/portable/nxp/khci/dcd_khci.c \ src/portable/nxp/khci/hcd_khci.c \ diff --git a/hw/bsp/kinetis_kl/family.mk b/hw/bsp/kinetis_kl/family.mk index 8d113aecf..aec53d486 100644 --- a/hw/bsp/kinetis_kl/family.mk +++ b/hw/bsp/kinetis_kl/family.mk @@ -9,11 +9,13 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_KINETIS_KL \ LDFLAGS += \ - -nostartfiles \ - -specs=nosys.specs -specs=nano.specs \ -Wl,--defsym,__stack_size__=0x400 \ -Wl,--defsym,__heap_size__=0 +LDFLAGS_GCC += \ + -nostartfiles \ + -specs=nosys.specs -specs=nano.specs \ + SRC_C += \ src/portable/nxp/khci/dcd_khci.c \ src/portable/nxp/khci/hcd_khci.c \ diff --git a/tools/build.py b/tools/build.py index e4909f45f..c4f1558c0 100755 --- a/tools/build.py +++ b/tools/build.py @@ -142,16 +142,12 @@ def make_one_example(example, board, make_option): r = 2 else: start_time = time.monotonic() - # skip -j for circleci - if not os.getenv('CIRCLECI'): - make_option += ' -j' - make_args = ["make", "-C", f"examples/{example}", f"BOARD={board}"] + make_args = ["make", "-C", f"examples/{example}", f"BOARD={board}", '-j', str(parallel_jobs)] if make_option: make_args += shlex.split(make_option) - make_args.append("all") if clean_build: run_cmd(make_args + ["clean"]) - build_result = run_cmd(make_args) + build_result = run_cmd(make_args + ['all']) r = 0 if build_result.returncode == 0 else 1 print_build_result(board, example, r, time.monotonic() - start_time) diff --git a/tools/metrics.py b/tools/metrics.py index bb84f803e..c3b366e42 100644 --- a/tools/metrics.py +++ b/tools/metrics.py @@ -195,17 +195,13 @@ def compare_maps(base_file, new_file, filters=None): def format_diff(base, new, diff): """Format a diff value with percentage.""" - if base == 0 and new == 0: - return "0" - if base == 0: - return f"{new} (new)" - if new == 0: - return f"{base} ➡ 0" if diff == 0: - return f"{base} ➡ {new}" + return f"{new}" + if base == 0 or new == 0: + return f"{base} ➙ {new}" pct = (diff / base) * 100 sign = "+" if diff > 0 else "" - return f"{base} ➡ {new} ({sign}{diff}, {sign}{pct:.1f}%)" + return f"{base} ➙ {new} ({sign}{diff}, {sign}{pct:.1f}%)" def get_sort_key(sort_order): @@ -232,10 +228,11 @@ def write_compare_markdown(comparison, path, sort_order='size'): sections = comparison["sections"] md_lines = [ - "# TinyUSB Code Size Different Report", + "# Size Difference Report", "", - f"**Base:** `{comparison['base_file']}`", - f"**New:** `{comparison['new_file']}`", + "Because TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds." + "", + "Note: If there is no change, only one value is shown.", "", ] -- cgit v1.3.1 From 6b73d786b3ddddcb1fbed51909095a46d68d2449 Mon Sep 17 00:00:00 2001 From: Zhihong Chen Date: Mon, 8 Dec 2025 17:14:12 +0800 Subject: update risc-v march for gcc and clang toolchains - add `zifencei` option Signed-off-by: Zhihong Chen --- examples/build_system/cmake/cpu/rv32imac-ilp32.cmake | 4 ++-- examples/build_system/make/cpu/rv32imac-ilp32.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/build_system/make') diff --git a/examples/build_system/cmake/cpu/rv32imac-ilp32.cmake b/examples/build_system/cmake/cpu/rv32imac-ilp32.cmake index 584d90519..8c2538cee 100644 --- a/examples/build_system/cmake/cpu/rv32imac-ilp32.cmake +++ b/examples/build_system/cmake/cpu/rv32imac-ilp32.cmake @@ -1,13 +1,13 @@ if (TOOLCHAIN STREQUAL "gcc") set(TOOLCHAIN_COMMON_FLAGS - -march=rv32imac_zicsr + -march=rv32imac_zicsr_zifencei -mabi=ilp32 ) set(FREERTOS_PORT GCC_RISC_V CACHE INTERNAL "") elseif (TOOLCHAIN STREQUAL "clang") set(TOOLCHAIN_COMMON_FLAGS - -march=rv32imac_zicsr + -march=rv32imac_zicsr_zifencei -mabi=ilp32 ) set(FREERTOS_PORT GCC_RISC_V CACHE INTERNAL "") diff --git a/examples/build_system/make/cpu/rv32imac-ilp32.mk b/examples/build_system/make/cpu/rv32imac-ilp32.mk index 19c322ebc..a7b2258d7 100644 --- a/examples/build_system/make/cpu/rv32imac-ilp32.mk +++ b/examples/build_system/make/cpu/rv32imac-ilp32.mk @@ -1,11 +1,11 @@ ifeq ($(TOOLCHAIN),gcc) CFLAGS += \ - -march=rv32imac_zicsr \ + -march=rv32imac_zicsr_zifencei \ -mabi=ilp32 \ else ifeq ($(TOOLCHAIN),clang) CFLAGS += \ - -march=rv32imac_zicsr \ + -march=rv32imac_zicsr_zifencei \ -mabi=ilp32 \ else ifeq ($(TOOLCHAIN),iar) -- cgit v1.3.1 From 5a7e5db78770d6fd37992b5812f910c3546f2a72 Mon Sep 17 00:00:00 2001 From: Zixun LI Date: Tue, 16 Dec 2025 11:09:16 +0100 Subject: fix riscv toolchain Signed-off-by: Zixun LI --- examples/build_system/make/toolchain/riscv_gcc.mk | 2 +- hw/bsp/family_support.mk | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'examples/build_system/make') diff --git a/examples/build_system/make/toolchain/riscv_gcc.mk b/examples/build_system/make/toolchain/riscv_gcc.mk index 843aff38c..b5de12a83 100644 --- a/examples/build_system/make/toolchain/riscv_gcc.mk +++ b/examples/build_system/make/toolchain/riscv_gcc.mk @@ -1,7 +1,7 @@ # makefile for arm gcc toolchain # Can be set by family, default to ARM GCC -CROSS_COMPILE ?= riscv-none-embed- +CROSS_COMPILE ?= riscv-none-elf- CC = $(CROSS_COMPILE)gcc CXX = $(CROSS_COMPILE)g++ diff --git a/hw/bsp/family_support.mk b/hw/bsp/family_support.mk index db410a657..7122a7764 100644 --- a/hw/bsp/family_support.mk +++ b/hw/bsp/family_support.mk @@ -131,8 +131,21 @@ ifdef CPU_CORE include ${TOP}/examples/build_system/make/cpu/$(CPU_CORE).mk endif -# toolchain specific -include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN).mk +# toolchain specific - select based on CPU architecture +ifdef CPU_CORE + ifneq (,$(filter cortex% arm%,$(CPU_CORE))) + # ARM/Cortex architecture + include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN).mk + else ifneq (,$(filter rv%,$(CPU_CORE))) + # RISC-V architecture + include ${TOP}/examples/build_system/make/toolchain/riscv_$(TOOLCHAIN).mk + else + $(error Unsupported CPU_CORE architecture: $(CPU_CORE). Must start with cortex, arm, or rv) + endif +else + # Default to ARM if CPU_CORE not specified + include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN).mk +endif #---------------------- FreeRTOS ----------------------- FREERTOS_SRC = lib/FreeRTOS-Kernel -- cgit v1.3.1 From 4c7a9fed96e0a81cc640333c1c82fee54fa4be34 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 19 Mar 2026 22:23:47 +0700 Subject: 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) --- examples/build_system/make/cpu/arm1176jzf-s.mk | 4 -- examples/build_system/make/cpu/arm926ej-s.mk | 4 -- examples/build_system/make/cpu/cortex-a53.mk | 7 ---- examples/build_system/make/cpu/cortex-a72.mk | 7 ---- examples/build_system/make/cpu/cortex-m0.mk | 5 --- examples/build_system/make/cpu/cortex-m0plus.mk | 5 --- examples/build_system/make/cpu/cortex-m23.mk | 5 --- examples/build_system/make/cpu/cortex-m3.mk | 5 --- .../build_system/make/cpu/cortex-m33-nodsp-nofp.mk | 7 ---- examples/build_system/make/cpu/cortex-m33.mk | 9 ----- examples/build_system/make/cpu/cortex-m4-nofpu.mk | 4 -- examples/build_system/make/cpu/cortex-m4.mk | 4 -- examples/build_system/make/cpu/cortex-m55.mk | 9 ----- examples/build_system/make/cpu/cortex-m7-fpsp.mk | 9 ----- examples/build_system/make/cpu/cortex-m7.mk | 9 ----- examples/build_system/make/cpu/cortex-m85.mk | 9 ----- examples/build_system/make/cpu/msp430.mk | 2 - examples/build_system/make/cpu/rv32i-ilp32.mk | 2 - examples/build_system/make/cpu/rv32imac-ilp32.mk | 3 -- examples/build_system/make/toolchain/arm_iar.mk | 13 ------- examples/build_system/make/toolchain/gcc_rules.mk | 11 +----- examples/build_system/make/toolchain/iar_rules.mk | 44 ---------------------- examples/device/net_lwip_webserver/Makefile | 2 +- examples/dual/host_hid_to_device_cdc/Makefile | 2 +- examples/dual/host_info_to_device_cdc/Makefile | 2 +- examples/host/msc_file_explorer/Makefile | 2 +- examples/host/msc_file_explorer/src/msc_app.c | 2 +- hw/bsp/at32f402_405/family.mk | 10 ++--- hw/bsp/at32f403a_407/family.mk | 10 ++--- hw/bsp/at32f413/family.mk | 10 ++--- hw/bsp/at32f415/family.mk | 10 ++--- hw/bsp/at32f423/family.mk | 10 ++--- hw/bsp/at32f425/family.mk | 10 ++--- hw/bsp/at32f435_437/family.mk | 10 ++--- hw/bsp/at32f45x/family.mk | 10 ++--- hw/bsp/broadcom_32bit/family.mk | 2 +- hw/bsp/broadcom_64bit/family.mk | 2 +- hw/bsp/ch32v10x/family.mk | 2 +- hw/bsp/ch32v20x/family.mk | 2 +- hw/bsp/ch32v30x/family.mk | 2 +- hw/bsp/cxd56/family.mk | 2 +- hw/bsp/da1469x/family.mk | 2 +- hw/bsp/efm32/family.mk | 2 +- hw/bsp/family_support.mk | 12 +++--- hw/bsp/fomu/family.mk | 2 +- hw/bsp/hpmicro/family.mk | 2 +- hw/bsp/imxrt/family.mk | 2 +- hw/bsp/kinetis_k/family.mk | 2 +- hw/bsp/kinetis_k32l/boards/frdm_k32l2a4s/board.mk | 2 +- hw/bsp/kinetis_k32l/family.mk | 2 +- hw/bsp/kinetis_kl/family.mk | 2 +- hw/bsp/lpc11/family.mk | 2 +- hw/bsp/lpc13/family.mk | 2 +- hw/bsp/lpc15/family.mk | 4 +- hw/bsp/lpc17/family.mk | 4 +- hw/bsp/lpc18/family.mk | 4 +- hw/bsp/lpc40/family.mk | 4 +- hw/bsp/lpc43/family.mk | 4 +- hw/bsp/lpc51/family.mk | 2 +- hw/bsp/lpc54/family.mk | 2 +- hw/bsp/lpc55/family.mk | 2 +- hw/bsp/maxim/family.mk | 6 +-- hw/bsp/mcx/family.mk | 2 +- hw/bsp/mm32/family.mk | 2 +- hw/bsp/msp432e4/family.mk | 2 +- hw/bsp/nrf/family.mk | 4 +- hw/bsp/nuc100_120/family.mk | 2 +- hw/bsp/nuc121_125/family.mk | 2 +- hw/bsp/nuc126/family.mk | 2 +- hw/bsp/nuc505/family.mk | 2 +- hw/bsp/ra/family.mk | 4 +- hw/bsp/rw61x/family.mk | 2 +- hw/bsp/rx/family.mk | 2 +- hw/bsp/samd11/family.mk | 2 +- hw/bsp/samd2x_l2x/family.mk | 2 +- hw/bsp/samd5x_e5x/family.mk | 2 +- hw/bsp/same7x/family.mk | 2 +- hw/bsp/samg/family.mk | 2 +- hw/bsp/stm32c0/boards/stm32c071nucleo/board.mk | 7 +--- hw/bsp/stm32c0/family.mk | 6 +-- hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk | 2 +- hw/bsp/stm32f0/boards/stm32f072disco/board.mk | 2 +- hw/bsp/stm32f0/boards/stm32f072eval/board.mk | 2 +- hw/bsp/stm32f0/family.mk | 10 ++--- hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk | 3 +- hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk | 3 +- hw/bsp/stm32f1/boards/stm32f103ze_iar/board.mk | 3 +- hw/bsp/stm32f1/family.mk | 9 ++--- hw/bsp/stm32f2/family.mk | 8 ++-- hw/bsp/stm32f3/family.mk | 8 ++-- hw/bsp/stm32f4/boards/feather_stm32f405/board.mk | 7 +--- hw/bsp/stm32f4/boards/pyboardv11/board.mk | 7 +--- hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk | 7 +--- hw/bsp/stm32f4/boards/stm32f407blackvet/board.mk | 7 +--- hw/bsp/stm32f4/boards/stm32f407disco/board.mk | 7 +--- hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk | 7 +--- hw/bsp/stm32f4/boards/stm32f411disco/board.mk | 7 +--- hw/bsp/stm32f4/boards/stm32f412disco/board.mk | 7 +--- hw/bsp/stm32f4/boards/stm32f412nucleo/board.mk | 7 +--- hw/bsp/stm32f4/boards/stm32f439nucleo/board.mk | 7 +--- hw/bsp/stm32f4/family.mk | 6 +-- hw/bsp/stm32f7/boards/stlinkv3mini/board.mk | 2 +- hw/bsp/stm32f7/boards/stm32f723disco/board.mk | 2 +- hw/bsp/stm32f7/boards/stm32f746disco/board.mk | 2 +- hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk | 2 +- hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk | 2 +- hw/bsp/stm32f7/boards/stm32f769disco/board.mk | 2 +- hw/bsp/stm32f7/family.mk | 10 ++--- hw/bsp/stm32g0/boards/stm32g0b1nucleo/board.mk | 7 +--- hw/bsp/stm32g0/family.mk | 6 +-- hw/bsp/stm32g4/boards/b_g474e_dpow1/board.mk | 2 +- hw/bsp/stm32g4/boards/stm32g474nucleo/board.mk | 2 +- hw/bsp/stm32g4/boards/stm32g491nucleo/board.mk | 2 +- hw/bsp/stm32g4/family.mk | 10 ++--- hw/bsp/stm32h5/family.mk | 12 +++--- hw/bsp/stm32h7/boards/daisyseed/board.mk | 2 +- hw/bsp/stm32h7/boards/stm32h723nucleo/board.mk | 2 +- hw/bsp/stm32h7/boards/stm32h743eval/board.mk | 2 +- hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk | 2 +- hw/bsp/stm32h7/boards/stm32h745disco/board.mk | 3 +- hw/bsp/stm32h7/boards/stm32h747disco/board.mk | 3 +- hw/bsp/stm32h7/boards/stm32h750_weact/board.mk | 2 +- hw/bsp/stm32h7/boards/stm32h750bdk/board.mk | 2 +- hw/bsp/stm32h7/boards/waveshare_openh743i/board.mk | 2 +- hw/bsp/stm32h7/family.mk | 8 ++-- hw/bsp/stm32h7rs/family.mk | 12 +++--- hw/bsp/stm32l0/family.mk | 8 ++-- hw/bsp/stm32l4/boards/stm32l412nucleo/board.mk | 7 +--- hw/bsp/stm32l4/boards/stm32l476disco/board.mk | 7 +--- hw/bsp/stm32l4/boards/stm32l496nucleo/board.mk | 7 +--- hw/bsp/stm32l4/boards/stm32l4p5nucleo/board.mk | 7 +--- hw/bsp/stm32l4/boards/stm32l4r5nucleo/board.mk | 7 +--- hw/bsp/stm32l4/family.mk | 6 +-- hw/bsp/stm32n6/boards/stm32n6570dk/board.mk | 2 +- hw/bsp/stm32n6/boards/stm32n657nucleo/board.mk | 2 +- hw/bsp/stm32n6/family.mk | 12 +++--- hw/bsp/stm32u0/family.mk | 8 ++-- hw/bsp/stm32u5/family.mk | 10 ++--- hw/bsp/stm32wb/family.mk | 10 ++--- hw/bsp/stm32wba/family.mk | 10 ++--- hw/bsp/tm4c/boards/ek_tm4c1294xl/board.mk | 3 +- hw/bsp/tm4c/family.mk | 2 +- 142 files changed, 227 insertions(+), 504 deletions(-) delete mode 100644 examples/build_system/make/toolchain/arm_iar.mk delete mode 100644 examples/build_system/make/toolchain/iar_rules.mk (limited to 'examples/build_system/make') 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: diff --git a/hw/bsp/at32f402_405/family.mk b/hw/bsp/at32f402_405/family.mk index 09b2f1139..5f9f3ccbb 100644 --- a/hw/bsp/at32f402_405/family.mk +++ b/hw/bsp/at32f402_405/family.mk @@ -5,7 +5,7 @@ include $(TOP)/$(BOARD_PATH)/board.mk CPU_CORE ?= cortex-m4 -CFLAGS_GCC += \ +CFLAGS += \ -flto RHPORT_SPEED ?= OPT_MODE_FULL_SPEED OPT_MODE_FULL_SPEED @@ -35,7 +35,7 @@ CFLAGS += \ -DBOARD_TUH_RHPORT=${RHPORT_HOST} \ -DBOARD_TUH_MAX_SPEED=${RHPORT_HOST_SPEED} \ -LDFLAGS_GCC += \ +LDFLAGS += \ -flto --specs=nosys.specs -nostdlib -nostartfiles SRC_C += \ @@ -55,11 +55,9 @@ INC += \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/core_support \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/device_support -SRC_S_GCC += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -SRC_S_IAR += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/startup_${AT32_FAMILY}.s +SRC_S += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -LD_FILE_GCC ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld -LD_FILE_IAR ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/linker/${MCU_LINKER_NAME}.icf +LD_FILE ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld # For freeRTOS port source FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM4F diff --git a/hw/bsp/at32f403a_407/family.mk b/hw/bsp/at32f403a_407/family.mk index f458881a3..f7dde7d90 100644 --- a/hw/bsp/at32f403a_407/family.mk +++ b/hw/bsp/at32f403a_407/family.mk @@ -5,13 +5,13 @@ include $(TOP)/$(BOARD_PATH)/board.mk CPU_CORE ?= cortex-m4 -CFLAGS_GCC += \ +CFLAGS += \ -flto CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_AT32F403A_407 -LDFLAGS_GCC += \ +LDFLAGS += \ -flto --specs=nosys.specs -nostdlib -nostartfiles SRC_C += \ @@ -30,11 +30,9 @@ INC += \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/core_support \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/device_support -SRC_S_GCC += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -SRC_S_IAR += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/startup_${AT32_FAMILY}.s +SRC_S += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -LD_FILE_GCC ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld -LD_FILE_IAR ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/linker/${MCU_LINKER_NAME}.icf +LD_FILE ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld # For freeRTOS port source FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM4F diff --git a/hw/bsp/at32f413/family.mk b/hw/bsp/at32f413/family.mk index abcd15d11..86744e1dc 100644 --- a/hw/bsp/at32f413/family.mk +++ b/hw/bsp/at32f413/family.mk @@ -5,13 +5,13 @@ include $(TOP)/$(BOARD_PATH)/board.mk CPU_CORE ?= cortex-m4 -CFLAGS_GCC += \ +CFLAGS += \ -flto CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_AT32F413 -LDFLAGS_GCC += \ +LDFLAGS += \ -flto --specs=nosys.specs -nostdlib -nostartfiles SRC_C += \ @@ -30,11 +30,9 @@ INC += \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/core_support \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/device_support -SRC_S_GCC += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -SRC_S_IAR += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/startup_${AT32_FAMILY}.s +SRC_S += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -LD_FILE_GCC ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld -LD_FILE_IAR ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/linker/${MCU_LINKER_NAME}.icf +LD_FILE ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld # For freeRTOS port source FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM4F diff --git a/hw/bsp/at32f415/family.mk b/hw/bsp/at32f415/family.mk index 73a89c543..72339b782 100644 --- a/hw/bsp/at32f415/family.mk +++ b/hw/bsp/at32f415/family.mk @@ -5,13 +5,13 @@ include $(TOP)/$(BOARD_PATH)/board.mk CPU_CORE ?= cortex-m4-nofpu -CFLAGS_GCC += \ +CFLAGS += \ -flto CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_AT32F415 \ -LDFLAGS_GCC += \ +LDFLAGS += \ -flto --specs=nosys.specs -nostdlib -nostartfiles SRC_C += \ @@ -30,10 +30,8 @@ INC += \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/core_support \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/device_support -SRC_S_GCC += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -SRC_S_IAR += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/startup_${AT32_FAMILY}.s +SRC_S += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -LD_FILE_GCC ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld -LD_FILE_IAR ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/linker/${MCU_LINKER_NAME}.icf +LD_FILE ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld flash: flash-atlink diff --git a/hw/bsp/at32f423/family.mk b/hw/bsp/at32f423/family.mk index 960f4a9a1..df531460a 100644 --- a/hw/bsp/at32f423/family.mk +++ b/hw/bsp/at32f423/family.mk @@ -5,13 +5,13 @@ include $(TOP)/$(BOARD_PATH)/board.mk CPU_CORE ?= cortex-m4 -CFLAGS_GCC += \ +CFLAGS += \ -flto CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_AT32F423 \ -LDFLAGS_GCC += \ +LDFLAGS += \ -flto --specs=nosys.specs -nostdlib -nostartfiles SRC_C += \ @@ -31,10 +31,8 @@ INC += \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/core_support \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/device_support -SRC_S_GCC += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -SRC_S_IAR += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/startup_${AT32_FAMILY}.s +SRC_S += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -LD_FILE_GCC ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld -LD_FILE_IAR ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/linker/${MCU_LINKER_NAME}.icf +LD_FILE ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld flash: flash-atlink diff --git a/hw/bsp/at32f425/family.mk b/hw/bsp/at32f425/family.mk index 0a0a74414..b659608a3 100644 --- a/hw/bsp/at32f425/family.mk +++ b/hw/bsp/at32f425/family.mk @@ -5,13 +5,13 @@ include $(TOP)/$(BOARD_PATH)/board.mk CPU_CORE ?= cortex-m4-nofpu -CFLAGS_GCC += \ +CFLAGS += \ -flto CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_AT32F425 \ -LDFLAGS_GCC += \ +LDFLAGS += \ -flto --specs=nosys.specs -nostdlib -nostartfiles SRC_C += \ @@ -30,10 +30,8 @@ INC += \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/core_support \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/device_support -SRC_S_GCC += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -SRC_S_IAR += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/startup_${AT32_FAMILY}.s +SRC_S += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -LD_FILE_GCC ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld -LD_FILE_IAR ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/linker/${MCU_LINKER_NAME}.icf +LD_FILE ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld flash: flash-atlink diff --git a/hw/bsp/at32f435_437/family.mk b/hw/bsp/at32f435_437/family.mk index ba22f5420..73777400b 100644 --- a/hw/bsp/at32f435_437/family.mk +++ b/hw/bsp/at32f435_437/family.mk @@ -5,7 +5,7 @@ include $(TOP)/$(BOARD_PATH)/board.mk CPU_CORE ?= cortex-m4 -CFLAGS_GCC += \ +CFLAGS += \ -flto CFLAGS += \ @@ -15,7 +15,7 @@ CFLAGS += \ -DBOARD_TUD_MAX_SPEED=OPT_MODE_FULL_SPEED \ -DBOARD_TUH_MAX_SPEED=OPT_MODE_FULL_SPEED \ -LDFLAGS_GCC += \ +LDFLAGS += \ -flto --specs=nosys.specs -nostdlib -nostartfiles SRC_C += \ @@ -36,10 +36,8 @@ INC += \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/core_support \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/device_support -SRC_S_GCC += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -SRC_S_IAR += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/startup_${AT32_FAMILY}.s +SRC_S += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -LD_FILE_GCC ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld -LD_FILE_IAR ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/linker/${MCU_LINKER_NAME}.icf +LD_FILE ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld flash: flash-atlink diff --git a/hw/bsp/at32f45x/family.mk b/hw/bsp/at32f45x/family.mk index e42f27557..a9fb1a078 100644 --- a/hw/bsp/at32f45x/family.mk +++ b/hw/bsp/at32f45x/family.mk @@ -5,13 +5,13 @@ include $(TOP)/$(BOARD_PATH)/board.mk CPU_CORE ?= cortex-m4 -CFLAGS_GCC += \ +CFLAGS += \ -flto CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_AT32F45X \ -LDFLAGS_GCC += \ +LDFLAGS += \ -flto --specs=nosys.specs -nostdlib -nostartfiles SRC_C += \ @@ -31,10 +31,8 @@ INC += \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/core_support \ $(TOP)/$(AT32_SDK_LIB)/cmsis/cm4/device_support -SRC_S_GCC += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -SRC_S_IAR += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/startup_${AT32_FAMILY}.s +SRC_S += ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/startup_${AT32_FAMILY}.s -LD_FILE_GCC ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld -LD_FILE_IAR ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/iar/linker/${MCU_LINKER_NAME}.icf +LD_FILE ?= ${AT32_SDK_LIB}/cmsis/cm4/device_support/startup/gcc/linker/${MCU_LINKER_NAME}_FLASH.ld flash: flash-atlink diff --git a/hw/bsp/broadcom_32bit/family.mk b/hw/bsp/broadcom_32bit/family.mk index 9d4a3b76c..a282e9961 100644 --- a/hw/bsp/broadcom_32bit/family.mk +++ b/hw/bsp/broadcom_32bit/family.mk @@ -15,7 +15,7 @@ CFLAGS += \ CROSS_COMPILE = arm-none-eabi- # mcu driver cause following warnings -CFLAGS_GCC += -Wno-error=cast-qual -Wno-error=redundant-decls +CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls SRC_C += \ src/portable/synopsys/dwc2/dcd_dwc2.c \ diff --git a/hw/bsp/broadcom_64bit/family.mk b/hw/bsp/broadcom_64bit/family.mk index 1ce80e22b..37d381f9f 100644 --- a/hw/bsp/broadcom_64bit/family.mk +++ b/hw/bsp/broadcom_64bit/family.mk @@ -14,7 +14,7 @@ CFLAGS += \ CROSS_COMPILE = aarch64-none-elf- # mcu driver cause following warnings -CFLAGS_GCC += -Wno-error=cast-qual -Wno-error=redundant-decls +CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls SRC_C += \ src/portable/synopsys/dwc2/dcd_dwc2.c \ diff --git a/hw/bsp/ch32v10x/family.mk b/hw/bsp/ch32v10x/family.mk index d96d5012e..fb699b0bb 100644 --- a/hw/bsp/ch32v10x/family.mk +++ b/hw/bsp/ch32v10x/family.mk @@ -26,7 +26,7 @@ CFLAGS += \ # https://github.com/openwch/ch32v20x/pull/12 CFLAGS += -Wno-error=strict-prototypes -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ diff --git a/hw/bsp/ch32v20x/family.mk b/hw/bsp/ch32v20x/family.mk index 7042ecbb7..1d059bcba 100644 --- a/hw/bsp/ch32v20x/family.mk +++ b/hw/bsp/ch32v20x/family.mk @@ -37,7 +37,7 @@ else CFLAGS += -DCFG_TUD_WCH_USBIP_USBFS=1 endif -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ diff --git a/hw/bsp/ch32v30x/family.mk b/hw/bsp/ch32v30x/family.mk index be6813914..5ccdea8ae 100644 --- a/hw/bsp/ch32v30x/family.mk +++ b/hw/bsp/ch32v30x/family.mk @@ -36,7 +36,7 @@ else CFLAGS += -DCFG_TUD_WCH_USBIP_USBFS=1 endif -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ diff --git a/hw/bsp/cxd56/family.mk b/hw/bsp/cxd56/family.mk index adfe9ee82..627dc6ec2 100644 --- a/hw/bsp/cxd56/family.mk +++ b/hw/bsp/cxd56/family.mk @@ -32,7 +32,7 @@ CPU_CORE ?= cortex-m4 # lwip/src/core/raw.c:334:43: error: declaration of 'recv' shadows a global declaration CFLAGS += -Wno-error=shadow -Wno-error=redundant-decls -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk diff --git a/hw/bsp/da1469x/family.mk b/hw/bsp/da1469x/family.mk index f35fe2cb5..878442e8e 100644 --- a/hw/bsp/da1469x/family.mk +++ b/hw/bsp/da1469x/family.mk @@ -14,7 +14,7 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_DA1469X \ -DCFG_TUD_ENDPOINT0_SIZE=8\ -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib \ --specs=nosys.specs --specs=nano.specs diff --git a/hw/bsp/efm32/family.mk b/hw/bsp/efm32/family.mk index f115b6bd4..f8db0cc38 100644 --- a/hw/bsp/efm32/family.mk +++ b/hw/bsp/efm32/family.mk @@ -16,7 +16,7 @@ CPU_CORE ?= cortex-m4 # EFM32_FAMILY should be set by board.mk (e.g. efm32gg12b) SILABS_CMSIS = hw/mcu/silabs/cmsis-dfp-$(EFM32_FAMILY)/Device/SiliconLabs/$(shell echo $(EFM32_FAMILY) | tr a-z A-Z) -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs # All source paths should be relative to the top level. LD_FILE = $(SILABS_CMSIS)/Source/GCC/$(EFM32_FAMILY).ld diff --git a/hw/bsp/family_support.mk b/hw/bsp/family_support.mk index 7122a7764..69aa08922 100644 --- a/hw/bsp/family_support.mk +++ b/hw/bsp/family_support.mk @@ -7,12 +7,10 @@ to_upper = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f #------------------------------------------------------------- # Toolchain -# Can be changed via TOOLCHAIN=gcc|iar or CC=arm-none-eabi-gcc|iccarm|clang +# Can be changed via TOOLCHAIN=gcc|clang or CC=arm-none-eabi-gcc|clang #------------------------------------------------------------- ifneq (,$(findstring clang,$(CC))) TOOLCHAIN = clang -else ifneq (,$(findstring iccarm,$(CC))) - TOOLCHAIN = iar else ifneq (,$(findstring gcc,$(CC))) TOOLCHAIN = gcc endif @@ -149,7 +147,7 @@ endif #---------------------- FreeRTOS ----------------------- FREERTOS_SRC = lib/FreeRTOS-Kernel -FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC) +FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/GCC ifeq ($(RTOS),freertos) SRC_C += \ @@ -168,13 +166,13 @@ ifeq ($(RTOS),freertos) CFLAGS += -DCFG_TUSB_OS=OPT_OS_FREERTOS # Suppress FreeRTOSConfig.h warnings - CFLAGS_GCC += -Wno-error=redundant-decls + CFLAGS += -Wno-error=redundant-decls # Suppress FreeRTOS source warnings - CFLAGS_GCC += -Wno-error=cast-qual + CFLAGS += -Wno-error=cast-qual # FreeRTOS (lto + Os) linker issue - LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext + LDFLAGS += -Wl,--undefined=vTaskSwitchContext endif #---------------- Helper ---------------- diff --git a/hw/bsp/fomu/family.mk b/hw/bsp/fomu/family.mk index c29b1c70f..27404efb5 100644 --- a/hw/bsp/fomu/family.mk +++ b/hw/bsp/fomu/family.mk @@ -7,7 +7,7 @@ CFLAGS += \ -flto \ -DCFG_TUSB_MCU=OPT_MCU_VALENTYUSB_EPTRI -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib \ --specs=nosys.specs --specs=nano.specs \ diff --git a/hw/bsp/hpmicro/family.mk b/hw/bsp/hpmicro/family.mk index f8cde55eb..ea4f0c003 100644 --- a/hw/bsp/hpmicro/family.mk +++ b/hw/bsp/hpmicro/family.mk @@ -27,7 +27,7 @@ endif CFLAGS += -Wno-error=cast-align -Wno-error=double-promotion -Wno-error=discarded-qualifiers \ -Wno-error=undef -Wno-error=unused-parameter -Wno-error=redundant-decls -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ --specs=nosys.specs --specs=nano.specs diff --git a/hw/bsp/imxrt/family.mk b/hw/bsp/imxrt/family.mk index 59735670a..59c3aa158 100644 --- a/hw/bsp/imxrt/family.mk +++ b/hw/bsp/imxrt/family.mk @@ -41,7 +41,7 @@ endif # mcu driver cause following warnings CFLAGS += -Wno-error=unused-parameter -Wno-error=implicit-fallthrough -Wno-error=redundant-decls -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ --specs=nosys.specs --specs=nano.specs diff --git a/hw/bsp/kinetis_k/family.mk b/hw/bsp/kinetis_k/family.mk index 7a51a77d8..b1e1fb3aa 100644 --- a/hw/bsp/kinetis_k/family.mk +++ b/hw/bsp/kinetis_k/family.mk @@ -12,7 +12,7 @@ LDFLAGS += \ -Wl,--defsym,__stack_size__=0x400 \ -Wl,--defsym,__heap_size__=0 -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ diff --git a/hw/bsp/kinetis_k32l/boards/frdm_k32l2a4s/board.mk b/hw/bsp/kinetis_k32l/boards/frdm_k32l2a4s/board.mk index 513b78d66..bc6a4a1ba 100644 --- a/hw/bsp/kinetis_k32l/boards/frdm_k32l2a4s/board.mk +++ b/hw/bsp/kinetis_k32l/boards/frdm_k32l2a4s/board.mk @@ -3,7 +3,7 @@ MCU_VARIANT = K32L2A41A CFLAGS += -DCPU_K32L2A41VLH1A # mcu driver cause following warnings -CFLAGS_GCC += -Wno-error=unused-parameter -Wno-error=redundant-decls -Wno-error=cast-qual +CFLAGS += -Wno-error=unused-parameter -Wno-error=redundant-decls -Wno-error=cast-qual # All source paths should be relative to the top level. LD_FILE = $(MCUX_DEVICES)/K32L/$(MCU_VARIANT)/gcc/K32L2A41xxxxA_flash.ld diff --git a/hw/bsp/kinetis_k32l/family.mk b/hw/bsp/kinetis_k32l/family.mk index 2802337d3..a99fb5dbe 100644 --- a/hw/bsp/kinetis_k32l/family.mk +++ b/hw/bsp/kinetis_k32l/family.mk @@ -8,7 +8,7 @@ MCUX_DEVICES = hw/mcu/nxp/mcux-devices-kinetis CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_KINETIS_K32L -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ -specs=nosys.specs -specs=nano.specs diff --git a/hw/bsp/kinetis_kl/family.mk b/hw/bsp/kinetis_kl/family.mk index aec53d486..201ab99dc 100644 --- a/hw/bsp/kinetis_kl/family.mk +++ b/hw/bsp/kinetis_kl/family.mk @@ -12,7 +12,7 @@ LDFLAGS += \ -Wl,--defsym,__stack_size__=0x400 \ -Wl,--defsym,__heap_size__=0 -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ -specs=nosys.specs -specs=nano.specs \ diff --git a/hw/bsp/lpc11/family.mk b/hw/bsp/lpc11/family.mk index a3ec33768..8ac3ecb6a 100644 --- a/hw/bsp/lpc11/family.mk +++ b/hw/bsp/lpc11/family.mk @@ -13,7 +13,7 @@ CFLAGS += \ CFLAGS += \ -Wno-error=incompatible-pointer-types \ -LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs +LDFLAGS += --specs=nosys.specs --specs=nano.specs SRC_C += \ src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \ diff --git a/hw/bsp/lpc13/family.mk b/hw/bsp/lpc13/family.mk index 7ff2c058a..0fed67ebc 100644 --- a/hw/bsp/lpc13/family.mk +++ b/hw/bsp/lpc13/family.mk @@ -12,7 +12,7 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_LPC13XX \ -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs # startup.c and lpc_types.h cause following errors CFLAGS += -Wno-error=strict-prototypes -Wno-error=redundant-decls diff --git a/hw/bsp/lpc15/family.mk b/hw/bsp/lpc15/family.mk index 3267e973a..a42b2d9e4 100644 --- a/hw/bsp/lpc15/family.mk +++ b/hw/bsp/lpc15/family.mk @@ -10,10 +10,10 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_LPC15XX \ -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs # mcu driver cause following warnings -CFLAGS_GCC += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=cast-qual +CFLAGS += -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 diff --git a/hw/bsp/lpc17/family.mk b/hw/bsp/lpc17/family.mk index f1ed1a7d0..5d4ff54a6 100644 --- a/hw/bsp/lpc17/family.mk +++ b/hw/bsp/lpc17/family.mk @@ -11,12 +11,12 @@ CFLAGS += \ -DRTC_EV_SUPPORT=0 # lpc_types.h cause following errors -CFLAGS_GCC += -Wno-error=strict-prototypes -Wno-error=cast-qual +CFLAGS += -Wno-error=strict-prototypes -Wno-error=cast-qual # caused by freeRTOS port !! CFLAGS += -Wno-error=maybe-uninitialized -LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs +LDFLAGS += --specs=nosys.specs --specs=nano.specs SRC_C += \ src/portable/nxp/lpc17_40/dcd_lpc17_40.c \ diff --git a/hw/bsp/lpc18/family.mk b/hw/bsp/lpc18/family.mk index 3bbafed11..5c46881e2 100644 --- a/hw/bsp/lpc18/family.mk +++ b/hw/bsp/lpc18/family.mk @@ -11,9 +11,9 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_LPC18XX # mcu driver cause following warnings -CFLAGS_GCC += -Wno-error=unused-parameter -Wno-error=cast-qual +CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-qual -LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs +LDFLAGS += --specs=nosys.specs --specs=nano.specs SRC_C += \ src/portable/chipidea/ci_hs/dcd_ci_hs.c \ diff --git a/hw/bsp/lpc40/family.mk b/hw/bsp/lpc40/family.mk index c21923000..af8864335 100644 --- a/hw/bsp/lpc40/family.mk +++ b/hw/bsp/lpc40/family.mk @@ -11,9 +11,9 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_LPC40XX # mcu driver cause following warnings -CFLAGS_GCC += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=cast-qual +CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=cast-qual -LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs +LDFLAGS += --specs=nosys.specs --specs=nano.specs # All source paths should be relative to the top level. SRC_C += \ diff --git a/hw/bsp/lpc43/family.mk b/hw/bsp/lpc43/family.mk index 39be867d1..5813dfdcc 100644 --- a/hw/bsp/lpc43/family.mk +++ b/hw/bsp/lpc43/family.mk @@ -9,14 +9,14 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_LPC43XX # mcu driver cause following warnings -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -nostdlib \ -Wno-error=unused-parameter \ -Wno-error=cast-qual \ -Wno-error=incompatible-pointer-types \ -LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs +LDFLAGS += --specs=nosys.specs --specs=nano.specs SRC_C += \ src/portable/chipidea/ci_hs/dcd_ci_hs.c \ diff --git a/hw/bsp/lpc51/family.mk b/hw/bsp/lpc51/family.mk index 34987d183..e295d0587 100644 --- a/hw/bsp/lpc51/family.mk +++ b/hw/bsp/lpc51/family.mk @@ -12,7 +12,7 @@ CFLAGS += \ # mcu driver cause following warnings CFLAGS += -Wno-error=unused-parameter -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ diff --git a/hw/bsp/lpc54/family.mk b/hw/bsp/lpc54/family.mk index 94168f6b2..324b3b6f1 100644 --- a/hw/bsp/lpc54/family.mk +++ b/hw/bsp/lpc54/family.mk @@ -23,7 +23,7 @@ endif # mcu driver cause following warnings CFLAGS += -Wno-error=unused-parameter -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ --specs=nosys.specs --specs=nano.specs diff --git a/hw/bsp/lpc55/family.mk b/hw/bsp/lpc55/family.mk index 2fc76ed50..a9b6f6af1 100644 --- a/hw/bsp/lpc55/family.mk +++ b/hw/bsp/lpc55/family.mk @@ -41,7 +41,7 @@ endif # mcu driver cause following warnings CFLAGS += -Wno-error=unused-parameter -Wno-error=float-equal -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ -Wl,--defsym=__stack_size__=0x1000 \ diff --git a/hw/bsp/maxim/family.mk b/hw/bsp/maxim/family.mk index 3ddf8cf39..9d66553fc 100644 --- a/hw/bsp/maxim/family.mk +++ b/hw/bsp/maxim/family.mk @@ -60,8 +60,8 @@ CFLAGS += \ -Wno-error=sign-compare \ -Wno-error=enum-conversion \ -LDFLAGS_GCC += -nostartfiles --specs=nosys.specs --specs=nano.specs -LD_FILE_GCC ?= $(FAMILY_PATH)/linker/${MAX_DEVICE}.ld +LDFLAGS += -nostartfiles --specs=nosys.specs --specs=nano.specs +LD_FILE ?= $(FAMILY_PATH)/linker/${MAX_DEVICE}.ld # If the applications needs to be signed (for the MAX32651), sign it first and # then need to use MSDK's OpenOCD to flash it @@ -99,7 +99,7 @@ SRC_C += \ ${MSDK_LIB}/PeriphDrivers/Source/UART/uart_common.c \ ${MSDK_LIB}/PeriphDrivers/Source/UART/uart_${PERIPH_SUFFIX}${PERIPH_ID}.c \ -SRC_S_GCC += ${MSDK_LIB}/CMSIS/Device/Maxim/${MAX_DEVICE_UPPER}/Source/GCC/startup_${MAX_DEVICE}.S +SRC_S += ${MSDK_LIB}/CMSIS/Device/Maxim/${MAX_DEVICE_UPPER}/Source/GCC/startup_${MAX_DEVICE}.S INC += \ $(TOP)/$(BOARD_PATH) \ diff --git a/hw/bsp/mcx/family.mk b/hw/bsp/mcx/family.mk index 3d63eb238..c5dd945b9 100644 --- a/hw/bsp/mcx/family.mk +++ b/hw/bsp/mcx/family.mk @@ -15,7 +15,7 @@ CFLAGS += \ # mcu driver cause following warnings CFLAGS += -Wno-error=unused-parameter -Wno-error=old-style-declaration -Wno-error=redundant-decls -LDFLAGS_GCC += \ +LDFLAGS += \ --specs=nosys.specs --specs=nano.specs \ -Wl,--defsym=__stack_size__=0x1000 \ -Wl,--defsym=__heap_size__=0 \ diff --git a/hw/bsp/mm32/family.mk b/hw/bsp/mm32/family.mk index a790663ab..5e40fd09e 100644 --- a/hw/bsp/mm32/family.mk +++ b/hw/bsp/mm32/family.mk @@ -13,7 +13,7 @@ CFLAGS += \ # suppress warning caused by vendor mcu driver CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized -Wno-error=cast-qual -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ -specs=nosys.specs -specs=nano.specs \ diff --git a/hw/bsp/msp432e4/family.mk b/hw/bsp/msp432e4/family.mk index d837f9351..7a7a17b61 100644 --- a/hw/bsp/msp432e4/family.mk +++ b/hw/bsp/msp432e4/family.mk @@ -11,7 +11,7 @@ CFLAGS += \ # mcu driver cause following warnings CFLAGS += -Wno-error=cast-qual -Wno-error=format= -LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs +LDFLAGS += --specs=nosys.specs --specs=nano.specs LD_FILE = hw/mcu/ti/msp432e4/Source/${MCU_VARIANT}.ld diff --git a/hw/bsp/nrf/family.mk b/hw/bsp/nrf/family.mk index 2cead99db..e7e9e7d0a 100644 --- a/hw/bsp/nrf/family.mk +++ b/hw/bsp/nrf/family.mk @@ -42,7 +42,7 @@ CFLAGS += \ #CFLAGS += -D__START=main # suppress warning caused by vendor mcu driver -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=undef \ -Wno-error=unused-parameter \ @@ -51,7 +51,7 @@ CFLAGS_GCC += \ -Wno-error=cast-qual \ -Wno-error=redundant-decls \ -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ -L$(TOP)/${NRFX_PATH}/mdk diff --git a/hw/bsp/nuc100_120/family.mk b/hw/bsp/nuc100_120/family.mk index f9afb4f72..e915e3e33 100644 --- a/hw/bsp/nuc100_120/family.mk +++ b/hw/bsp/nuc100_120/family.mk @@ -8,7 +8,7 @@ CFLAGS += \ CPU_CORE ?= cortex-m0 -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs # LD_FILE is defined in board.mk diff --git a/hw/bsp/nuc121_125/family.mk b/hw/bsp/nuc121_125/family.mk index f46dac6e4..979e8ac9f 100644 --- a/hw/bsp/nuc121_125/family.mk +++ b/hw/bsp/nuc121_125/family.mk @@ -12,7 +12,7 @@ CPU_CORE ?= cortex-m0 # mcu driver cause following warnings CFLAGS += -Wno-error=redundant-decls -LDFLAGS_GCC += \ +LDFLAGS += \ --specs=nosys.specs --specs=nano.specs # All source paths should be relative to the top level. diff --git a/hw/bsp/nuc126/family.mk b/hw/bsp/nuc126/family.mk index 37df7aaab..f2f02b621 100644 --- a/hw/bsp/nuc126/family.mk +++ b/hw/bsp/nuc126/family.mk @@ -13,7 +13,7 @@ CPU_CORE ?= cortex-m0 # mcu driver cause following warnings CFLAGS += -Wno-error=redundant-decls -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs # All source paths should be relative to the top level. # LD_FILE is defined in board.mk diff --git a/hw/bsp/nuc505/family.mk b/hw/bsp/nuc505/family.mk index e1f25e2db..d776defde 100644 --- a/hw/bsp/nuc505/family.mk +++ b/hw/bsp/nuc505/family.mk @@ -9,7 +9,7 @@ CPU_CORE ?= cortex-m4 # mcu driver cause following warnings CFLAGS += -Wno-error=redundant-decls -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs # LD_FILE is defined in board.mk diff --git a/hw/bsp/ra/family.mk b/hw/bsp/ra/family.mk index 6ac7c262f..64a707ed6 100644 --- a/hw/bsp/ra/family.mk +++ b/hw/bsp/ra/family.mk @@ -39,7 +39,7 @@ CFLAGS += \ -DBOARD_TUH_RHPORT=${RHPORT_HOST} \ -DBOARD_TUH_MAX_SPEED=${RHPORT_HOST_SPEED} -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=undef \ -Wno-error=strict-prototypes \ @@ -49,7 +49,7 @@ CFLAGS_GCC += \ -Wno-error=unused-variable \ -ffreestanding -LDFLAGS_GCC += \ +LDFLAGS += \ -nostartfiles -nostdlib \ -specs=nosys.specs -specs=nano.specs diff --git a/hw/bsp/rw61x/family.mk b/hw/bsp/rw61x/family.mk index 08eafddbc..4893f717f 100644 --- a/hw/bsp/rw61x/family.mk +++ b/hw/bsp/rw61x/family.mk @@ -17,7 +17,7 @@ CFLAGS += \ # mcu driver cause following warnings CFLAGS += -Wno-error=unused-parameter -Wno-error=old-style-declaration -Wno-error=redundant-decls -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs # All source paths should be relative to the top level. LD_FILE ?= $(SDK_DIR)/devices/$(MCU_VARIANT)/gcc/$(MCU_CORE)_flash.ld diff --git a/hw/bsp/rx/family.mk b/hw/bsp/rx/family.mk index 8b23b6c46..a357460e8 100644 --- a/hw/bsp/rx/family.mk +++ b/hw/bsp/rx/family.mk @@ -14,7 +14,7 @@ CFLAGS += \ # suppress warning caused by vendor mcu driver CFLAGS += -Wno-error=redundant-decls -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs SRC_C += \ src/portable/renesas/rusb2/dcd_rusb2.c \ diff --git a/hw/bsp/samd11/family.mk b/hw/bsp/samd11/family.mk index 6f89a2d66..327ec44c2 100644 --- a/hw/bsp/samd11/family.mk +++ b/hw/bsp/samd11/family.mk @@ -17,7 +17,7 @@ CFLAGS += -Wno-error=redundant-decls # SAM driver is flooded with -Wcast-qual which slow down complication significantly CFLAGS_SKIP += -Wcast-qual -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs SRC_C += \ src/portable/microchip/samd/dcd_samd.c \ diff --git a/hw/bsp/samd2x_l2x/family.mk b/hw/bsp/samd2x_l2x/family.mk index dca440ddd..2ff01e8b7 100644 --- a/hw/bsp/samd2x_l2x/family.mk +++ b/hw/bsp/samd2x_l2x/family.mk @@ -39,7 +39,7 @@ CFLAGS += -Wno-error=redundant-decls # SAM driver is flooded with -Wcast-qual which slow down complication significantly CFLAGS_SKIP += -Wcast-qual -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ diff --git a/hw/bsp/samd5x_e5x/family.mk b/hw/bsp/samd5x_e5x/family.mk index f0a4a3f00..c544508dc 100644 --- a/hw/bsp/samd5x_e5x/family.mk +++ b/hw/bsp/samd5x_e5x/family.mk @@ -12,7 +12,7 @@ CFLAGS += \ # SAM driver is flooded with -Wcast-qual which slow down complication significantly CFLAGS_SKIP += -Wcast-qual -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs diff --git a/hw/bsp/same7x/family.mk b/hw/bsp/same7x/family.mk index 19e119625..02e940c5a 100644 --- a/hw/bsp/same7x/family.mk +++ b/hw/bsp/same7x/family.mk @@ -18,7 +18,7 @@ CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=redundant # SAM driver is flooded with -Wcast-qual which slows down compilation significantly CFLAGS_SKIP += -Wcast-qual -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs # All source paths should be relative to the top level. SRC_C += \ diff --git a/hw/bsp/samg/family.mk b/hw/bsp/samg/family.mk index d5d2e6122..037ac4709 100644 --- a/hw/bsp/samg/family.mk +++ b/hw/bsp/samg/family.mk @@ -13,7 +13,7 @@ CFLAGS += -Wno-error=undef -Wno-error=null-dereference -Wno-error=redundant-decl # SAM driver is flooded with -Wcast-qual which slow down complication significantly CFLAGS_SKIP += -Wcast-qual -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs \ diff --git a/hw/bsp/stm32c0/boards/stm32c071nucleo/board.mk b/hw/bsp/stm32c0/boards/stm32c071nucleo/board.mk index fd22fc8d4..f2657e8c5 100644 --- a/hw/bsp/stm32c0/boards/stm32c071nucleo/board.mk +++ b/hw/bsp/stm32c0/boards/stm32c071nucleo/board.mk @@ -2,12 +2,9 @@ CFLAGS += \ -DSTM32C071xx # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32c071xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32C071RBTx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32c071xx.s +LD_FILE = $(BOARD_PATH)/STM32C071RBTx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32c071xx.s -LD_FILE_IAR = $(BOARD_PATH)/stm32c071xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32c071rb diff --git a/hw/bsp/stm32c0/family.mk b/hw/bsp/stm32c0/family.mk index 71209bf2e..44ec2531e 100644 --- a/hw/bsp/stm32c0/family.mk +++ b/hw/bsp/stm32c0/family.mk @@ -13,13 +13,13 @@ CFLAGS += \ -DCFG_EXAMPLE_VIDEO_READONLY \ # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # suppress warning caused by vendor mcu driver -CFLAGS_GCC += -Wno-error=cast-align -Wno-error=unused-parameter +CFLAGS += -Wno-error=cast-align -Wno-error=unused-parameter -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs diff --git a/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk b/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk index 63f6a31c2..ea3cf34b4 100644 --- a/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk +++ b/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk @@ -3,7 +3,7 @@ MCU_VARIANT = stm32f070xb CFLAGS += -DSTM32F070xB -DCFG_EXAMPLE_VIDEO_READONLY # Linker -LD_FILE_GCC = $(BOARD_PATH)/stm32F070rbtx_flash.ld +LD_FILE = $(BOARD_PATH)/stm32F070rbtx_flash.ld # For flash-jlink target JLINK_DEVICE = stm32f070rb diff --git a/hw/bsp/stm32f0/boards/stm32f072disco/board.mk b/hw/bsp/stm32f0/boards/stm32f072disco/board.mk index 57c658629..e23af42e1 100644 --- a/hw/bsp/stm32f0/boards/stm32f072disco/board.mk +++ b/hw/bsp/stm32f0/boards/stm32f072disco/board.mk @@ -3,7 +3,7 @@ MCU_VARIANT = stm32f072xb CFLAGS += -DSTM32F072xB -DCFG_EXAMPLE_VIDEO_READONLY # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F072RBTx_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32F072RBTx_FLASH.ld # For flash-jlink target JLINK_DEVICE = stm32f072rb diff --git a/hw/bsp/stm32f0/boards/stm32f072eval/board.mk b/hw/bsp/stm32f0/boards/stm32f072eval/board.mk index bab889524..fec26c7cc 100644 --- a/hw/bsp/stm32f0/boards/stm32f072eval/board.mk +++ b/hw/bsp/stm32f0/boards/stm32f072eval/board.mk @@ -3,7 +3,7 @@ MCU_VARIANT = stm32f072xb CFLAGS += -DSTM32F072xB -DLSI_VALUE=40000 -DCFG_EXAMPLE_VIDEO_READONLY # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F072VBTx_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32F072VBTx_FLASH.ld # For flash-jlink target JLINK_DEVICE = stm32f072vb diff --git a/hw/bsp/stm32f0/family.mk b/hw/bsp/stm32f0/family.mk index b5efdcb8d..ac0c4fa14 100644 --- a/hw/bsp/stm32f0/family.mk +++ b/hw/bsp/stm32f0/family.mk @@ -14,13 +14,13 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32F0 # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # suppress warning caused by vendor mcu driver -CFLAGS_GCC += -Wno-error=unused-parameter -Wno-error=cast-align +CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -48,8 +48,6 @@ INC += \ $(TOP)/$(ST_HAL_DRIVER)/Inc # 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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s # Linker -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf diff --git a/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk b/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk index 6c5f34501..745a2eb8f 100644 --- a/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk +++ b/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk @@ -3,8 +3,7 @@ MCU_VARIANT = stm32f103xb CFLAGS += -DSTM32F103xB -DHSE_VALUE=8000000U -DCFG_EXAMPLE_VIDEO_READONLY # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F103X8_FLASH.ld -LD_FILE_IAR = $(BOARD_PATH)/stm32f103x8_flash.icf +LD_FILE = $(BOARD_PATH)/STM32F103X8_FLASH.ld # For flash-jlink target JLINK_DEVICE = stm32f103c8 diff --git a/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk b/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk index 7e95c1fe1..2d153dd81 100644 --- a/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk +++ b/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk @@ -3,8 +3,7 @@ MCU_VARIANT = stm32f103xb CFLAGS += -DSTM32F103xB -DHSE_VALUE=8000000U # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F103XC_FLASH.ld -LD_FILE_IAR = $(BOARD_PATH)/stm32f103xc_flash.icf +LD_FILE = $(BOARD_PATH)/STM32F103XC_FLASH.ld # For flash-jlink target JLINK_DEVICE = stm32f103rc diff --git a/hw/bsp/stm32f1/boards/stm32f103ze_iar/board.mk b/hw/bsp/stm32f1/boards/stm32f103ze_iar/board.mk index 5b17d8036..ca4efd357 100644 --- a/hw/bsp/stm32f1/boards/stm32f103ze_iar/board.mk +++ b/hw/bsp/stm32f1/boards/stm32f103ze_iar/board.mk @@ -3,8 +3,7 @@ MCU_VARIANT = stm32f103xe CFLAGS += -DSTM32F103xE -DHSE_VALUE=8000000U # Linker -LD_FILE_GCC = ${ST_CMSIS}/Source/Templates/gcc/linker/STM32F103XE_FLASH.ld -LD_FILE_IAR = ${ST_CMSIS}/Source/Templates/iar/linker/${MCU_VARIANT}_flash.icf +LD_FILE = ${ST_CMSIS}/Source/Templates/gcc/linker/STM32F103XE_FLASH.ld # For flash-jlink target JLINK_DEVICE = stm32f103ze diff --git a/hw/bsp/stm32f1/family.mk b/hw/bsp/stm32f1/family.mk index ca022c7ec..a096fe17a 100644 --- a/hw/bsp/stm32f1/family.mk +++ b/hw/bsp/stm32f1/family.mk @@ -12,13 +12,13 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32F1 # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # mcu driver cause following warnings -CFLAGS_GCC += -Wno-error=cast-align +CFLAGS += -Wno-error=cast-align -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ -specs=nosys.specs -specs=nano.specs @@ -44,8 +44,7 @@ INC += \ ${TOP}/${ST_HAL_DRIVER}/Inc # 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 +SRC_S += ${ST_CMSIS}/Source/Templates/gcc/startup_${MCU_VARIANT}.s # flash target ROM bootloader: flash-dfu-util DFU_UTIL_OPTION = -a 0 --dfuse-address 0x08000000 diff --git a/hw/bsp/stm32f2/family.mk b/hw/bsp/stm32f2/family.mk index ef14a9d67..e5a44ebba 100644 --- a/hw/bsp/stm32f2/family.mk +++ b/hw/bsp/stm32f2/family.mk @@ -9,11 +9,11 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32F2 # mcu driver cause following warnings -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=sign-compare -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -35,8 +35,6 @@ INC += \ $(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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_${MCU_VARIANT}.s # Linker -LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/${MCU_VARIANT}_flash.icf diff --git a/hw/bsp/stm32f3/family.mk b/hw/bsp/stm32f3/family.mk index eb4a4e186..ff7558b73 100644 --- a/hw/bsp/stm32f3/family.mk +++ b/hw/bsp/stm32f3/family.mk @@ -9,11 +9,11 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32F3 # mcu driver cause following warnings -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=unused-parameter -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -34,8 +34,6 @@ INC += \ $(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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_${MCU_VARIANT}.s # Linker -LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/${MCU_VARIANT}_flash.icf diff --git a/hw/bsp/stm32f4/boards/feather_stm32f405/board.mk b/hw/bsp/stm32f4/boards/feather_stm32f405/board.mk index cfd1d8b3b..1b24940fc 100644 --- a/hw/bsp/stm32f4/boards/feather_stm32f405/board.mk +++ b/hw/bsp/stm32f4/boards/feather_stm32f405/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F405xx # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f405xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F405RGTx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f405xx.s +LD_FILE = $(BOARD_PATH)/STM32F405RGTx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f405xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f405xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32f405rg diff --git a/hw/bsp/stm32f4/boards/pyboardv11/board.mk b/hw/bsp/stm32f4/boards/pyboardv11/board.mk index 4c52e004a..8aac5c4d7 100644 --- a/hw/bsp/stm32f4/boards/pyboardv11/board.mk +++ b/hw/bsp/stm32f4/boards/pyboardv11/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F405xx # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f405xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F405RGTx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f405xx.s +LD_FILE = $(BOARD_PATH)/STM32F405RGTx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f405xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f405xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32f405rg diff --git a/hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk b/hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk index 3285bd232..e094cf012 100644 --- a/hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk +++ b/hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F401xC # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f401xc.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F401VCTx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f401xc.s +LD_FILE = $(BOARD_PATH)/STM32F401VCTx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f401xc.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f401xc_flash.icf # For flash-jlink target JLINK_DEVICE = stm32f401cc diff --git a/hw/bsp/stm32f4/boards/stm32f407blackvet/board.mk b/hw/bsp/stm32f4/boards/stm32f407blackvet/board.mk index c46a78f81..db1719238 100644 --- a/hw/bsp/stm32f4/boards/stm32f407blackvet/board.mk +++ b/hw/bsp/stm32f4/boards/stm32f407blackvet/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F407xx # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f407xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F407VETx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f407xx.s +LD_FILE = $(BOARD_PATH)/STM32F407VETx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f407xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f407xx_flash.icf # For flash-jlink target diff --git a/hw/bsp/stm32f4/boards/stm32f407disco/board.mk b/hw/bsp/stm32f4/boards/stm32f407disco/board.mk index 4de656b0c..5faba55eb 100644 --- a/hw/bsp/stm32f4/boards/stm32f407disco/board.mk +++ b/hw/bsp/stm32f4/boards/stm32f407disco/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F407xx # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f407xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F407VGTx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f407xx.s +LD_FILE = $(BOARD_PATH)/STM32F407VGTx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f407xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f407xx_flash.icf # For flash-jlink target diff --git a/hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk b/hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk index c45aba79b..9ff7d0fe3 100644 --- a/hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk +++ b/hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F411xE -DHSE_VALUE=25000000 # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f411xe.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F411CEUx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f411xe.s +LD_FILE = $(BOARD_PATH)/STM32F411CEUx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f411xe.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f411xe_flash.icf # For flash-jlink target JLINK_DEVICE = stm32f411ce diff --git a/hw/bsp/stm32f4/boards/stm32f411disco/board.mk b/hw/bsp/stm32f4/boards/stm32f411disco/board.mk index 09fa50bd3..8e922e078 100644 --- a/hw/bsp/stm32f4/boards/stm32f411disco/board.mk +++ b/hw/bsp/stm32f4/boards/stm32f411disco/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F411xE # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f411xe.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F411VETx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f411xe.s +LD_FILE = $(BOARD_PATH)/STM32F411VETx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f411xe.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f411xe_flash.icf # For flash-jlink target JLINK_DEVICE = stm32f411ve diff --git a/hw/bsp/stm32f4/boards/stm32f412disco/board.mk b/hw/bsp/stm32f4/boards/stm32f412disco/board.mk index f767ac6c4..e89d673e2 100644 --- a/hw/bsp/stm32f4/boards/stm32f412disco/board.mk +++ b/hw/bsp/stm32f4/boards/stm32f412disco/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F412Zx # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f412zx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F412ZGTx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f412zx.s +LD_FILE = $(BOARD_PATH)/STM32F412ZGTx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f412zx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f412zx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32f412zg diff --git a/hw/bsp/stm32f4/boards/stm32f412nucleo/board.mk b/hw/bsp/stm32f4/boards/stm32f412nucleo/board.mk index f767ac6c4..e89d673e2 100644 --- a/hw/bsp/stm32f4/boards/stm32f412nucleo/board.mk +++ b/hw/bsp/stm32f4/boards/stm32f412nucleo/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F412Zx # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f412zx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F412ZGTx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f412zx.s +LD_FILE = $(BOARD_PATH)/STM32F412ZGTx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f412zx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f412zx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32f412zg diff --git a/hw/bsp/stm32f4/boards/stm32f439nucleo/board.mk b/hw/bsp/stm32f4/boards/stm32f439nucleo/board.mk index 2ab32b7f3..97f4aac36 100644 --- a/hw/bsp/stm32f4/boards/stm32f439nucleo/board.mk +++ b/hw/bsp/stm32f4/boards/stm32f439nucleo/board.mk @@ -1,12 +1,9 @@ CFLAGS += -DSTM32F439xx # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f439xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32F439ZITX_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f439xx.s +LD_FILE = $(BOARD_PATH)/STM32F439ZITX_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32f439xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32f439xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32f439zi diff --git a/hw/bsp/stm32f4/family.mk b/hw/bsp/stm32f4/family.mk index f3e74ecea..f0f0731d9 100644 --- a/hw/bsp/stm32f4/family.mk +++ b/hw/bsp/stm32f4/family.mk @@ -43,13 +43,13 @@ CFLAGS += \ -DBOARD_TUH_MAX_SPEED=${RHPORT_HOST_SPEED} \ # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # suppress warning caused by vendor mcu driver -CFLAGS_GCC += -Wno-error=cast-align +CFLAGS += -Wno-error=cast-align -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs diff --git a/hw/bsp/stm32f7/boards/stlinkv3mini/board.mk b/hw/bsp/stm32f7/boards/stlinkv3mini/board.mk index a19e455c7..8082a29d6 100644 --- a/hw/bsp/stm32f7/boards/stlinkv3mini/board.mk +++ b/hw/bsp/stm32f7/boards/stlinkv3mini/board.mk @@ -13,7 +13,7 @@ CFLAGS += \ -DHSE_VALUE=25000000 \ # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F723xE_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32F723xE_FLASH.ld # flash target using on-board stlink flash: flash-stlink diff --git a/hw/bsp/stm32f7/boards/stm32f723disco/board.mk b/hw/bsp/stm32f7/boards/stm32f723disco/board.mk index 9b8e7a969..b75192962 100644 --- a/hw/bsp/stm32f7/boards/stm32f723disco/board.mk +++ b/hw/bsp/stm32f7/boards/stm32f723disco/board.mk @@ -10,7 +10,7 @@ CFLAGS += \ -DHSE_VALUE=25000000 \ # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F723xE_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32F723xE_FLASH.ld # flash target using on-board stlink flash: flash-stlink diff --git a/hw/bsp/stm32f7/boards/stm32f746disco/board.mk b/hw/bsp/stm32f7/boards/stm32f746disco/board.mk index c2b54406e..b652ffca4 100644 --- a/hw/bsp/stm32f7/boards/stm32f746disco/board.mk +++ b/hw/bsp/stm32f7/boards/stm32f746disco/board.mk @@ -12,7 +12,7 @@ CFLAGS += \ -DHSE_VALUE=25000000 # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F746ZGTx_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32F746ZGTx_FLASH.ld # flash target using on-board stlink flash: flash-stlink diff --git a/hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk b/hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk index fe7104eca..21697a300 100644 --- a/hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk +++ b/hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk @@ -11,7 +11,7 @@ CFLAGS += \ -DHSE_VALUE=8000000 # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F746ZGTx_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32F746ZGTx_FLASH.ld # flash target using on-board stlink flash: flash-stlink diff --git a/hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk b/hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk index d61e0a00d..9705297cf 100644 --- a/hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk +++ b/hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk @@ -11,7 +11,7 @@ CFLAGS += \ -DHSE_VALUE=8000000 \ # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F767ZITx_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32F767ZITx_FLASH.ld # For flash-jlink target JLINK_DEVICE = stm32f767zi diff --git a/hw/bsp/stm32f7/boards/stm32f769disco/board.mk b/hw/bsp/stm32f7/boards/stm32f769disco/board.mk index e756c9727..e2566e989 100644 --- a/hw/bsp/stm32f7/boards/stm32f769disco/board.mk +++ b/hw/bsp/stm32f7/boards/stm32f769disco/board.mk @@ -13,7 +13,7 @@ CFLAGS += \ -DHSE_VALUE=25000000 \ # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32F769ZITx_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32F769ZITx_FLASH.ld JLINK_DEVICE = stm32f769ni diff --git a/hw/bsp/stm32f7/family.mk b/hw/bsp/stm32f7/family.mk index d3422e03c..ecda4caf4 100644 --- a/hw/bsp/stm32f7/family.mk +++ b/hw/bsp/stm32f7/family.mk @@ -56,13 +56,13 @@ CFLAGS += \ #endif # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # mcu driver cause following warnings -CFLAGS_GCC += -Wno-error=cast-align +CFLAGS += -Wno-error=cast-align -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -91,8 +91,6 @@ INC += \ $(TOP)/$(ST_HAL_DRIVER)/Inc # 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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s # Linker -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf diff --git a/hw/bsp/stm32g0/boards/stm32g0b1nucleo/board.mk b/hw/bsp/stm32g0/boards/stm32g0b1nucleo/board.mk index 6a6078d5f..9b9128e44 100644 --- a/hw/bsp/stm32g0/boards/stm32g0b1nucleo/board.mk +++ b/hw/bsp/stm32g0/boards/stm32g0b1nucleo/board.mk @@ -2,12 +2,9 @@ CFLAGS += \ -DSTM32G0B1xx # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32g0b1xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32G0B1RETx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32g0b1xx.s +LD_FILE = $(BOARD_PATH)/STM32G0B1RETx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32g0b1xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32g0b1xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32g0b1re diff --git a/hw/bsp/stm32g0/family.mk b/hw/bsp/stm32g0/family.mk index e376f7f06..85ae38e37 100644 --- a/hw/bsp/stm32g0/family.mk +++ b/hw/bsp/stm32g0/family.mk @@ -13,13 +13,13 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32G0 # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # suppress warning caused by vendor mcu driver -CFLAGS_GCC += -Wno-error=cast-align +CFLAGS += -Wno-error=cast-align -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs diff --git a/hw/bsp/stm32g4/boards/b_g474e_dpow1/board.mk b/hw/bsp/stm32g4/boards/b_g474e_dpow1/board.mk index 6266b3ccc..a2b4dddf9 100644 --- a/hw/bsp/stm32g4/boards/b_g474e_dpow1/board.mk +++ b/hw/bsp/stm32g4/boards/b_g474e_dpow1/board.mk @@ -4,7 +4,7 @@ CFLAGS += \ -DSTM32G474xx \ # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32G474RETx_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32G474RETx_FLASH.ld # For flash-jlink target JLINK_DEVICE = stm32g474re diff --git a/hw/bsp/stm32g4/boards/stm32g474nucleo/board.mk b/hw/bsp/stm32g4/boards/stm32g474nucleo/board.mk index dc46af1d1..77178d2bc 100644 --- a/hw/bsp/stm32g4/boards/stm32g474nucleo/board.mk +++ b/hw/bsp/stm32g4/boards/stm32g474nucleo/board.mk @@ -5,7 +5,7 @@ CFLAGS += \ -DHSE_VALUE=24000000 # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32G474RETx_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32G474RETx_FLASH.ld # For flash-jlink target JLINK_DEVICE = stm32g474re diff --git a/hw/bsp/stm32g4/boards/stm32g491nucleo/board.mk b/hw/bsp/stm32g4/boards/stm32g491nucleo/board.mk index c0f876331..0ef3642dd 100644 --- a/hw/bsp/stm32g4/boards/stm32g491nucleo/board.mk +++ b/hw/bsp/stm32g4/boards/stm32g491nucleo/board.mk @@ -5,7 +5,7 @@ CFLAGS += \ -DHSE_VALUE=24000000 # Linker -LD_FILE_GCC = $(BOARD_PATH)/STM32G491RETX_FLASH.ld +LD_FILE = $(BOARD_PATH)/STM32G491RETX_FLASH.ld # For flash-jlink target JLINK_DEVICE = stm32g491re diff --git a/hw/bsp/stm32g4/family.mk b/hw/bsp/stm32g4/family.mk index a153194ce..1882af43b 100644 --- a/hw/bsp/stm32g4/family.mk +++ b/hw/bsp/stm32g4/family.mk @@ -13,13 +13,13 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32G4 # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # suppress warning caused by vendor mcu driver -CFLAGS_GCC += -Wno-error=cast-align +CFLAGS += -Wno-error=cast-align -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -48,11 +48,9 @@ INC += \ $(TOP)/$(ST_HAL_DRIVER)/Inc # 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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/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: flash-stlink diff --git a/hw/bsp/stm32h5/family.mk b/hw/bsp/stm32h5/family.mk index e34bb513e..6f76872bc 100644 --- a/hw/bsp/stm32h5/family.mk +++ b/hw/bsp/stm32h5/family.mk @@ -15,11 +15,11 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32H5 # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # suppress warning caused by vendor mcu driver -CFLAGS_GCC += \ +CFLAGS += \ -Wno-error=cast-align \ -Wno-error=undef \ -Wno-error=unused-parameter \ @@ -27,7 +27,7 @@ CFLAGS_GCC += \ CFLAGS_CLANG += \ -Wno-error=parentheses-equality -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -59,12 +59,10 @@ INC += \ $(TOP)/$(ST_HAL_DRIVER)/Inc # 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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s # Linker -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf -LD_FILE_GCC = $(FAMILY_PATH)/linker/$(MCU_VARIANT_UPPER)_FLASH.ld +LD_FILE = $(FAMILY_PATH)/linker/$(MCU_VARIANT_UPPER)_FLASH.ld # flash target using on-board stlink flash: flash-stlink diff --git a/hw/bsp/stm32h7/boards/daisyseed/board.mk b/hw/bsp/stm32h7/boards/daisyseed/board.mk index bb254cfc2..5898b4b12 100644 --- a/hw/bsp/stm32h7/boards/daisyseed/board.mk +++ b/hw/bsp/stm32h7/boards/daisyseed/board.mk @@ -1,7 +1,7 @@ MCU_VARIANT = stm32h750xx CFLAGS += -DSTM32H750xx -DCORE_CM7 -DHSE_VALUE=16000000 -LD_FILE_GCC = $(BOARD_PATH)/stm32h750ibkx_flash.ld +LD_FILE = $(BOARD_PATH)/stm32h750ibkx_flash.ld # For flash-jlink target JLINK_DEVICE = stm32h750ibk6_m7 diff --git a/hw/bsp/stm32h7/boards/stm32h723nucleo/board.mk b/hw/bsp/stm32h7/boards/stm32h723nucleo/board.mk index c1a98a025..79b521e2a 100644 --- a/hw/bsp/stm32h7/boards/stm32h723nucleo/board.mk +++ b/hw/bsp/stm32h7/boards/stm32h723nucleo/board.mk @@ -1,7 +1,7 @@ MCU_VARIANT = stm32h723xx CFLAGS += -DSTM32H723xx -DHSE_VALUE=8000000 -LD_FILE_GCC = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash.ld +LD_FILE = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash.ld # For flash-jlink target JLINK_DEVICE = stm32h723zg diff --git a/hw/bsp/stm32h7/boards/stm32h743eval/board.mk b/hw/bsp/stm32h7/boards/stm32h743eval/board.mk index 67b403932..8f27f6460 100644 --- a/hw/bsp/stm32h7/boards/stm32h743eval/board.mk +++ b/hw/bsp/stm32h7/boards/stm32h743eval/board.mk @@ -5,7 +5,7 @@ RHPORT_SPEED = OPT_MODE_FULL_SPEED OPT_MODE_HIGH_SPEED RHPORT_DEVICE ?= 1 RHPORT_HOST ?= 0 -LD_FILE_GCC = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash.ld +LD_FILE = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash.ld SRC_C += \ ${ST_MFXSTM32L152}/mfxstm32l152.c \ diff --git a/hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk b/hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk index d904de6d2..269137e61 100644 --- a/hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk +++ b/hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk @@ -1,7 +1,7 @@ MCU_VARIANT = stm32h743xx CFLAGS += -DSTM32H743xx -DHSE_VALUE=8000000 -LD_FILE_GCC = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash.ld +LD_FILE = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash.ld # For flash-jlink target JLINK_DEVICE = stm32h743zi diff --git a/hw/bsp/stm32h7/boards/stm32h745disco/board.mk b/hw/bsp/stm32h7/boards/stm32h745disco/board.mk index 64003f5a9..79387f26a 100644 --- a/hw/bsp/stm32h7/boards/stm32h745disco/board.mk +++ b/hw/bsp/stm32h7/boards/stm32h745disco/board.mk @@ -6,8 +6,7 @@ CFLAGS += -DSTM32H745xx -DCORE_CM7 -DHSE_VALUE=25000000 # Default is FulSpeed port PORT ?= 0 -LD_FILE_GCC = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash_CM7.ld -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32h745xx_flash_CM7.icf +LD_FILE = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash_CM7.ld # For flash-jlink target JLINK_DEVICE = stm32h745xi_m7 diff --git a/hw/bsp/stm32h7/boards/stm32h747disco/board.mk b/hw/bsp/stm32h7/boards/stm32h747disco/board.mk index 4b17246e2..4fb7cfd48 100644 --- a/hw/bsp/stm32h7/boards/stm32h747disco/board.mk +++ b/hw/bsp/stm32h7/boards/stm32h747disco/board.mk @@ -6,8 +6,7 @@ CFLAGS += -DSTM32H747xx -DCORE_CM7 -DHSE_VALUE=25000000 # Default is FulSpeed port PORT ?= 0 -LD_FILE_GCC = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash_CM7.ld -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32h747xx_flash_CM7.icf +LD_FILE = $(FAMILY_PATH)/linker/${MCU_VARIANT}_flash_CM7.ld # For flash-jlink target JLINK_DEVICE = stm32h747xi_m7 diff --git a/hw/bsp/stm32h7/boards/stm32h750_weact/board.mk b/hw/bsp/stm32h7/boards/stm32h750_weact/board.mk index 988fed804..87c81cb63 100644 --- a/hw/bsp/stm32h7/boards/stm32h750_weact/board.mk +++ b/hw/bsp/stm32h7/boards/stm32h750_weact/board.mk @@ -3,7 +3,7 @@ MCU_VARIANT = stm32h750xx CFLAGS += -DSTM32H750xx -DCORE_CM7 -DHSE_VALUE=25000000 -LD_FILE_GCC = $(BOARD_PATH)/stm32h750xx_flash_CM7.ld +LD_FILE = $(BOARD_PATH)/stm32h750xx_flash_CM7.ld # For flash-jlink target JLINK_DEVICE = stm32h750vb diff --git a/hw/bsp/stm32h7/boards/stm32h750bdk/board.mk b/hw/bsp/stm32h7/boards/stm32h750bdk/board.mk index 6eb3eb498..dec138f92 100644 --- a/hw/bsp/stm32h7/boards/stm32h750bdk/board.mk +++ b/hw/bsp/stm32h7/boards/stm32h750bdk/board.mk @@ -3,7 +3,7 @@ MCU_VARIANT = stm32h750xx CFLAGS += -DSTM32H750xx -DCORE_CM7 -DHSE_VALUE=25000000 -LD_FILE_GCC = $(BOARD_PATH)/stm32h750xx_flash_CM7.ld +LD_FILE = $(BOARD_PATH)/stm32h750xx_flash_CM7.ld # For flash-jlink target JLINK_DEVICE = stm32h750xb diff --git a/hw/bsp/stm32h7/boards/waveshare_openh743i/board.mk b/hw/bsp/stm32h7/boards/waveshare_openh743i/board.mk index 5ff2f4165..65c1fff09 100644 --- a/hw/bsp/stm32h7/boards/waveshare_openh743i/board.mk +++ b/hw/bsp/stm32h7/boards/waveshare_openh743i/board.mk @@ -5,7 +5,7 @@ RHPORT_SPEED = OPT_MODE_FULL_SPEED OPT_MODE_HIGH_SPEED RHPORT_DEVICE ?= 1 RHPORT_HOST ?= 0 -LD_FILE_GCC = $(FAMILY_PATH)/linker/stm32h743xx_flash.ld +LD_FILE = $(FAMILY_PATH)/linker/stm32h743xx_flash.ld # Use Timer module for ULPI PHY reset CFLAGS += -DHAL_TIM_MODULE_ENABLED diff --git a/hw/bsp/stm32h7/family.mk b/hw/bsp/stm32h7/family.mk index 19a085424..3978b2eb0 100644 --- a/hw/bsp/stm32h7/family.mk +++ b/hw/bsp/stm32h7/family.mk @@ -46,12 +46,12 @@ CFLAGS += \ # GCC Flags # suppress warning caused by vendor mcu driver -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=cast-align \ -Wno-error=unused-parameter \ -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -84,8 +84,6 @@ INC += \ $(TOP)/$(ST_HAL_DRIVER)/Inc # 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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s # Linker -LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf diff --git a/hw/bsp/stm32h7rs/family.mk b/hw/bsp/stm32h7rs/family.mk index 7082cc900..d1336a773 100644 --- a/hw/bsp/stm32h7rs/family.mk +++ b/hw/bsp/stm32h7rs/family.mk @@ -47,15 +47,15 @@ CFLAGS += \ -DBUFFER_SIZE_UP=0x300 \ # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # suppress warning caused by vendor mcu driver -CFLAGS_GCC += \ +CFLAGS += \ -Wno-error=cast-align \ -Wno-error=unused-parameter \ -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -87,9 +87,7 @@ INC += \ $(TOP)/$(ST_HAL_DRIVER)/Inc # 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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s # Linker -LD_FILE_GCC ?= $(FAMILY_PATH)/linker/$(MCU_VARIANT)_flash.ld -LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf +LD_FILE ?= $(FAMILY_PATH)/linker/$(MCU_VARIANT)_flash.ld diff --git a/hw/bsp/stm32l0/family.mk b/hw/bsp/stm32l0/family.mk index 0ae881fdf..b72e077f3 100644 --- a/hw/bsp/stm32l0/family.mk +++ b/hw/bsp/stm32l0/family.mk @@ -11,7 +11,7 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32L0 # mcu driver cause following warnings -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=unused-parameter \ -Wno-error=redundant-decls \ @@ -21,7 +21,7 @@ CFLAGS_GCC += \ CFLAGS_CLANG += \ -Wno-error=parentheses-equality -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -43,8 +43,6 @@ INC += \ $(TOP)/$(ST_HAL_DRIVER)/Inc # 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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_${MCU_VARIANT}.s # Linker -LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf diff --git a/hw/bsp/stm32l4/boards/stm32l412nucleo/board.mk b/hw/bsp/stm32l4/boards/stm32l412nucleo/board.mk index 87b333500..c9b2ab9fa 100644 --- a/hw/bsp/stm32l4/boards/stm32l412nucleo/board.mk +++ b/hw/bsp/stm32l4/boards/stm32l412nucleo/board.mk @@ -2,12 +2,9 @@ CFLAGS += \ -DSTM32L412xx \ # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l412xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32L412KBUx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l412xx.s +LD_FILE = $(BOARD_PATH)/STM32L412KBUx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32l412xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32l412xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32l412kb diff --git a/hw/bsp/stm32l4/boards/stm32l476disco/board.mk b/hw/bsp/stm32l4/boards/stm32l476disco/board.mk index 3ba9ab444..23f0966ee 100644 --- a/hw/bsp/stm32l4/boards/stm32l476disco/board.mk +++ b/hw/bsp/stm32l4/boards/stm32l476disco/board.mk @@ -2,12 +2,9 @@ CFLAGS += \ -DSTM32L476xx \ # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l476xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32L476VGTx_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l476xx.s +LD_FILE = $(BOARD_PATH)/STM32L476VGTx_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32l476xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32l476xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32l476vg diff --git a/hw/bsp/stm32l4/boards/stm32l496nucleo/board.mk b/hw/bsp/stm32l4/boards/stm32l496nucleo/board.mk index bc0a63c1c..21666b026 100644 --- a/hw/bsp/stm32l4/boards/stm32l496nucleo/board.mk +++ b/hw/bsp/stm32l4/boards/stm32l496nucleo/board.mk @@ -2,12 +2,9 @@ CFLAGS += \ -DSTM32L496xx \ # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l496xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32L496ZGTX_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l496xx.s +LD_FILE = $(BOARD_PATH)/STM32L496ZGTX_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32l496xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32l496xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32l496zg diff --git a/hw/bsp/stm32l4/boards/stm32l4p5nucleo/board.mk b/hw/bsp/stm32l4/boards/stm32l4p5nucleo/board.mk index 84f831878..09357ff4f 100644 --- a/hw/bsp/stm32l4/boards/stm32l4p5nucleo/board.mk +++ b/hw/bsp/stm32l4/boards/stm32l4p5nucleo/board.mk @@ -2,12 +2,9 @@ CFLAGS += \ -DSTM32L4P5xx \ # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l4p5xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32L4P5ZGTX_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l4p5xx.s +LD_FILE = $(BOARD_PATH)/STM32L4P5ZGTX_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32l4p5xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32l4p5xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32l4p5zg diff --git a/hw/bsp/stm32l4/boards/stm32l4r5nucleo/board.mk b/hw/bsp/stm32l4/boards/stm32l4r5nucleo/board.mk index ad5bfba38..e811a6e53 100644 --- a/hw/bsp/stm32l4/boards/stm32l4r5nucleo/board.mk +++ b/hw/bsp/stm32l4/boards/stm32l4r5nucleo/board.mk @@ -3,12 +3,9 @@ CFLAGS += \ -DSTM32L4R5xx \ # GCC -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l4r5xx.s -LD_FILE_GCC = $(BOARD_PATH)/STM32L4RXxI_FLASH.ld +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l4r5xx.s +LD_FILE = $(BOARD_PATH)/STM32L4RXxI_FLASH.ld -# IAR -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_stm32l4r5xx.s -LD_FILE_IAR = $(ST_CMSIS)/Source/Templates/iar/linker/stm32l4r5xx_flash.icf # For flash-jlink target JLINK_DEVICE = stm32l4r5zi diff --git a/hw/bsp/stm32l4/family.mk b/hw/bsp/stm32l4/family.mk index fd11fd226..b45884989 100644 --- a/hw/bsp/stm32l4/family.mk +++ b/hw/bsp/stm32l4/family.mk @@ -13,15 +13,15 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32L4 # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=cast-align \ ifeq ($(TOOLCHAIN),gcc) -CFLAGS_GCC += -Wno-error=maybe-uninitialized +CFLAGS += -Wno-error=maybe-uninitialized endif -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs diff --git a/hw/bsp/stm32n6/boards/stm32n6570dk/board.mk b/hw/bsp/stm32n6/boards/stm32n6570dk/board.mk index 05717699c..524ba0ca0 100644 --- a/hw/bsp/stm32n6/boards/stm32n6570dk/board.mk +++ b/hw/bsp/stm32n6/boards/stm32n6570dk/board.mk @@ -2,7 +2,7 @@ MCU_VARIANT = stm32n657xx CFLAGS += -DSTM32N657xx JLINK_DEVICE = stm32n6xx -LD_FILE_GCC = $(BOARD_PATH)/STM32N657XX_AXISRAM2_fsbl.ld +LD_FILE = $(BOARD_PATH)/STM32N657XX_AXISRAM2_fsbl.ld # flash target using on-board stlink flash: flash-stlink diff --git a/hw/bsp/stm32n6/boards/stm32n657nucleo/board.mk b/hw/bsp/stm32n6/boards/stm32n657nucleo/board.mk index efbb82611..d488f555e 100644 --- a/hw/bsp/stm32n6/boards/stm32n657nucleo/board.mk +++ b/hw/bsp/stm32n6/boards/stm32n657nucleo/board.mk @@ -2,7 +2,7 @@ MCU_VARIANT = stm32n657xx CFLAGS += -DSTM32N657xx JLINK_DEVICE = stm32n657x0 -LD_FILE_GCC = $(BOARD_PATH)/STM32N657XX_AXISRAM2_fsbl.ld +LD_FILE = $(BOARD_PATH)/STM32N657XX_AXISRAM2_fsbl.ld RHPORT_DEVICE ?= 0 RHPORT_HOST ?= 0 diff --git a/hw/bsp/stm32n6/family.mk b/hw/bsp/stm32n6/family.mk index 9fef533b1..408867153 100644 --- a/hw/bsp/stm32n6/family.mk +++ b/hw/bsp/stm32n6/family.mk @@ -36,15 +36,15 @@ CFLAGS += \ -DBUFFER_SIZE_UP=0x4000 \ # GCC Flags -CFLAGS_GCC += \ +CFLAGS += \ -flto \ # suppress warning caused by vendor mcu driver -CFLAGS_GCC += \ +CFLAGS += \ -Wno-error=cast-align \ -Wno-error=unused-parameter \ -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -81,9 +81,7 @@ INC += \ $(TOP)/$(ST_HAL_DRIVER)/Inc # Startup -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT)_fsbl.s -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_$(MCU_VARIANT).s +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT)_fsbl.s # Linker -LD_FILE_GCC ?= $(ST_CMSIS)/Source/Templates/gcc/linker/$(MCU_VARIANT)_flash.ld -LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf +LD_FILE ?= $(ST_CMSIS)/Source/Templates/gcc/linker/$(MCU_VARIANT)_flash.ld diff --git a/hw/bsp/stm32u0/family.mk b/hw/bsp/stm32u0/family.mk index 9119f3652..4ced248bc 100644 --- a/hw/bsp/stm32u0/family.mk +++ b/hw/bsp/stm32u0/family.mk @@ -11,7 +11,7 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32U0 # mcu driver cause following warnings -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=unused-parameter \ -Wno-error=redundant-decls \ @@ -21,7 +21,7 @@ CFLAGS_GCC += \ CFLAGS_CLANG += \ -Wno-error=parentheses-equality -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -45,10 +45,8 @@ INC += \ $(TOP)/$(ST_HAL_DRIVER)/Inc # 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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_${MCU_VARIANT}.s # Linker MCU_VARIANT_UPPER = $(subst stm32u,STM32U,$(MCU_VARIANT)) LD_FILE ?= $(FAMILY_PATH)/linker/$(MCU_VARIANT_UPPER)_FLASH.ld -LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash.icf diff --git a/hw/bsp/stm32u5/family.mk b/hw/bsp/stm32u5/family.mk index 90796836b..e7bc4f299 100644 --- a/hw/bsp/stm32u5/family.mk +++ b/hw/bsp/stm32u5/family.mk @@ -10,7 +10,7 @@ CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32U5 # suppress warning caused by vendor mcu driver -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=cast-align \ -Wno-error=undef \ @@ -19,10 +19,10 @@ CFLAGS_GCC += \ -Wno-self-assign \ ifeq ($(TOOLCHAIN),gcc) -CFLAGS_GCC += -Wno-error=maybe-uninitialized +CFLAGS += -Wno-error=maybe-uninitialized endif -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ --specs=nosys.specs --specs=nano.specs @@ -61,11 +61,9 @@ INC += \ $(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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/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: flash-stlink diff --git a/hw/bsp/stm32wb/family.mk b/hw/bsp/stm32wb/family.mk index 9397be62d..6123a65de 100644 --- a/hw/bsp/stm32wb/family.mk +++ b/hw/bsp/stm32wb/family.mk @@ -11,12 +11,12 @@ CPU_CORE ?= cortex-m4 CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32WB -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -nostdlib -nostartfiles \ -Wno-error=cast-align -Wno-unused-parameter -LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs +LDFLAGS += -specs=nosys.specs -specs=nano.specs SRC_C += \ src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \ @@ -39,12 +39,10 @@ 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 +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/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 +LD_FILE ?= ${ST_CMSIS}/Source/Templates/gcc/linker/${MCU_VARIANT}_flash_cm4.ld # flash target using on-board stlink flash: flash-stlink diff --git a/hw/bsp/stm32wba/family.mk b/hw/bsp/stm32wba/family.mk index 0a325323b..30848ac89 100644 --- a/hw/bsp/stm32wba/family.mk +++ b/hw/bsp/stm32wba/family.mk @@ -11,11 +11,11 @@ CPU_CORE ?= cortex-m33 CFLAGS += \ -DCFG_TUSB_MCU=OPT_MCU_STM32WBA -CFLAGS_GCC += \ +CFLAGS += \ -flto \ -Wno-error=cast-align -Wno-unused-parameter -LDFLAGS_GCC += \ +LDFLAGS += \ -nostdlib -nostartfiles \ -specs=nosys.specs -specs=nano.specs -Wl,--gc-sections @@ -49,12 +49,10 @@ INC += \ UPPERCASE_MCU_VARIANT = $(subst XX,xx,$(call to_upper,$(MCU_VARIANT))) # Startup - Manually specify lowercase version for startup file -SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s -SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_$(MCU_VARIANT).s +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s # Linker -LD_FILE_GCC ?= ${FAMILY_PATH}/linker/${UPPERCASE_MCU_VARIANT}_FLASH_ns.ld -LD_FILE_IAR ?= $(ST_CMSIS)/Source/Templates/iar/linker/$(MCU_VARIANT)_flash_ns.icf +LD_FILE ?= ${FAMILY_PATH}/linker/${UPPERCASE_MCU_VARIANT}_FLASH_ns.ld # flash target using on-board stlink flash: flash-stlink diff --git a/hw/bsp/tm4c/boards/ek_tm4c1294xl/board.mk b/hw/bsp/tm4c/boards/ek_tm4c1294xl/board.mk index b01977674..26aa55c05 100644 --- a/hw/bsp/tm4c/boards/ek_tm4c1294xl/board.mk +++ b/hw/bsp/tm4c/boards/ek_tm4c1294xl/board.mk @@ -2,8 +2,7 @@ MCU_SUB_VARIANT = 129 CFLAGS += -DTM4C1294NCPDT -LD_FILE_GCC = $(BOARD_PATH)/tm4c1294nc.ld -LD_FILE_IAR = $(BOARD_PATH)/TM4C1294NC.icf +LD_FILE = $(BOARD_PATH)/tm4c1294nc.ld # For flash-jlink target JLINK_DEVICE = TM4C1294NCPDT diff --git a/hw/bsp/tm4c/family.mk b/hw/bsp/tm4c/family.mk index bc966d98e..fc192c3af 100644 --- a/hw/bsp/tm4c/family.mk +++ b/hw/bsp/tm4c/family.mk @@ -14,7 +14,7 @@ CFLAGS += \ # mcu driver cause following warnings CFLAGS += -Wno-error=strict-prototypes -Wno-error=cast-qual -LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs +LDFLAGS += --specs=nosys.specs --specs=nano.specs INC += \ $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \ -- cgit v1.3.1