summaryrefslogtreecommitdiffstats
path: root/orig_firmware/Makefile
blob: 257bf5669f88dc3297e6f708ea5f2aca5e01760f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
SD=sd.hex
APP=app.hex
BL=bl.hex
UICR=uicr.hex

OOCD=openocd
OOCD_CFG=openocd.cfg


flash: ${SD} ${APP} ${BL} ${UICR}
	${OOCD} -f ${OOCD_CFG} \
		-c "init" -c "reset init" \
		-c "nrf51 mass_erase"  \
		-c "flash write_image ${SD}" \
		-c "flash write_image ${APP}" \
		-c "flash write_image ${BL}" \
		-c "flash write_image ${UICR}" \
		-c "reset" \
		-c "shutdown"


reset:
	${OOCD} -f ${OOCD_CFG} \
		-c "init" \
		-c "reset init" \
		-c "reset" \
		-c "shutdown"

#%.zip: %.hex
#	${NRFUTIL} dfu genpkg  --dev-revision ${DEV_REVISION} --dev-type ${DEV_TYPE} --application-version ${APP_VERSION} --sd-req ${SD_REQ} --bootloader $<  $@
#
#dfu: ${PROG}.zip
#	${NRFDFU} -b ${BDADDR} -p ${PROG}.zip








#flash: $(MAKECMDGOALS)
#	@echo Flashing: $(OUTPUT_BINARY_DIRECTORY)/$<.hex
#	nrfjprog --reset --program $(OUTPUT_BINARY_DIRECTORY)/$<.hex
#
### Flash softdevice
#flash_softdevice: 
#	@echo Flashing: s130_softdevice.hex
#	nrfjprog --reset --program softdevice/s130/hex/s130_softdevice.hex