summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-11-20 16:06:40 +0700
committerhathach <[email protected]>2019-11-20 16:06:40 +0700
commitf638594536643a69200ddca60fe5138447655fbb (patch)
treecb395067ca5ddf37cbd8e25c133ebb3efdc6e11c
parent1aa3f085cb0dd2c147e0376f69e4b92f208a14c6 (diff)
move -flto to board.mk
current board that doesn work with flto is spresense and mimxrt10xx (due to xip image_vector_table is optimized out).
-rw-r--r--examples/make.mk7
-rw-r--r--hw/bsp/circuitplayground_bluefruit/board.mk33
-rw-r--r--hw/bsp/circuitplayground_express/board.mk30
-rw-r--r--hw/bsp/ea4088qs/board.mk1
-rw-r--r--hw/bsp/ea4357/board.mk1
-rw-r--r--hw/bsp/feather_m0_express/board.mk5
-rw-r--r--hw/bsp/feather_m4_express/board.mk3
-rw-r--r--hw/bsp/feather_nrf52840_express/board.mk33
-rw-r--r--hw/bsp/feather_stm32f405/board.mk5
-rw-r--r--hw/bsp/fomu/board.mk1
-rw-r--r--hw/bsp/lpcxpresso11u37/board.mk1
-rw-r--r--hw/bsp/lpcxpresso11u68/board.mk1
-rw-r--r--hw/bsp/lpcxpresso1347/board.mk1
-rw-r--r--hw/bsp/lpcxpresso1549/board.mk1
-rw-r--r--hw/bsp/lpcxpresso1769/board.mk1
-rw-r--r--hw/bsp/lpcxpresso51u68/board.mk1
-rw-r--r--hw/bsp/lpcxpresso54114/board.mk1
-rw-r--r--hw/bsp/lpcxpresso55s69/board.mk1
-rw-r--r--hw/bsp/mbed1768/board.mk1
-rw-r--r--hw/bsp/mcb1800/board.mk1
-rw-r--r--hw/bsp/metro_m0_express/board.mk5
-rw-r--r--hw/bsp/metro_m4_express/board.mk3
-rw-r--r--hw/bsp/mimxrt1064_evk/mimxrt1064_evk.c2
-rw-r--r--hw/bsp/ngx4330/board.mk1
-rw-r--r--hw/bsp/nrf52840_mdk_dongle/board.mk1
-rw-r--r--hw/bsp/pca10056/board.mk1
-rw-r--r--hw/bsp/pca10059/board.mk1
-rw-r--r--hw/bsp/pca10100/board.mk1
-rw-r--r--hw/bsp/pyboardv11/board.mk5
-rw-r--r--hw/bsp/spresense/board.mk18
-rw-r--r--hw/bsp/stm32f070rbnucleo/board.mk43
-rw-r--r--hw/bsp/stm32f072disco/board.mk43
-rw-r--r--hw/bsp/stm32f103bluepill/board.mk39
-rw-r--r--hw/bsp/stm32f207nucleo/board.mk39
-rw-r--r--hw/bsp/stm32f303disco/board.mk41
-rw-r--r--hw/bsp/stm32f407disco/board.mk5
-rw-r--r--hw/bsp/stm32f411disco/board.mk5
-rw-r--r--hw/bsp/stm32f412disco/board.mk5
-rw-r--r--hw/bsp/stm32f767nucleo/board.mk5
-rw-r--r--hw/bsp/stm32h743nucleo/board.mk5
-rw-r--r--hw/bsp/stm32l0538disco/board.mk41
-rw-r--r--hw/bsp/stm32l476disco/board.mk5
42 files changed, 238 insertions, 205 deletions
diff --git a/examples/make.mk b/examples/make.mk
index edf5c1f52..12ce3fd0c 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -85,12 +85,7 @@ CFLAGS += \
ifeq ($(DEBUG), 1)
CFLAGS += -Og -ggdb
else
- ifneq ($(BOARD),spresense)
- #CFLAGS += -flto -Os
- CFLAGS += -Os
- else
- CFLAGS += -Os
- endif
+ CFLAGS += -Os
endif
# TUSB Logging option
diff --git a/hw/bsp/circuitplayground_bluefruit/board.mk b/hw/bsp/circuitplayground_bluefruit/board.mk
index 72b9ddfbe..bfeaa2355 100644
--- a/hw/bsp/circuitplayground_bluefruit/board.mk
+++ b/hw/bsp/circuitplayground_bluefruit/board.mk
@@ -1,11 +1,12 @@
CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -DCFG_TUSB_MCU=OPT_MCU_NRF5X \
- -DNRF52840_XXAA \
+ -flto \
+ -mthumb \
+ -mabi=aapcs \
+ -mcpu=cortex-m4 \
+ -mfloat-abi=hard \
+ -mfpu=fpv4-sp-d16 \
+ -DCFG_TUSB_MCU=OPT_MCU_NRF5X \
+ -DNRF52840_XXAA \
-DCONFIG_GPIO_AS_PINRESET
# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
@@ -23,17 +24,17 @@ LD_FILE = hw/bsp/circuitplayground_bluefruit/nrf52840_s140_v6.ld
LDFLAGS += -L$(TOP)/hw/mcu/nordic/nrfx/mdk
SRC_C += \
- hw/mcu/nordic/nrfx/drivers/src/nrfx_power.c \
- hw/mcu/nordic/nrfx/mdk/system_nrf52840.c \
+ hw/mcu/nordic/nrfx/drivers/src/nrfx_power.c \
+ hw/mcu/nordic/nrfx/mdk/system_nrf52840.c \
INC += \
- $(TOP)/hw/mcu/nordic/cmsis/Include \
- $(TOP)/hw/mcu/nordic \
- $(TOP)/hw/mcu/nordic/nrfx \
- $(TOP)/hw/mcu/nordic/nrfx/mdk \
- $(TOP)/hw/mcu/nordic/nrfx/hal \
- $(TOP)/hw/mcu/nordic/nrfx/drivers/include \
- $(TOP)/hw/mcu/nordic/nrfx/drivers/src \
+ $(TOP)/hw/mcu/nordic/cmsis/Include \
+ $(TOP)/hw/mcu/nordic \
+ $(TOP)/hw/mcu/nordic/nrfx \
+ $(TOP)/hw/mcu/nordic/nrfx/mdk \
+ $(TOP)/hw/mcu/nordic/nrfx/hal \
+ $(TOP)/hw/mcu/nordic/nrfx/drivers/include \
+ $(TOP)/hw/mcu/nordic/nrfx/drivers/src \
SRC_S += hw/mcu/nordic/nrfx/mdk/gcc_startup_nrf52840.S
diff --git a/hw/bsp/circuitplayground_express/board.mk b/hw/bsp/circuitplayground_express/board.mk
index 158f543b3..115a81187 100644
--- a/hw/bsp/circuitplayground_express/board.mk
+++ b/hw/bsp/circuitplayground_express/board.mk
@@ -11,23 +11,23 @@ CFLAGS += \
LD_FILE = hw/bsp/circuitplayground_express/samd21g18a_flash.ld
SRC_C += \
- hw/mcu/microchip/samd/asf4/samd21/gcc/gcc/startup_samd21.c \
- hw/mcu/microchip/samd/asf4/samd21/gcc/system_samd21.c \
- hw/mcu/microchip/samd/asf4/samd21/hpl/gclk/hpl_gclk.c \
- hw/mcu/microchip/samd/asf4/samd21/hpl/pm/hpl_pm.c \
- hw/mcu/microchip/samd/asf4/samd21/hpl/sysctrl/hpl_sysctrl.c \
- hw/mcu/microchip/samd/asf4/samd21/hal/src/hal_atomic.c
+ hw/mcu/microchip/samd/asf4/samd21/gcc/gcc/startup_samd21.c \
+ hw/mcu/microchip/samd/asf4/samd21/gcc/system_samd21.c \
+ hw/mcu/microchip/samd/asf4/samd21/hpl/gclk/hpl_gclk.c \
+ hw/mcu/microchip/samd/asf4/samd21/hpl/pm/hpl_pm.c \
+ hw/mcu/microchip/samd/asf4/samd21/hpl/sysctrl/hpl_sysctrl.c \
+ hw/mcu/microchip/samd/asf4/samd21/hal/src/hal_atomic.c
INC += \
- $(TOP)/hw/mcu/microchip/samd/asf4/samd21/ \
- $(TOP)/hw/mcu/microchip/samd/asf4/samd21/config \
- $(TOP)/hw/mcu/microchip/samd/asf4/samd21/include \
- $(TOP)/hw/mcu/microchip/samd/asf4/samd21/hal/include \
- $(TOP)/hw/mcu/microchip/samd/asf4/samd21/hal/utils/include \
- $(TOP)/hw/mcu/microchip/samd/asf4/samd51/hpl/pm/ \
- $(TOP)/hw/mcu/microchip/samd/asf4/samd21/hpl/port \
- $(TOP)/hw/mcu/microchip/samd/asf4/samd21/hri \
- $(TOP)/hw/mcu/microchip/samd/asf4/samd21/CMSIS/Include
+ $(TOP)/hw/mcu/microchip/samd/asf4/samd21/ \
+ $(TOP)/hw/mcu/microchip/samd/asf4/samd21/config \
+ $(TOP)/hw/mcu/microchip/samd/asf4/samd21/include \
+ $(TOP)/hw/mcu/microchip/samd/asf4/samd21/hal/include \
+ $(TOP)/hw/mcu/microchip/samd/asf4/samd21/hal/utils/include \
+ $(TOP)/hw/mcu/microchip/samd/asf4/samd51/hpl/pm/ \
+ $(TOP)/hw/mcu/microchip/samd/asf4/samd21/hpl/port \
+ $(TOP)/hw/mcu/microchip/samd/asf4/samd21/hri \
+ $(TOP)/hw/mcu/microchip/samd/asf4/samd21/CMSIS/Include
# For TinyUSB port source
VENDOR = microchip
diff --git a/hw/bsp/ea4088qs/board.mk b/hw/bsp/ea4088qs/board.mk
index f621affbf..7869ea8d0 100644
--- a/hw/bsp/ea4088qs/board.mk
+++ b/hw/bsp/ea4088qs/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
diff --git a/hw/bsp/ea4357/board.mk b/hw/bsp/ea4357/board.mk
index be6a307e1..8e7367fa4 100644
--- a/hw/bsp/ea4357/board.mk
+++ b/hw/bsp/ea4357/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
diff --git a/hw/bsp/feather_m0_express/board.mk b/hw/bsp/feather_m0_express/board.mk
index b7ba0b0e1..fe1913331 100644
--- a/hw/bsp/feather_m0_express/board.mk
+++ b/hw/bsp/feather_m0_express/board.mk
@@ -1,10 +1,11 @@
CFLAGS += \
- -DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
- -D__SAMD21G18A__ \
+ -flto \
-mthumb \
-mabi=aapcs-linux \
-mcpu=cortex-m0plus \
-nostdlib -nostartfiles \
+ -D__SAMD21G18A__ \
+ -DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
-DCFG_TUSB_MCU=OPT_MCU_SAMD21
# All source paths should be relative to the top level.
diff --git a/hw/bsp/feather_m4_express/board.mk b/hw/bsp/feather_m4_express/board.mk
index c62d9bc33..010e4b868 100644
--- a/hw/bsp/feather_m4_express/board.mk
+++ b/hw/bsp/feather_m4_express/board.mk
@@ -1,11 +1,12 @@
CFLAGS += \
- -D__SAMD51J19A__ \
+ -flto \
-mthumb \
-mabi=aapcs-linux \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
+ -D__SAMD51J19A__ \
-DCFG_TUSB_MCU=OPT_MCU_SAMD51
CFLAGS += -Wno-error=undef
diff --git a/hw/bsp/feather_nrf52840_express/board.mk b/hw/bsp/feather_nrf52840_express/board.mk
index 1e077bac7..b4d6fbe9f 100644
--- a/hw/bsp/feather_nrf52840_express/board.mk
+++ b/hw/bsp/feather_nrf52840_express/board.mk
@@ -1,11 +1,12 @@
CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -DCFG_TUSB_MCU=OPT_MCU_NRF5X \
- -DNRF52840_XXAA \
+ -flto \
+ -mthumb \
+ -mabi=aapcs \
+ -mcpu=cortex-m4 \
+ -mfloat-abi=hard \
+ -mfpu=fpv4-sp-d16 \
+ -DCFG_TUSB_MCU=OPT_MCU_NRF5X \
+ -DNRF52840_XXAA \
-DCONFIG_GPIO_AS_PINRESET
# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
@@ -23,17 +24,17 @@ LD_FILE = hw/bsp/feather_nrf52840_express/nrf52840_s140_v6.ld
LDFLAGS += -L$(TOP)/hw/mcu/nordic/nrfx/mdk
SRC_C += \
- hw/mcu/nordic/nrfx/drivers/src/nrfx_power.c \
- hw/mcu/nordic/nrfx/mdk/system_nrf52840.c \
+ hw/mcu/nordic/nrfx/drivers/src/nrfx_power.c \
+ hw/mcu/nordic/nrfx/mdk/system_nrf52840.c \
INC += \
- $(TOP)/hw/mcu/nordic/cmsis/Include \
- $(TOP)/hw/mcu/nordic \
- $(TOP)/hw/mcu/nordic/nrfx \
- $(TOP)/hw/mcu/nordic/nrfx/mdk \
- $(TOP)/hw/mcu/nordic/nrfx/hal \
- $(TOP)/hw/mcu/nordic/nrfx/drivers/include \
- $(TOP)/hw/mcu/nordic/nrfx/drivers/src \
+ $(TOP)/hw/mcu/nordic/cmsis/Include \
+ $(TOP)/hw/mcu/nordic \
+ $(TOP)/hw/mcu/nordic/nrfx \
+ $(TOP)/hw/mcu/nordic/nrfx/mdk \
+ $(TOP)/hw/mcu/nordic/nrfx/hal \
+ $(TOP)/hw/mcu/nordic/nrfx/drivers/include \
+ $(TOP)/hw/mcu/nordic/nrfx/drivers/src \
SRC_S += hw/mcu/nordic/nrfx/mdk/gcc_startup_nrf52840.S
diff --git a/hw/bsp/feather_stm32f405/board.mk b/hw/bsp/feather_stm32f405/board.mk
index 14595e83e..1e68737b9 100644
--- a/hw/bsp/feather_stm32f405/board.mk
+++ b/hw/bsp/feather_stm32f405/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=12000000 \
- -DSTM32F405xx \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
+ -DSTM32F405xx \
+ -DHSE_VALUE=12000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver
diff --git a/hw/bsp/fomu/board.mk b/hw/bsp/fomu/board.mk
index cdcd63b28..4e8101b7f 100644
--- a/hw/bsp/fomu/board.mk
+++ b/hw/bsp/fomu/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-march=rv32i \
-mabi=ilp32 \
-nostdlib \
diff --git a/hw/bsp/lpcxpresso11u37/board.mk b/hw/bsp/lpcxpresso11u37/board.mk
index 72c5ef0d8..d3121ab95 100644
--- a/hw/bsp/lpcxpresso11u37/board.mk
+++ b/hw/bsp/lpcxpresso11u37/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m0 \
diff --git a/hw/bsp/lpcxpresso11u68/board.mk b/hw/bsp/lpcxpresso11u68/board.mk
index c1718395c..ba84b7d95 100644
--- a/hw/bsp/lpcxpresso11u68/board.mk
+++ b/hw/bsp/lpcxpresso11u68/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m0plus \
diff --git a/hw/bsp/lpcxpresso1347/board.mk b/hw/bsp/lpcxpresso1347/board.mk
index 1900ca0a8..54a83a3b6 100644
--- a/hw/bsp/lpcxpresso1347/board.mk
+++ b/hw/bsp/lpcxpresso1347/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \
diff --git a/hw/bsp/lpcxpresso1549/board.mk b/hw/bsp/lpcxpresso1549/board.mk
index 66078f0f6..18325c5f7 100644
--- a/hw/bsp/lpcxpresso1549/board.mk
+++ b/hw/bsp/lpcxpresso1549/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \
diff --git a/hw/bsp/lpcxpresso1769/board.mk b/hw/bsp/lpcxpresso1769/board.mk
index 412e0cd57..8d1f14c42 100644
--- a/hw/bsp/lpcxpresso1769/board.mk
+++ b/hw/bsp/lpcxpresso1769/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \
diff --git a/hw/bsp/lpcxpresso51u68/board.mk b/hw/bsp/lpcxpresso51u68/board.mk
index f02dee033..61fbc0623 100644
--- a/hw/bsp/lpcxpresso51u68/board.mk
+++ b/hw/bsp/lpcxpresso51u68/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m0plus \
diff --git a/hw/bsp/lpcxpresso54114/board.mk b/hw/bsp/lpcxpresso54114/board.mk
index 24de4a44b..474a1ac5b 100644
--- a/hw/bsp/lpcxpresso54114/board.mk
+++ b/hw/bsp/lpcxpresso54114/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
diff --git a/hw/bsp/lpcxpresso55s69/board.mk b/hw/bsp/lpcxpresso55s69/board.mk
index fada53dc3..5977ce9f4 100644
--- a/hw/bsp/lpcxpresso55s69/board.mk
+++ b/hw/bsp/lpcxpresso55s69/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m33 \
diff --git a/hw/bsp/mbed1768/board.mk b/hw/bsp/mbed1768/board.mk
index 9bb0a792c..03176b543 100644
--- a/hw/bsp/mbed1768/board.mk
+++ b/hw/bsp/mbed1768/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \
diff --git a/hw/bsp/mcb1800/board.mk b/hw/bsp/mcb1800/board.mk
index b50e47a2e..2a0401305 100644
--- a/hw/bsp/mcb1800/board.mk
+++ b/hw/bsp/mcb1800/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m3 \
diff --git a/hw/bsp/metro_m0_express/board.mk b/hw/bsp/metro_m0_express/board.mk
index 3ea672807..2039219a4 100644
--- a/hw/bsp/metro_m0_express/board.mk
+++ b/hw/bsp/metro_m0_express/board.mk
@@ -1,10 +1,11 @@
CFLAGS += \
- -DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
- -D__SAMD21G18A__ \
+ -flto \
-mthumb \
-mabi=aapcs-linux \
-mcpu=cortex-m0plus \
-nostdlib -nostartfiles \
+ -D__SAMD21G18A__ \
+ -DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
-DCFG_TUSB_MCU=OPT_MCU_SAMD21
# All source paths should be relative to the top level.
diff --git a/hw/bsp/metro_m4_express/board.mk b/hw/bsp/metro_m4_express/board.mk
index c62d9bc33..010e4b868 100644
--- a/hw/bsp/metro_m4_express/board.mk
+++ b/hw/bsp/metro_m4_express/board.mk
@@ -1,11 +1,12 @@
CFLAGS += \
- -D__SAMD51J19A__ \
+ -flto \
-mthumb \
-mabi=aapcs-linux \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
+ -D__SAMD51J19A__ \
-DCFG_TUSB_MCU=OPT_MCU_SAMD51
CFLAGS += -Wno-error=undef
diff --git a/hw/bsp/mimxrt1064_evk/mimxrt1064_evk.c b/hw/bsp/mimxrt1064_evk/mimxrt1064_evk.c
index 012c8ab5d..be6aa9b66 100644
--- a/hw/bsp/mimxrt1064_evk/mimxrt1064_evk.c
+++ b/hw/bsp/mimxrt1064_evk/mimxrt1064_evk.c
@@ -41,7 +41,7 @@
#define BUTTON_PIN 0
#define BUTTON_STATE_ACTIVE 0
-const uint8_t dcd_data[] = {0x00};
+const uint8_t dcd_data[] = { 0x00 };
void board_init(void)
{
diff --git a/hw/bsp/ngx4330/board.mk b/hw/bsp/ngx4330/board.mk
index 565532b46..4e6032fcc 100644
--- a/hw/bsp/ngx4330/board.mk
+++ b/hw/bsp/ngx4330/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
diff --git a/hw/bsp/nrf52840_mdk_dongle/board.mk b/hw/bsp/nrf52840_mdk_dongle/board.mk
index df834f963..b92556002 100644
--- a/hw/bsp/nrf52840_mdk_dongle/board.mk
+++ b/hw/bsp/nrf52840_mdk_dongle/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
diff --git a/hw/bsp/pca10056/board.mk b/hw/bsp/pca10056/board.mk
index abe0d642c..b4031844e 100644
--- a/hw/bsp/pca10056/board.mk
+++ b/hw/bsp/pca10056/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
diff --git a/hw/bsp/pca10059/board.mk b/hw/bsp/pca10059/board.mk
index 15801054c..19ec3eaea 100644
--- a/hw/bsp/pca10059/board.mk
+++ b/hw/bsp/pca10059/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
diff --git a/hw/bsp/pca10100/board.mk b/hw/bsp/pca10100/board.mk
index 97d9aa428..d7ac7ec4f 100644
--- a/hw/bsp/pca10100/board.mk
+++ b/hw/bsp/pca10100/board.mk
@@ -1,4 +1,5 @@
CFLAGS += \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
diff --git a/hw/bsp/pyboardv11/board.mk b/hw/bsp/pyboardv11/board.mk
index ef9777976..0118b54a4 100644
--- a/hw/bsp/pyboardv11/board.mk
+++ b/hw/bsp/pyboardv11/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=12000000 \
- -DSTM32F405xx \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
+ -DSTM32F405xx \
+ -DHSE_VALUE=12000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver
diff --git a/hw/bsp/spresense/board.mk b/hw/bsp/spresense/board.mk
index 16421686a..2e88cf994 100644
--- a/hw/bsp/spresense/board.mk
+++ b/hw/bsp/spresense/board.mk
@@ -1,12 +1,3 @@
-SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk
-
-INC += \
- $(SPRESENSE_SDK)/nuttx/include \
- $(SPRESENSE_SDK)/nuttx/arch \
- $(SPRESENSE_SDK)/nuttx/arch/chip \
- $(SPRESENSE_SDK)/sdk/bsp/include \
- $(SPRESENSE_SDK)/sdk/bsp/include/sdk \
-
CFLAGS += \
-DCONFIG_WCHAR_BUILTIN \
-DCONFIG_HAVE_DOUBLE \
@@ -23,6 +14,15 @@ CFLAGS += \
-fomit-frame-pointer \
-DCFG_TUSB_MCU=OPT_MCU_CXD56 \
+SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk
+
+INC += \
+ $(SPRESENSE_SDK)/nuttx/include \
+ $(SPRESENSE_SDK)/nuttx/arch \
+ $(SPRESENSE_SDK)/nuttx/arch/chip \
+ $(SPRESENSE_SDK)/sdk/bsp/include \
+ $(SPRESENSE_SDK)/sdk/bsp/include/sdk \
+
LIBS += \
$(SPRESENSE_SDK)/sdk/libs/libapps.a \
$(SPRESENSE_SDK)/sdk/libs/libsdk.a \
diff --git a/hw/bsp/stm32f070rbnucleo/board.mk b/hw/bsp/stm32f070rbnucleo/board.mk
index f930f6a85..6e52b8141 100644
--- a/hw/bsp/stm32f070rbnucleo/board.mk
+++ b/hw/bsp/stm32f070rbnucleo/board.mk
@@ -1,13 +1,14 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32F070xB \
- -mthumb \
- -mabi=aapcs-linux \
- -mcpu=cortex-m0 \
- -mfloat-abi=soft \
- -nostdlib -nostartfiles \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F0
+ -flto \
+ -mthumb \
+ -mabi=aapcs-linux \
+ -mcpu=cortex-m0 \
+ -mfloat-abi=soft \
+ -nostdlib -nostartfiles \
+ -DHSE_VALUE=8000000 \
+ -DSTM32F070xB \
+ -DCFG_EXAMPLE_MSC_READONLY \
+ -DCFG_TUSB_MCU=OPT_MCU_STM32F0
# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter
@@ -19,21 +20,21 @@ ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F0xx
LD_FILE = hw/bsp/$(BOARD)/stm32F070rbtx_flash.ld
SRC_C += \
- $(ST_CMSIS)/Source/Templates/system_stm32f0xx.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_gpio.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_uart.c
+ $(ST_CMSIS)/Source/Templates/system_stm32f0xx.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_cortex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_rcc.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_rcc_ex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_gpio.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_uart.c
SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f070xb.s
+ $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f070xb.s
INC += \
- $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
+ $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
+ $(TOP)/$(ST_CMSIS)/Include \
+ $(TOP)/$(ST_HAL_DRIVER)/Inc \
+ $(TOP)/hw/bsp/$(BOARD)
# For TinyUSB port source
VENDOR = st
diff --git a/hw/bsp/stm32f072disco/board.mk b/hw/bsp/stm32f072disco/board.mk
index 39715e83f..5ed87cfa8 100644
--- a/hw/bsp/stm32f072disco/board.mk
+++ b/hw/bsp/stm32f072disco/board.mk
@@ -1,13 +1,14 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32F072xB \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0 \
- -mfloat-abi=soft \
- -nostdlib -nostartfiles \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F0
+ -flto \
+ -mthumb \
+ -mabi=aapcs \
+ -mcpu=cortex-m0 \
+ -mfloat-abi=soft \
+ -nostdlib -nostartfiles \
+ -DSTM32F072xB \
+ -DHSE_VALUE=8000000 \
+ -DCFG_EXAMPLE_MSC_READONLY \
+ -DCFG_TUSB_MCU=OPT_MCU_STM32F0
# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter
@@ -19,22 +20,22 @@ ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F0xx
LD_FILE = hw/bsp/$(BOARD)/STM32F072RBTx_FLASH.ld
SRC_C += \
- $(ST_CMSIS)/Source/Templates/system_stm32f0xx.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_gpio.c \
- $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_uart.c
+ $(ST_CMSIS)/Source/Templates/system_stm32f0xx.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_cortex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_rcc.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_rcc_ex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_gpio.c \
+ $(ST_HAL_DRIVER)/Src/stm32f0xx_hal_uart.c
SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f072xb.s
+ $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f072xb.s
INC += \
- $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
+ $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
+ $(TOP)/$(ST_CMSIS)/Include \
+ $(TOP)/$(ST_HAL_DRIVER)/Inc \
+ $(TOP)/hw/bsp/$(BOARD)
# For TinyUSB port source
VENDOR = st
diff --git a/hw/bsp/stm32f103bluepill/board.mk b/hw/bsp/stm32f103bluepill/board.mk
index 26ad07b74..f464fa298 100644
--- a/hw/bsp/stm32f103bluepill/board.mk
+++ b/hw/bsp/stm32f103bluepill/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32F103xB \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m3 \
- -mfloat-abi=soft \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F1
+ -flto \
+ -mthumb \
+ -mabi=aapcs \
+ -mcpu=cortex-m3 \
+ -mfloat-abi=soft \
+ -nostdlib -nostartfiles \
+ -DSTM32F103xB \
+ -DHSE_VALUE=8000000 \
+ -DCFG_TUSB_MCU=OPT_MCU_STM32F1
# mcu driver cause following warnings
#CFLAGS += -Wno-error=unused-parameter
@@ -18,21 +19,21 @@ ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F1xx
LD_FILE = hw/bsp/$(BOARD)/STM32F103XB_FLASH.ld
SRC_C += \
- $(ST_CMSIS)/Source/Templates/system_stm32f1xx.c \
- $(ST_HAL_DRIVER)/Src/stm32f1xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32f1xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32f1xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32f1xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32f1xx_hal_gpio.c
+ $(ST_CMSIS)/Source/Templates/system_stm32f1xx.c \
+ $(ST_HAL_DRIVER)/Src/stm32f1xx_hal.c \
+ $(ST_HAL_DRIVER)/Src/stm32f1xx_hal_cortex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f1xx_hal_rcc.c \
+ $(ST_HAL_DRIVER)/Src/stm32f1xx_hal_rcc_ex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f1xx_hal_gpio.c
SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f103xb.s
+ $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f103xb.s
INC += \
- $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
+ $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
+ $(TOP)/$(ST_CMSIS)/Include \
+ $(TOP)/$(ST_HAL_DRIVER)/Inc \
+ $(TOP)/hw/bsp/$(BOARD)
# For TinyUSB port source
VENDOR = st
diff --git a/hw/bsp/stm32f207nucleo/board.mk b/hw/bsp/stm32f207nucleo/board.mk
index cd2b26204..003a3dd41 100644
--- a/hw/bsp/stm32f207nucleo/board.mk
+++ b/hw/bsp/stm32f207nucleo/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32F207xx \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m3 \
- -mfloat-abi=soft \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F2
+ -flto \
+ -mthumb \
+ -mabi=aapcs \
+ -mcpu=cortex-m3 \
+ -mfloat-abi=soft \
+ -nostdlib -nostartfiles \
+ -DSTM32F207xx \
+ -DHSE_VALUE=8000000 \
+ -DCFG_TUSB_MCU=OPT_MCU_STM32F2
# mcu driver cause following warnings
CFLAGS += -Wno-error=sign-compare
@@ -18,21 +19,21 @@ ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F2xx
LD_FILE = hw/bsp/$(BOARD)/STM32F207ZGTx_FLASH.ld
SRC_C += \
- $(ST_CMSIS)/Source/Templates/system_stm32f2xx.c \
- $(ST_HAL_DRIVER)/Src/stm32f2xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32f2xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32f2xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32f2xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32f2xx_hal_gpio.c
+ $(ST_CMSIS)/Source/Templates/system_stm32f2xx.c \
+ $(ST_HAL_DRIVER)/Src/stm32f2xx_hal.c \
+ $(ST_HAL_DRIVER)/Src/stm32f2xx_hal_cortex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f2xx_hal_rcc.c \
+ $(ST_HAL_DRIVER)/Src/stm32f2xx_hal_rcc_ex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f2xx_hal_gpio.c
SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f207xx.s
+ $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f207xx.s
INC += \
- $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
+ $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
+ $(TOP)/$(ST_CMSIS)/Include \
+ $(TOP)/$(ST_HAL_DRIVER)/Inc \
+ $(TOP)/hw/bsp/$(BOARD)
# For TinyUSB port source
VENDOR = st
diff --git a/hw/bsp/stm32f303disco/board.mk b/hw/bsp/stm32f303disco/board.mk
index ab77c55c4..fbe034144 100644
--- a/hw/bsp/stm32f303disco/board.mk
+++ b/hw/bsp/stm32f303disco/board.mk
@@ -1,13 +1,14 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32F303xC \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F3
+ -flto \
+ -mthumb \
+ -mabi=aapcs \
+ -mcpu=cortex-m4 \
+ -mfloat-abi=hard \
+ -mfpu=fpv4-sp-d16 \
+ -nostdlib -nostartfiles \
+ -DSTM32F303xC \
+ -DHSE_VALUE=8000000 \
+ -DCFG_TUSB_MCU=OPT_MCU_STM32F3
# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter
@@ -19,21 +20,21 @@ ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F3xx
LD_FILE = hw/bsp/$(BOARD)/STM32F303VCTx_FLASH.ld
SRC_C += \
- $(ST_CMSIS)/Source/Templates/system_stm32f3xx.c \
- $(ST_HAL_DRIVER)/Src/stm32f3xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32f3xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32f3xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32f3xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32f3xx_hal_gpio.c
+ $(ST_CMSIS)/Source/Templates/system_stm32f3xx.c \
+ $(ST_HAL_DRIVER)/Src/stm32f3xx_hal.c \
+ $(ST_HAL_DRIVER)/Src/stm32f3xx_hal_cortex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f3xx_hal_rcc.c \
+ $(ST_HAL_DRIVER)/Src/stm32f3xx_hal_rcc_ex.c \
+ $(ST_HAL_DRIVER)/Src/stm32f3xx_hal_gpio.c
SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f303xc.s
+ $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f303xc.s
INC += \
- $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
+ $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
+ $(TOP)/$(ST_CMSIS)/Include \
+ $(TOP)/$(ST_HAL_DRIVER)/Inc \
+ $(TOP)/hw/bsp/$(BOARD)
# For TinyUSB port source
VENDOR = st
diff --git a/hw/bsp/stm32f407disco/board.mk b/hw/bsp/stm32f407disco/board.mk
index 4f4c10091..216b51bf9 100644
--- a/hw/bsp/stm32f407disco/board.mk
+++ b/hw/bsp/stm32f407disco/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32F407xx \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
+ -DSTM32F407xx \
+ -DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver
diff --git a/hw/bsp/stm32f411disco/board.mk b/hw/bsp/stm32f411disco/board.mk
index dcfee33cf..63aa76154 100644
--- a/hw/bsp/stm32f411disco/board.mk
+++ b/hw/bsp/stm32f411disco/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32F411xE \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
+ -DSTM32F411xE \
+ -DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver
diff --git a/hw/bsp/stm32f412disco/board.mk b/hw/bsp/stm32f412disco/board.mk
index e059c81d1..ddb8402ec 100644
--- a/hw/bsp/stm32f412disco/board.mk
+++ b/hw/bsp/stm32f412disco/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32F412Zx \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
+ -DSTM32F412Zx \
+ -DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
# mcu driver cause following warnings
diff --git a/hw/bsp/stm32f767nucleo/board.mk b/hw/bsp/stm32f767nucleo/board.mk
index 46023334c..5d9645379 100644
--- a/hw/bsp/stm32f767nucleo/board.mk
+++ b/hw/bsp/stm32f767nucleo/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32F767xx \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m7 \
-mfloat-abi=hard \
-mfpu=fpv5-d16 \
-nostdlib -nostartfiles \
+ -DSTM32F767xx \
+ -DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32F7
# mcu driver cause following warnings
diff --git a/hw/bsp/stm32h743nucleo/board.mk b/hw/bsp/stm32h743nucleo/board.mk
index 40b36413f..cfea7f57b 100644
--- a/hw/bsp/stm32h743nucleo/board.mk
+++ b/hw/bsp/stm32h743nucleo/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32H743xx \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m7 \
-mfloat-abi=hard \
-mfpu=fpv5-d16 \
-nostdlib -nostartfiles \
+ -DSTM32H743xx \
+ -DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32H7
# mcu driver cause following warnings
diff --git a/hw/bsp/stm32l0538disco/board.mk b/hw/bsp/stm32l0538disco/board.mk
index 7e11fa6cd..d81b2d887 100644
--- a/hw/bsp/stm32l0538disco/board.mk
+++ b/hw/bsp/stm32l0538disco/board.mk
@@ -1,13 +1,14 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32L053xx \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0plus \
- -mfloat-abi=soft \
- -nostdlib -nostartfiles \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_STM32L0
+ -flto \
+ -mthumb \
+ -mabi=aapcs \
+ -mcpu=cortex-m0plus \
+ -mfloat-abi=soft \
+ -nostdlib -nostartfiles \
+ -DSTM32L053xx \
+ -DHSE_VALUE=8000000 \
+ -DCFG_EXAMPLE_MSC_READONLY \
+ -DCFG_TUSB_MCU=OPT_MCU_STM32L0
# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized
@@ -19,21 +20,21 @@ ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32L0xx
LD_FILE = hw/bsp/$(BOARD)/STM32L053C8Tx_FLASH.ld
SRC_C += \
- $(ST_CMSIS)/Source/Templates/system_stm32l0xx.c \
- $(ST_HAL_DRIVER)/Src/stm32l0xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32l0xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32l0xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32l0xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32l0xx_hal_gpio.c
+ $(ST_CMSIS)/Source/Templates/system_stm32l0xx.c \
+ $(ST_HAL_DRIVER)/Src/stm32l0xx_hal.c \
+ $(ST_HAL_DRIVER)/Src/stm32l0xx_hal_cortex.c \
+ $(ST_HAL_DRIVER)/Src/stm32l0xx_hal_rcc.c \
+ $(ST_HAL_DRIVER)/Src/stm32l0xx_hal_rcc_ex.c \
+ $(ST_HAL_DRIVER)/Src/stm32l0xx_hal_gpio.c
SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l053xx.s
+ $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l053xx.s
INC += \
- $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
+ $(TOP)/hw/mcu/st/st_driver/CMSIS/Include \
+ $(TOP)/$(ST_CMSIS)/Include \
+ $(TOP)/$(ST_HAL_DRIVER)/Inc \
+ $(TOP)/hw/bsp/$(BOARD)
# For TinyUSB port source
VENDOR = st
diff --git a/hw/bsp/stm32l476disco/board.mk b/hw/bsp/stm32l476disco/board.mk
index c987fea64..3432ac2e5 100644
--- a/hw/bsp/stm32l476disco/board.mk
+++ b/hw/bsp/stm32l476disco/board.mk
@@ -1,12 +1,13 @@
CFLAGS += \
- -DHSE_VALUE=8000000 \
- -DSTM32L476xx \
+ -flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
+ -DSTM32L476xx \
+ -DHSE_VALUE=8000000 \
-DCFG_TUSB_MCU=OPT_MCU_STM32L4
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32L4xx_HAL_Driver