From 39fb3cb9f05cb24f1782bbe74b9cf496aa20dfa3 Mon Sep 17 00:00:00 2001 From: Francois Berder <18538310+francois-berder@users.noreply.github.com> Date: Tue, 17 Sep 2019 20:35:54 +0100 Subject: [PATCH] boards: pic32-wifire: Add support for JLink programmer Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com> --- boards/pic32-wifire/Makefile.include | 32 +++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/boards/pic32-wifire/Makefile.include b/boards/pic32-wifire/Makefile.include index 18816b5614..e38574d868 100644 --- a/boards/pic32-wifire/Makefile.include +++ b/boards/pic32-wifire/Makefile.include @@ -1,16 +1,28 @@ +export CPU = mips_pic32mz +export CPU_MODEL=p32mz2048efg100 export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S export USE_UHI_SYSCALLS = 1 PORT_LINUX ?= /dev/ttyUSB0 include $(RIOTMAKE)/tools/serial.inc.mk -# pic32prog -# -# For PICkit3: -# -# * Connect the chipKIT-Wi-Fire to USB -# * Connect the PICkit3 to ICSP holes -# * https://docs.creatordev.io/wifire/guides/wifire-programming/ -# * The triangle `▶` goes into the port number 1 (a hole with a square around it) -# opposite side of the JP1 ICSP text. -include $(RIOTMAKE)/tools/pic32prog.inc.mk +# use pic32prog by default to program this board +PROGRAMMER ?= pic32prog + +ifeq ($(PROGRAMMER),pic32prog) + # pic32prog + # + # For PICkit3: + # + # * Connect the chipKIT-Wi-Fire to USB + # * Connect the PICkit3 to ICSP holes + # * https://docs.creatordev.io/wifire/guides/wifire-programming/ + # * The triangle `▶` goes into the port number 1 (a hole with a square around it) + # opposite side of the JP1 ICSP text. + include $(RIOTMAKE)/tools/pic32prog.inc.mk +else ifeq ($(PROGRAMMER),jlink) + FLASHFILE ?= $(HEXFILE) + export JLINK_DEVICE := PIC32MZ2048EFG100 + export JLINK_IF := JTAG + include $(RIOTMAKE)/tools/jlink.inc.mk +endif