cpu/stm32: handle generated irqs.h in build system
This commit is contained in:
parent
39d95b1950
commit
0da196d98d
@ -43,24 +43,45 @@ ifneq (,$(CCMRAM_LEN))
|
|||||||
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ccmram_length=$(CCMRAM_LEN)
|
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ccmram_length=$(CCMRAM_LEN)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter STM32F030x4,$(CPU_LINE)))
|
|
||||||
VECTORS_O ?= $(BINDIR)/stm32_vectors/$(CPU_LINE).o
|
VECTORS_O ?= $(BINDIR)/stm32_vectors/$(CPU_LINE).o
|
||||||
else
|
VECTORS_FILE = $(RIOTCPU)/stm32/vectors/$(CPU_LINE).c
|
||||||
VECTORS_O ?= $(BINDIR)/stm32_vectors/gen_$(CPU_LINE).o
|
|
||||||
VECTORS_FILE = $(RIOTCPU)/stm32/vectors/gen_$(CPU_LINE).c
|
|
||||||
BUILDDEPS += $(VECTORS_FILE)
|
BUILDDEPS += $(VECTORS_FILE)
|
||||||
|
|
||||||
|
# CPU_LINE must be exported only when building the vectors object file since
|
||||||
|
# the source filename to be built is built from the CPU_LINE content.
|
||||||
|
$(call target-export-variables,$(VECTORS_O),CPU_LINE)
|
||||||
|
|
||||||
# Add this define to skip the inclusion of the system_stm32xxxx.h header files
|
# Add this define to skip the inclusion of the system_stm32xxxx.h header files
|
||||||
# which are only used for STM32 system includes and not of interest for RIOT.
|
# which are only used for STM32 system includes and not of interest for RIOT.
|
||||||
CFLAGS += -D__SYSTEM_STM32$(call uppercase,$(CPU_FAM))XX_H
|
CFLAGS += -D__SYSTEM_STM32$(call uppercase,$(CPU_FAM))XX_H
|
||||||
|
|
||||||
STM32CMSIS_INCLUDE_DIR = $(RIOTBASE)/cpu/stm32/include/vendor/cmsis/$(CPU_FAM)/Include
|
STM32CMSIS_INCLUDE_DIR = $(RIOTCPU)/stm32/include/vendor/cmsis/$(CPU_FAM)/Include
|
||||||
|
STM32FAM_INCLUDE_FILE = $(STM32CMSIS_INCLUDE_DIR)/stm32$(CPU_FAM)xx.h
|
||||||
INCLUDES += -I$(STM32CMSIS_INCLUDE_DIR)
|
INCLUDES += -I$(STM32CMSIS_INCLUDE_DIR)
|
||||||
|
|
||||||
$(VECTORS_FILE):
|
# Fetch all CMSIS headers using the package mechanism. This rule is called all
|
||||||
$(Q)make -C $(RIOTPKG)/stm32cmsis
|
# the time to ensure it's correctly updated when versions in the packages are
|
||||||
$(Q)$(RIOTTOOLS)/stm32_gen_vectors/stm32_gen_vectors.py $(CPU_LINE)
|
# updated.
|
||||||
|
$(STM32FAM_INCLUDE_FILE): FORCE
|
||||||
|
$(Q)make -C $(RIOTCPU)/stm32/include/vendor
|
||||||
|
|
||||||
|
# The vectors source file requires the family headers to be fetched before since
|
||||||
|
# it's generated from the CMSIS content
|
||||||
|
$(VECTORS_FILE): $(STM32FAM_INCLUDE_FILE)
|
||||||
|
$(Q)$(RIOTBASE)/cpu/stm32/dist/irqs/gen_vectors.py $(CPU_LINE)
|
||||||
|
|
||||||
|
ifneq (STM32F030x4,$(CPU_LINE))
|
||||||
|
# IRQs of STM32F030x4 family are not available in the CMSIS package so they
|
||||||
|
# are hardcoded in RIOTs codebase.
|
||||||
|
# For other lines, the IRQs are automatically generated once from the whole
|
||||||
|
# list of CMSIS headers available in a given family
|
||||||
|
STM32IRQS_INCLUDE_FILE = $(RIOTCPU)/stm32/include/irqs/$(CPU_FAM)/irqs.h
|
||||||
|
BUILDDEPS += $(STM32IRQS_INCLUDE_FILE)
|
||||||
|
|
||||||
|
# The IRQ header for a given family requires the family headers to be fetched
|
||||||
|
# before since it's generated from all CMSIS content of that family
|
||||||
|
$(STM32IRQS_INCLUDE_FILE): $(STM32FAM_INCLUDE_FILE)
|
||||||
|
$(Q)$(RIOTBASE)/cpu/stm32/dist/irqs/gen_irqs.py $(CPU_FAM)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(RIOTMAKE)/arch/cortexm.inc.mk
|
include $(RIOTMAKE)/arch/cortexm.inc.mk
|
||||||
|
|||||||
@ -2,13 +2,9 @@ MODULE = stm32_vectors
|
|||||||
|
|
||||||
NO_AUTO_SRC = 1
|
NO_AUTO_SRC = 1
|
||||||
|
|
||||||
ifneq (,$(filter STM32F030x4,$(CPU_LINE)))
|
|
||||||
SRC_FILE = $(CPU_LINE).c
|
SRC_FILE = $(CPU_LINE).c
|
||||||
else
|
SRCS = $(SRC_FILE)
|
||||||
SRC_FILE = gen_$(CPU_LINE).c
|
|
||||||
endif
|
|
||||||
|
|
||||||
SRCS += $(SRC_FILE)
|
|
||||||
# (file triggers compiler bug. see #5775)
|
# (file triggers compiler bug. see #5775)
|
||||||
SRC_NOLTO += $(SRC_FILE)
|
SRC_NOLTO += $(SRC_FILE)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user