Port to srm32g031
This commit is contained in:
24
Makefile
24
Makefile
@@ -17,9 +17,6 @@ platform/stm32g0xx/system_stm32g0xx.c \
|
||||
platform/stm32g0xx/syscalls.c \
|
||||
platform/stm32g0xx/sysmem.c \
|
||||
|
||||
ASM_SOURCES = \
|
||||
platform/stm32g0xx/startup_stm32g071rbtx.s
|
||||
|
||||
PREFIX = arm-none-eabi-
|
||||
CC = $(PREFIX)gcc
|
||||
CXX = $(PREFIX)g++
|
||||
@@ -33,8 +30,21 @@ BIN = $(CP) -O binary -S
|
||||
CPU = -mcpu=cortex-m0plus
|
||||
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
|
||||
|
||||
C_DEFS = \
|
||||
-DSTM32G071xx
|
||||
ifeq "$(SOC)" "stm32g071"
|
||||
|
||||
C_DEFS = -DSTM32G071xx
|
||||
LDSCRIPT = platform/stm32g0xx/STM32G071RBTX_FLASH.ld
|
||||
ASM_SOURCES = platform/stm32g0xx/startup_stm32g071rbtx.s
|
||||
|
||||
else
|
||||
ifeq "$(SOC)" "stm32g031"
|
||||
|
||||
C_DEFS = -DSTM32G031xx
|
||||
LDSCRIPT = platform/stm32g0xx/STM32G031Y8YX_FLASH.ld
|
||||
ASM_SOURCES = platform/stm32g0xx/startup_stm32g031y8yx.s
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
C_INCLUDES = \
|
||||
-I. \
|
||||
@@ -52,8 +62,6 @@ endif
|
||||
|
||||
CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
|
||||
|
||||
LDSCRIPT = platform/stm32g0xx/STM32G071RBTX_FLASH.ld
|
||||
|
||||
LIBS = -lc -lm -lnosys
|
||||
LIBDIR =
|
||||
LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
|
||||
@@ -78,7 +86,7 @@ $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
|
||||
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
|
||||
$(AS) -c $(CFLAGS) $< -o $@
|
||||
|
||||
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
|
||||
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) | Makefile
|
||||
$(CXX) $(OBJECTS) $(LDFLAGS) -o $@
|
||||
$(SZ) $@
|
||||
|
||||
|
Reference in New Issue
Block a user