mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #9259 from cladmi/pr/pic32/flasher
pic32-wifire: add support for flashing with pic32prog
This commit is contained in:
commit
50ba48eea6
@ -1,4 +1,17 @@
|
||||
export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S
|
||||
export USE_UHI_SYSCALLS = 1
|
||||
|
||||
FLASHFILE ?= $(HEXFILE)
|
||||
PORT_LINUX ?= /dev/ttyUSB0
|
||||
BAUD ?= 9600
|
||||
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
|
||||
|
2
dist/tools/pic32prog/.gitignore
vendored
Normal file
2
dist/tools/pic32prog/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
pic32prog
|
||||
bin/
|
19
dist/tools/pic32prog/Makefile
vendored
Normal file
19
dist/tools/pic32prog/Makefile
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
PKG_NAME = pic32prog
|
||||
PKG_URL = https://github.com/sergev/pic32prog
|
||||
PKG_VERSION = b9f8db3b352804392b02b42475fc42874ac8bf04
|
||||
PKG_LICENSE = GPL-2
|
||||
PKG_BUILDDIR = bin
|
||||
|
||||
# Building it requires some dependencies, on ubuntu:
|
||||
#
|
||||
# sudo apt-get install libusb-dev libusb-1.0-0-dev libudev-dev
|
||||
|
||||
all: git-download
|
||||
@echo "[INFO] compiling pic32prog from source now"
|
||||
@env -i PATH=$(PATH) TERM=$(TERM) make -C $(PKG_BUILDDIR)
|
||||
@mv $(PKG_BUILDDIR)/pic32prog pic32prog
|
||||
|
||||
distclean::
|
||||
@rm -f pic32prog
|
||||
|
||||
include $(RIOTBASE)/pkg/pkg.mk
|
46
makefiles/tools/pic32prog.inc.mk
Normal file
46
makefiles/tools/pic32prog.inc.mk
Normal file
@ -0,0 +1,46 @@
|
||||
# pic32prog flasher
|
||||
# =================
|
||||
#
|
||||
# https://github.com/sergev/pic32prog
|
||||
#
|
||||
# Allow flashing pic32 boards using:
|
||||
# * Microchip PICkit2
|
||||
# * Microchip PICkit3 with script firmware
|
||||
#
|
||||
#
|
||||
# PICkit-3
|
||||
# --------
|
||||
#
|
||||
# This requires changing the firmware to 'scripting mode'
|
||||
# Should be done from a Windows computer/virtual machine as described here
|
||||
#
|
||||
# https://github.com/RIOT-OS/RIOT/blob/master/dist/tools/pic32prog/doc.md
|
||||
#
|
||||
#
|
||||
# Udev rule
|
||||
# ---------
|
||||
#
|
||||
# Add yourself to the `plugdev` group, add the following `udev` rule to
|
||||
# `/etc/udev/rules.d/26-microchip.rules` and reboot.
|
||||
#
|
||||
# ```
|
||||
# # Adapted from http://en.microstickplus.com/mplabx-on-linux
|
||||
# ATTR{idVendor}=="04d8", MODE="664", GROUP="plugdev"
|
||||
# ```
|
||||
|
||||
RIOT_PIC32PROG = $(RIOTTOOLS)/pic32prog/pic32prog
|
||||
PIC32PROG ?= $(RIOT_PIC32PROG)
|
||||
|
||||
FLASHFILE ?= $(HEXFILE)
|
||||
|
||||
FLASHER ?= $(PIC32PROG)
|
||||
FFLAGS ?= $(FLASHFILE)
|
||||
|
||||
# No reset command, but the board resets on terminal open
|
||||
RESET ?=
|
||||
RESET_FLAGS ?=
|
||||
|
||||
# Compile pic32prog if using the one provided in RIOT
|
||||
ifeq ($(PIC32PROG),$(RIOT_PIC32PROG))
|
||||
FLASHDEPS += $(RIOT_PIC32PROG)
|
||||
endif
|
@ -12,6 +12,11 @@ $(RIOTTOOLS)/bossa/bossac:
|
||||
@make -C $(RIOTTOOLS)/bossa
|
||||
@echo "[INFO] bossac binary successfully build!"
|
||||
|
||||
$(RIOTTOOLS)/pic32prog/pic32prog: $(RIOTTOOLS)/pic32prog/Makefile
|
||||
@echo "[INFO] $(@F) binary not found - building it from source now"
|
||||
make -C $(@D)
|
||||
@echo "[INFO] $(@F) binary successfully build!"
|
||||
|
||||
$(RIOTTOOLS)/edbg/edbg: $(RIOTTOOLS)/edbg/Makefile
|
||||
@echo "[INFO] edbg binary not found - building it from source now"
|
||||
CC= CFLAGS= make -C $(RIOTTOOLS)/edbg
|
||||
|
Loading…
Reference in New Issue
Block a user