Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PK5 ISP, dW, TPI, JTAG and theoretical PDI support #1935

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ set(SOURCES
pgm_type.c
pickit2.c
pickit2.h
pickit5_updi_lut.c
pickit5_lut_dw.c
pickit5_lut_isp.c
pickit5_lut_jtag.c
pickit5_lut_pdi.c
pickit5_lut_tpi.c
pickit5_lut_updi.c
pickit5_lut.h
pickit5.c
pickit5.h
Expand Down
7 changes: 6 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,12 @@ libavrdude_la_SOURCES = \
pgm_type.c \
pickit2.c \
pickit2.h \
pickit5_updi_lut.c \
pickit5_lut_dw.c \
pickit5_lut_isp.c \
pickit5_lut_jtag.c \
pickit5_lut_pdi.c \
pickit5_lut_tpi.c \
pickit5_lut_updi.c \
pickit5_lut.h \
pickit5.c \
pickit5.h \
Expand Down
8 changes: 4 additions & 4 deletions src/avrdude.1
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,12 @@ The Atmel DFU bootloader is supported in both, FLIP protocol version 1
(AT90USB* and ATmega*U* devices), as well as version 2 (Xmega devices).
See below for some hints about FLIP version 1 protocol behaviour.
.Pp
The MPLAB(R) PICkit 4 and MPLAB(R) SNAP, are supported in JTAG, TPI, ISP,
The MPLAB(R) PICkit 4/5 and MPLAB(R) SNAP, are supported in JTAG, TPI, ISP,
PDI and UPDI mode.
The Curiosity Nano board is supported in UPDI mode. It is dubbed
.Dq PICkit on Board ,
thus the name
.Pa pkobn_updi .
The MPLAB(R) PICkit 5 is currently only supported in UPDI mode.
.Pp
SerialUPDI programmer implementation is based on Microchip's
.Em pymcuprog Li https://github.com/microchip-pic-avr-tools/pymcuprog
Expand Down Expand Up @@ -1610,8 +1609,9 @@ Show help menu and exit.
Specify a voltage between 1.8 and 5.5 V that the programmer should supply
to the target. If there is already a valid voltage applied to the VTG Pin,
this setting will be ignored. When AVRDUDE detects an external voltage outside
of this range, it will terminate the operation. You can disable this by
setting the voltage to 0 V.
of this range, it will terminate the operation. You can disable this check by
setting the voltage to 0 V. If an XMEGA part was selected, a requested voltage
above 3.49 V will lead to an abort of operation.
.It Ar hvupdi
High-voltage UPDI programming is used to enable a UPDI pin that has previously
been set to RESET or GPIO mode. Use -x hvupdi to enable high-voltage UPDI
Expand Down
120 changes: 105 additions & 15 deletions src/avrdude.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -3058,30 +3058,60 @@ programmer # pickit4_tpi
# Microchip PICkit 5. For details, see
# https://www.microchip.com/en-us/development-tool/PG164150
#
# Currently -c pickit5 only supports UPDI programming
# The PICkit 5 supports the following programming modes
# using different programmer names:
#
# PIN UPDI
# > 1 !RST(*)
# 2 VCC
# 3 GND
# 4 UPDI(*)
# 5
# 6
# 7
# 8
# Interface: Programmer name:
# JTAG pickit5, pickit5_jtag
# PDI pickit5_pdi
# UPDI pickit5_updi
# debugWIRE pickit5_dw (can auto-switch to ISP to write fuses)
# ISP pickit5_isp
# TPI pickit5_tpi
#
# PIN JTAG PDI UPDI ISP/dW TPI UART(°)
# > 1 RST(*)
# 2 VCC VCC VCC VCC VCC VCC
# 3 GND GND GND GND GND GND
# 4 TDO DATA UPDI(*) SDI DATA
# 5 TCK SCK SCK
# 6 RST SCK RST/dW RST
# 7 TDI SDO TX (target)
# 8 TMS RX (target)
#
# Note: pickit5_dw does not support flash erase and must switch
# to ISP, thus requires all 6 Pins when modifing the flash
#
# (*): The PICkit5 can generate a High-Voltage (12V) Pulse on this pins
# to restore the UPDI Pin functionality, if it was changed through fuses.
# AVRDUDE automatically selects the correct pin, if the HV pulse is
# enabled through the '-x hvupdi' flag.
# to restore the UPDI Pin functionality, if it was changed through fuses.
# AVRDUDE automatically selects the correct pin, if the HV pulse is
# enabled through the '-x hvupdi' flag.
# (°): The PICkit5 can also be used as a USB to UART
# interface for simple serial debugging.

#------------------------------------------------------------
# pickit5 /pickit5_updi
# pickit5 /pickit5_jtag
#------------------------------------------------------------

programmer # pickit5_jtag
id = "pickit5", "pickit5_jtag";
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in JTAG Mode";
type = "pickit5_jtag";
prog_modes = PM_JTAG | PM_XMEGAJTAG;
extra_features = HAS_VTARG_READ;
connection_type = usb;
baudrate = 200000; # JTAG default clock
usbvid = 0x04d8;
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
;


#------------------------------------------------------------
# pickit5_updi
#------------------------------------------------------------
programmer # pickit5_updi
id = "pickit5_updi";
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC)";
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in UPDI Mode";
type = "pickit5_updi";
prog_modes = PM_UPDI;
extra_features = HAS_VTARG_READ;
Expand All @@ -3092,6 +3122,66 @@ programmer # pickit5_updi
hvupdi_support = 0, 1, 2;
;

#------------------------------------------------------------
# pickit5_isp
#------------------------------------------------------------
programmer # pickit5_isp
id = "pickit5_isp";
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in ISP Mode";
type = "pickit5_isp";
prog_modes = PM_ISP;
extra_features = HAS_VTARG_READ;
connection_type = usb;
baudrate = 125000; # ISP default clock
usbvid = 0x04d8;
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
;

#------------------------------------------------------------
# pickit5_dw
#------------------------------------------------------------
programmer # pickit5_dw
id = "pickit5_dw";
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in dW Mode";
type = "pickit5_dw";
prog_modes = PM_debugWIRE;
extra_features = HAS_VTARG_READ;
connection_type = usb;
baudrate = 200000; # dW default clock
usbvid = 0x04d8;
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
;

#------------------------------------------------------------
# pickit5_tpi
#------------------------------------------------------------
programmer # pickit5_tpi
id = "pickit5_tpi";
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in TPI Mode";
type = "pickit5_tpi";
prog_modes = PM_TPI;
extra_features = HAS_VTARG_READ;
connection_type = usb;
baudrate = 125000; # TPI default clock
usbvid = 0x04d8;
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
;

#------------------------------------------------------------
# pickit5_pdi
#------------------------------------------------------------
programmer # pickit5_tpi
id = "pickit5_pdi";
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode";
type = "pickit5_pdi";
prog_modes = PM_PDI;
extra_features = HAS_VTARG_READ;
connection_type = usb;
baudrate = 125000; # PDI default clock
usbvid = 0x04d8;
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
;

#------------------------------------------------------------
# snap /snap_jtag
#------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions src/doc/avrdude.texi
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,10 @@ See below for some hints about FLIP version 1 protocol behaviour.
@cindex PICkit 4
@cindex PICkit 5
@cindex SNAP
The MPLAB(R) PICkit 4 and MPLAB(R) SNAP are supported in JTAG, TPI, ISP, PDI and UPDI mode.
The MPLAB(R) PICkit 4/5 and MPLAB(R) SNAP are supported in JTAG, TPI, ISP, PDI and UPDI mode.
@cindex Curiosity nano
The Curiosity Nano board is supported in UPDI mode. It is dubbed ``PICkit on
Board'', thus the name @code{pkobn_updi}.
The MPLAB(R) PICkit 5 is currently only supported in UPDI mode.

@cindex SerialUPDI
SerialUPDI programmer implementation is based on Microchip's
Expand Down Expand Up @@ -1338,8 +1337,9 @@ The PICkit 5 and PICkit 4 (PIC Mode) programmer can accept following extended pa
Specify a voltage between 1.8 and 5.5@w{ }V that the programmer should supply
to the target. If there is already a valid voltage applied to the VTG Pin,
this setting will be ignored. When AVRDUDE detects an external voltage outside
of this range, it will terminate the operation. You can disable this by
setting the voltage to 0@w{ }V.
of this range, it will terminate the operation. You can disable this check by
setting the voltage to 0@w{ }V. If an XMEGA part was selected, a requested voltage
above 3.49@w{ }V will lead to an abort of operation.
@item hvupdi
High-voltage UPDI programming is used to enable a UPDI pin that has previously
been set to RESET or GPIO mode. Use @code{-x hvupdi} to enable high-voltage UPDI
Expand Down
5 changes: 5 additions & 0 deletions src/pgm_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ const PROGRAMMER_TYPE programmers_types[] = { // Name(s) the programmers call
{"micronucleus", micronucleus_initpgm, micronucleus_desc}, // "micronucleus" or "Micronucleus V2.0"
{"par", par_initpgm, par_desc}, // "PPI"
{"pickit2", pickit2_initpgm, pickit2_desc}, // "pickit2"
{"pickit5_dw", pickit5_initpgm, pickit5_desc}, // "pickit5"
{"pickit5_isp", pickit5_initpgm, pickit5_desc}, // "pickit5"
{"pickit5_jtag", pickit5_initpgm, pickit5_desc}, // "pickit5"
{"pickit5_pdi", pickit5_initpgm, pickit5_desc}, // "pickit5"
{"pickit5_tpi", pickit5_initpgm, pickit5_desc}, // "pickit5"
{"pickit5_updi", pickit5_initpgm, pickit5_desc}, // "pickit5"
{"serbb", serbb_initpgm, serbb_desc}, // "SERBB"
{"serialupdi", serialupdi_initpgm, serialupdi_desc}, // "serialupdi"
Expand Down
Loading
Loading