Browse Source

[DEVELOPMENT] Add svd Makefile target to generate SVD file for targets

SVD are useful for some IDEs, to be able to see the state of all
peripherals.
master
Alberto García Hierro 5 years ago
parent
commit
494cd254d4
  1. 5
      Makefile
  2. 40381
      dev/svd/STM32F303.svd
  3. 61681
      dev/svd/STM32F405.svd
  4. 27110
      dev/svd/STM32F411.svd
  5. 63121
      dev/svd/STM32F427.svd
  6. 57155
      dev/svd/STM32F446.svd
  7. 61861
      dev/svd/STM32F7x2.svd
  8. 71136
      dev/svd/STM32F7x5.svd
  9. 70681
      dev/svd/STM32F7x6.svd
  10. 32
      make/svd.mk
  11. 40
      make/targets.mk

5
Makefile

@ -110,7 +110,7 @@ CSOURCES := $(shell find $(SRC_DIR) -name '*.c')
# start specific includes
include $(ROOT)/make/mcu/STM32.mk
include $(ROOT)/make/mcu/$(TARGET_MCU).mk
include $(ROOT)/make/mcu/$(TARGET_MCU_GROUP).mk
# Configure default flash sizes for the targets (largest size specified gets hit first) if flash not specified already.
ifeq ($(FLASH_SIZE),)
@ -123,7 +123,7 @@ endif
# Configure devide and target-specific defines and compiler flags
DEVICE_FLAGS := $(DEVICE_FLAGS) -DFLASH_SIZE=$(FLASH_SIZE)
TARGET_FLAGS := $(TARGET_FLAGS) -D$(TARGET_MCU) -D$(TARGET)
TARGET_FLAGS := $(TARGET_FLAGS) -D$(TARGET_MCU) -D$(TARGET_MCU_GROUP) -D$(TARGET)
ifneq ($(HSE_VALUE),)
DEVICE_FLAGS := $(DEVICE_FLAGS) -DHSE_VALUE=$(HSE_VALUE)
@ -274,6 +274,7 @@ CLEAN_ARTIFACTS += $(TARGET_OBJS) $(TARGET_MAP)
include $(ROOT)/make/stamp.mk
include $(ROOT)/make/settings.mk
include $(ROOT)/make/svd.mk
# Make sure build date and revision is updated on every incremental build
$(TARGET_OBJ_DIR)/build/version.o : $(TARGET_SRC)

40381
dev/svd/STM32F303.svd
File diff suppressed because it is too large
View File

61681
dev/svd/STM32F405.svd
File diff suppressed because it is too large
View File

27110
dev/svd/STM32F411.svd
File diff suppressed because it is too large
View File

63121
dev/svd/STM32F427.svd
File diff suppressed because it is too large
View File

57155
dev/svd/STM32F446.svd
File diff suppressed because it is too large
View File

61861
dev/svd/STM32F7x2.svd
File diff suppressed because it is too large
View File

71136
dev/svd/STM32F7x5.svd
File diff suppressed because it is too large
View File

70681
dev/svd/STM32F7x6.svd
File diff suppressed because it is too large
View File

32
make/svd.mk

@ -0,0 +1,32 @@
SVDFILE := $(TARGET_OBJ_DIR)/svd.svd
CLEAN_ARTIFACTS += $(SVDFILE)
.PHONY: $(SVDFILE)
ifeq ($(TARGET_MCU),STM32F303)
SVD := STM32F303
else ifeq ($(TARGET_MCU),STM32F405)
SVD := STM32F405
else ifeq ($(TARGET_MCU),STM32F411)
SVD := STM32F411
else ifeq ($(TARGET_MCU),STM32F427)
SVD := STM32F427
else ifeq ($(TARGET_MCU),STM32F446)
SVD := STM32F446
else ifeq ($(TARGET_MCU),STM32F7X2RE)
SVD := STM32F7x2
else ifeq ($(TARGET_MCU),STM32F7X5XE)
SVD := STM32F7x5
else ifeq ($(TARGET_MCU),STM32F7X5XG)
SVD := STM32F7x5
else ifeq ($(TARGET_MCU),STM32F7X5XI)
SVD := STM32F7x5
else ifeq ($(TARGET_MCU),STM32F7X6XG)
SVD := STM32F7x6
endif
svd: .FORCE $(SVDFILE)
$(SVDFILE): $(ROOT)/dev/svd/$(SVD).svd
$(V1) mkdir -p $(dir $@)
$(V1) cat $< > $@

40
make/targets.mk

@ -26,18 +26,40 @@ ifeq ($(filter $(TARGET),$(VALID_TARGETS)),)
$(error Target '$(TARGET)' is not valid, must be one of $(VALID_TARGETS). Have you prepared a valid target.mk?)
endif
ifeq ($(filter $(TARGET),$(F1_TARGETS) $(F3_TARGETS) $(F4_TARGETS) $(F7_TARGETS)),)
$(error Target '$(TARGET)' has not specified a valid STM group, must be one of F1, F3, F405, F411, F427 or F7x. Have you prepared a valid target.mk?)
ifeq ($(filter $(TARGET),$(F3_TARGETS) $(F4_TARGETS) $(F7_TARGETS)),)
$(error Target '$(TARGET)' has not specified a valid STM group, must be one of F3, F405, F411, F427 or F7x. Have you prepared a valid target.mk?)
endif
ifeq ($(TARGET),$(filter $(TARGET),$(F3_TARGETS)))
TARGET_MCU := STM32F3
else ifeq ($(TARGET),$(filter $(TARGET), $(F4_TARGETS)))
TARGET_MCU := STM32F4
else ifeq ($(TARGET),$(filter $(TARGET), $(F7_TARGETS)))
TARGET_MCU := STM32F7
else ifeq ($(TARGET),$(filter $(TARGET), $(F1_TARGETS)))
TARGET_MCU := STM32F1
TARGET_MCU := STM32F303
TARGET_MCU_GROUP := STM32F3
else ifeq ($(TARGET),$(filter $(TARGET), $(F405_TARGETS)))
TARGET_MCU := STM32F405
TARGET_MCU_GROUP := STM32F4
else ifeq ($(TARGET),$(filter $(TARGET), $(F411_TARGETS)))
TARGET_MCU := STM32F411
TARGET_MCU_GROUP := STM32F4
else ifeq ($(TARGET),$(filter $(TARGET), $(F427_TARGETS)))
TARGET_MCU := STM32F427
TARGET_MCU_GROUP := STM32F4
else ifeq ($(TARGET),$(filter $(TARGET), $(F446_TARGETS)))
TARGET_MCU := STM32F446
TARGET_MCU_GROUP := STM32F4
else ifeq ($(TARGET),$(filter $(TARGET), $(F7X2RE_TARGETS)))
TARGET_MCU := STM32F7X2RE
TARGET_MCU_GROUP := STM32F7
else ifeq ($(TARGET),$(filter $(TARGET), $(F7X5XE_TARGETS)))
TARGET_MCU := STM32F7X5XE
TARGET_MCU_GROUP := STM32F7
else ifeq ($(TARGET),$(filter $(TARGET), $(F7X5XG_TARGETS)))
TARGET_MCU := STM32F7X5XG
TARGET_MCU_GROUP := STM32F7
else ifeq ($(TARGET),$(filter $(TARGET), $(F7X5XI_TARGETS)))
TARGET_MCU := STM32F7X5XI
TARGET_MCU_GROUP := STM32F7
else ifeq ($(TARGET),$(filter $(TARGET), $(F7X6XG_TARGETS)))
TARGET_MCU := STM32F7X6XG
TARGET_MCU_GROUP := STM32F7
else
$(error Unknown target MCU specified.)
endif

Loading…
Cancel
Save