2019-08-29 17:41:49 +02:00
|
|
|
CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM))
|
2016-02-08 21:18:05 +01:00
|
|
|
|
2017-10-17 15:07:18 +02:00
|
|
|
# For stm32 cpu's we use the stm32_common.ld linker script
|
2020-01-02 09:50:35 +01:00
|
|
|
LINKFLAGS += -L$(RIOTCPU)/stm32_common/ldscripts
|
2017-10-17 15:07:18 +02:00
|
|
|
LINKER_SCRIPT ?= stm32_common.ld
|
|
|
|
|
2019-08-27 16:06:41 +02:00
|
|
|
INCLUDES += -I$(RIOTCPU)/stm32_common/include
|
2017-10-17 15:07:18 +02:00
|
|
|
|
2018-06-18 19:18:37 +02:00
|
|
|
# Compute ROM_LEN and RAM_LEN
|
2017-10-17 15:07:18 +02:00
|
|
|
include $(RIOTCPU)/stm32_common/stm32_mem_lengths.mk
|
2018-06-18 19:18:37 +02:00
|
|
|
KB := 1024
|
2019-07-23 16:21:32 +02:00
|
|
|
ROM_LEN_K := $(shell echo $(ROM_LEN) | sed 's/K//')
|
|
|
|
|
|
|
|
ifeq (stm32wb55rg,$(CPU_MODEL))
|
|
|
|
# adjust RAM_LEN and ROM_LEN according to CPU2 RAM_LEN and ROM_LEN
|
|
|
|
RAM_LEN_K := $(shell echo $(RAM_LEN) | sed 's/K//')
|
|
|
|
CPU2_RAM_LEN_K := $(shell echo $(CPU2_RAM_LEN) | sed 's/K//')
|
|
|
|
RAM_LEN := $(shell echo $$(( ($(RAM_LEN_K) - $(CPU2_RAM_LEN_K) ) ))K)
|
|
|
|
|
|
|
|
CPU2_ROM_LEN_K := $(shell echo $(CPU2_ROM_LEN) | sed 's/K//')
|
|
|
|
FLASHSIZE := $(shell echo $$(( ($(ROM_LEN_K) - $(CPU2_ROM_LEN_K) )* $(KB) )) )
|
|
|
|
ROM_LEN := $(shell echo $$(( ($(ROM_LEN_K) - $(CPU2_ROM_LEN_K) ) ))K)
|
|
|
|
else
|
|
|
|
FLASHSIZE := $(shell echo $$(( $(ROM_LEN_K) * $(KB) )) )
|
|
|
|
endif
|
2017-11-22 15:53:30 +01:00
|
|
|
|
2018-05-07 18:04:32 +02:00
|
|
|
# Get CPU_LINE_ variable
|
|
|
|
-include $(RIOTCPU)/$(CPU)/stm32_line.mk
|
|
|
|
CPU_LINE ?= $(shell echo $(CPU_MODEL) | cut -c -9 | tr 'a-z-' 'A-Z_')xx
|
|
|
|
|
|
|
|
# Set CFLAGS
|
2019-08-27 16:06:41 +02:00
|
|
|
CFLAGS += -D$(CPU_LINE) -DCPU_LINE_$(CPU_LINE)
|
|
|
|
CFLAGS += -DSTM32_FLASHSIZE=$(FLASHSIZE)U
|
2018-05-07 18:04:32 +02:00
|
|
|
|
2018-05-04 15:27:50 +02:00
|
|
|
info-stm32:
|
|
|
|
@$(COLOR_ECHO) "CPU: $(CPU_MODEL)"
|
2018-05-07 18:04:32 +02:00
|
|
|
@$(COLOR_ECHO) "\tLine: $(CPU_LINE)"
|
2018-05-04 15:27:50 +02:00
|
|
|
@$(COLOR_ECHO) "\tPin count:\t$(STM32_PINCOUNT)"
|
2018-06-18 19:18:37 +02:00
|
|
|
@$(COLOR_ECHO) "\tROM size:\t$(ROM_LEN) ($(FLASHSIZE) Bytes)"
|
2018-05-04 15:27:50 +02:00
|
|
|
@$(COLOR_ECHO) "\tRAM size:\t$(RAM_LEN)"
|
|
|
|
|
2017-11-22 15:53:30 +01:00
|
|
|
ifneq (,$(CCMRAM_LEN))
|
|
|
|
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ccmram_length=$(CCMRAM_LEN)
|
|
|
|
endif
|