@@ -74,11 +74,17 @@ flash.stlinkv2:
74
74
$(MAKE_BUILD_FOLDER)
75
75
$(OPENOCD) -c 'program $(HEX) verify reset exit'
76
76
77
- test-softdevice: test-softdevice.jlink
78
77
ifndef SOFTDEVICE
78
+ define softdevice-defined=
79
79
$(error "You need to set the SOFTDEVICE command-line parameter to a path (without spaces) to the softdevice hex-file")
80
+ endef
81
+ else
82
+ define softdevice-defined=
83
+ endef
80
84
endif
81
85
86
+ test-softdevice: test-softdevice.jlink $(softdevice-defined)
87
+
82
88
ifneq ($(SOFTDEVICE_MODEL),blank)
83
89
$(MAKE_BUILD_FOLDER)
84
90
@touch $(SOFTDEVICE_TEST_FLASH)
@@ -98,12 +104,9 @@ test-softdevice.jlink:
98
104
printf "r\nsavebin $(SOFTDEVICE_TEST_FLASH) $(SOFTDEVICE_TEST_ADDR) $(SOFTDEVICE_TEST_LEN)\nexit\n" > $(OUTPUT_PATH)test-softdevice.jlink
99
105
100
106
ifeq ($(PROGRAMMER),stlinkv2)
101
- flash-softdevice: erase-all flash-softdevice.stlinkv2
107
+ flash-softdevice: erase-all $(softdevice-defined) flash-softdevice.stlinkv2
102
108
else
103
- flash-softdevice: erase-all flash-softdevice.jlink
104
- ifndef SOFTDEVICE
105
- $(error "You need to set the SOFTDEVICE command-line parameter to a path (without spaces) to the softdevice hex-file")
106
- endif
109
+ flash-softdevice: erase-all $(softdevice-defined) flash-softdevice.jlink
107
110
$(MAKE_BUILD_FOLDER)
108
111
$(OBJCOPY) -Iihex -Obinary $(SOFTDEVICE) $(SOFTDEVICE_OUTPUT:.hex=.bin)
109
112
$(JLINK) $(OUTPUT_PATH)flash-softdevice.jlink
@@ -115,9 +118,6 @@ flash-softdevice.jlink:
115
118
printf "w4 4001e504 1\nloadbin \"$(SOFTDEVICE_OUTPUT:.hex=.bin)\" 0\nr\ng\nexit\n" > $(OUTPUT_PATH)flash-softdevice.jlink
116
119
117
120
flash-softdevice.stlinkv2:
118
- ifndef SOFTDEVICE
119
- $(error "You need to set the SOFTDEVICE command-line parameter to a path (without spaces) to the softdevice hex-file")
120
- endif
121
121
$(MAKE_BUILD_FOLDER)
122
122
$(OPENOCD) -c 'program $(SOFTDEVICE) verify reset exit'
123
123
0 commit comments