diff options
-rw-r--r-- | Makefile.common | 10 | ||||
-rw-r--r-- | Makefile.template | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/Makefile.common b/Makefile.common index ba9fcef..dd43c8f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -158,6 +158,9 @@ q \n\ erase_all: $(OUTPUT_BINARY_DIRECTORY)/erase_all.jlink
$(JLINK) -CommanderScript $(OUTPUT_BINARY_DIRECTORY)/erase_all.jlink; [ "$$?" -eq 1 ]
+$(OUTPUT_BINARY_DIRECTORY)/softdevice.bin: $(BUILD_DIRECTORIES)
+ $(OBJCOPY) -I ihex -O binary $(SOFTDEVICE_HEX_PATH) $(OUTPUT_BINARY_DIRECTORY)/softdevice.bin
+
$(OUTPUT_BINARY_DIRECTORY)/flash_softdevice.jlink: $(BUILD_DIRECTORIES)
echo " \n\
r \n\
@@ -171,13 +174,14 @@ w4 0x10001000, 0x14000 # write code region size \n\ sleep 1000 \n\
w4 0x4001e504,1 \n\
sleep 1000 \n\
-loadbin \"$(SOFTDEVICE_BIN_PATH)\", 0x0 \n\
-sleep 15000 \n\
+loadbin \"$(OUTPUT_BINARY_DIRECTORY)/softdevice.bin\", 0x0 \n\
+verifybin \"$(OUTPUT_BINARY_DIRECTORY)/softdevice.bin\", 0x0 \n\
r \n\
qc \n\
" > $(OUTPUT_BINARY_DIRECTORY)/flash_softdevice.jlink
-flash_softdevice: $(OUTPUT_BINARY_DIRECTORY)/flash_softdevice.jlink
+
+flash_softdevice: $(OUTPUT_BINARY_DIRECTORY)/flash_softdevice.jlink $(OUTPUT_BINARY_DIRECTORY)/softdevice.bin
$(JLINK) -CommanderScript $(OUTPUT_BINARY_DIRECTORY)/flash_softdevice.jlink; [ "$$?" -eq 1 ]
$(OUTPUT_BINARY_DIRECTORY)/flash.jlink: $(BUILD_DIRECTORIES) $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin
diff --git a/Makefile.template b/Makefile.template index 32bb590..97c9c29 100644 --- a/Makefile.template +++ b/Makefile.template @@ -5,12 +5,12 @@ BOARD := BOARD_PCA10001 DEVICE_VARIANT := xxaa
#DEVICE_VARIANT := xxab
-USE_SOFTDEVICE := s110
-#USE_SOFTDEVICE := s210
+USE_SOFTDEVICE := S110
+#USE_SOFTDEVICE := S210
HOME = /Users/hongbo.yang/
SDK_PATH = $(HOME)Developer/prjs/embeded/nrf/nrf51_sdk_v6_0_0_43681/nrf51822/
-SOFTDEVICE_BIN_PATH = $(HOME)Developer/prjs/embeded/nrf/s110_nrf51822_7.0.0/s110_nrf51822_7.0.0_softdevice.hex
+SOFTDEVICE_HEX_PATH = $(HOME)Developer/prjs/embeded/nrf/s110_nrf51822_7.0.0/s110_nrf51822_7.0.0_softdevice.hex
BUILD_SCRIPTS_PATH = $(HOME)Developer/prjs/embeded/prjs/nrf51822/build_scripts/
TEMPLATE_PATH = $(BUILD_SCRIPTS_PATH)
|