Skip to content

Commit 0771b7f

Browse files
authored
Merge pull request #1935 from MX682X/8.1.0---isp
PICKit5 ISP, dW, TPI, JTAG and PDI support
2 parents 648608d + f2f2ac4 commit 0771b7f

16 files changed

+13816
-2099
lines changed

src/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,12 @@ set(SOURCES
229229
pgm_type.c
230230
pickit2.c
231231
pickit2.h
232-
pickit5_updi_lut.c
232+
pickit5_lut_dw.c
233+
pickit5_lut_isp.c
234+
pickit5_lut_jtag.c
235+
pickit5_lut_pdi.c
236+
pickit5_lut_tpi.c
237+
pickit5_lut_updi.c
233238
pickit5_lut.h
234239
pickit5.c
235240
pickit5.h

src/Makefile.am

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,12 @@ libavrdude_la_SOURCES = \
156156
pgm_type.c \
157157
pickit2.c \
158158
pickit2.h \
159-
pickit5_updi_lut.c \
159+
pickit5_lut_dw.c \
160+
pickit5_lut_isp.c \
161+
pickit5_lut_jtag.c \
162+
pickit5_lut_pdi.c \
163+
pickit5_lut_tpi.c \
164+
pickit5_lut_updi.c \
160165
pickit5_lut.h \
161166
pickit5.c \
162167
pickit5.h \

src/avrdude.1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,12 @@ The Atmel DFU bootloader is supported in both, FLIP protocol version 1
239239
(AT90USB* and ATmega*U* devices), as well as version 2 (Xmega devices).
240240
See below for some hints about FLIP version 1 protocol behaviour.
241241
.Pp
242-
The MPLAB(R) PICkit 4 and MPLAB(R) SNAP, are supported in JTAG, TPI, ISP,
242+
The MPLAB(R) PICkit 4/5 and MPLAB(R) SNAP, are supported in JTAG, TPI, ISP,
243243
PDI and UPDI mode.
244244
The Curiosity Nano board is supported in UPDI mode. It is dubbed
245245
.Dq PICkit on Board ,
246246
thus the name
247247
.Pa pkobn_updi .
248-
The MPLAB(R) PICkit 5 is currently only supported in UPDI mode.
249248
.Pp
250249
SerialUPDI programmer implementation is based on Microchip's
251250
.Em pymcuprog Li https://github.com/microchip-pic-avr-tools/pymcuprog
@@ -1610,8 +1609,9 @@ Show help menu and exit.
16101609
Specify a voltage between 1.8 and 5.5 V that the programmer should supply
16111610
to the target. If there is already a valid voltage applied to the VTG Pin,
16121611
this setting will be ignored. When AVRDUDE detects an external voltage outside
1613-
of this range, it will terminate the operation. You can disable this by
1614-
setting the voltage to 0 V.
1612+
of this range, it will terminate the operation. You can disable this check by
1613+
setting the voltage to 0 V. If an XMEGA part was selected, a requested voltage
1614+
above 3.49 V will lead to an abort of operation.
16151615
.It Ar hvupdi
16161616
High-voltage UPDI programming is used to enable a UPDI pin that has previously
16171617
been set to RESET or GPIO mode. Use -x hvupdi to enable high-voltage UPDI

src/avrdude.conf.in

Lines changed: 100 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,40 +3058,124 @@ programmer # pickit4_tpi
30583058
# Microchip PICkit 5. For details, see
30593059
# https://www.microchip.com/en-us/development-tool/PG164150
30603060
#
3061-
# Currently -c pickit5 only supports UPDI programming
3061+
# The PICkit 5 supports the following programming modes
3062+
# using different programmer names:
30623063
#
3063-
# PIN UPDI
3064-
# > 1 !RST(*)
3065-
# 2 VCC
3066-
# 3 GND
3067-
# 4 UPDI(*)
3068-
# 5
3069-
# 6
3070-
# 7
3071-
# 8
3064+
# Interface: Programmer name:
3065+
# JTAG pickit5, pickit5_jtag
3066+
# PDI pickit5_pdi
3067+
# UPDI pickit5_updi
3068+
# debugWIRE pickit5_dw (can auto-switch to ISP to write fuses)
3069+
# ISP pickit5_isp
3070+
# TPI pickit5_tpi
3071+
#
3072+
# PIN JTAG PDI UPDI ISP/dW TPI UART(°)
3073+
# > 1 RST(*)
3074+
# 2 VCC VCC VCC VCC VCC VCC
3075+
# 3 GND GND GND GND GND GND
3076+
# 4 TDO DATA UPDI(*) SDI DATA
3077+
# 5 TCK SCK SCK
3078+
# 6 RST SCK RST/dW RST
3079+
# 7 TDI SDO TX (target)
3080+
# 8 TMS RX (target)
3081+
#
3082+
# Note: pickit5_dw does not support flash erase and must switch
3083+
# to ISP, thus requires all 6 Pins when modifing the flash
30723084
#
30733085
# (*): The PICkit5 can generate a High-Voltage (12V) Pulse on this pins
3074-
# to restore the UPDI Pin functionality, if it was changed through fuses.
3075-
# AVRDUDE automatically selects the correct pin, if the HV pulse is
3076-
# enabled through the '-x hvupdi' flag.
3086+
# to restore the UPDI Pin functionality, if it was changed through fuses.
3087+
# AVRDUDE automatically selects the correct pin, if the HV pulse is
3088+
# enabled through the '-x hvupdi' flag.
3089+
# (°): The PICkit5 can also be used as a USB to UART
3090+
# interface for simple serial debugging.
30773091

30783092
#------------------------------------------------------------
3079-
# pickit5 /pickit5_updi
3093+
# pickit5 /pickit5_jtag
30803094
#------------------------------------------------------------
30813095

3096+
programmer # pickit5_jtag
3097+
id = "pickit5", "pickit5_jtag";
3098+
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in JTAG Mode";
3099+
type = "pickit5_jtag";
3100+
prog_modes = PM_JTAG | PM_XMEGAJTAG;
3101+
extra_features = HAS_VTARG_READ;
3102+
connection_type = usb;
3103+
usbvid = 0x04d8;
3104+
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
3105+
;
3106+
3107+
3108+
#------------------------------------------------------------
3109+
# pickit5_updi
3110+
#------------------------------------------------------------
30823111
programmer # pickit5_updi
30833112
id = "pickit5_updi";
3084-
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC)";
3113+
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in UPDI Mode";
30853114
type = "pickit5_updi";
30863115
prog_modes = PM_UPDI;
30873116
extra_features = HAS_VTARG_READ;
30883117
connection_type = usb;
3089-
baudrate = 200000; # UPDI default clock
30903118
usbvid = 0x04d8;
30913119
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
30923120
hvupdi_support = 0, 1, 2;
30933121
;
30943122

3123+
#------------------------------------------------------------
3124+
# pickit5_isp
3125+
#------------------------------------------------------------
3126+
programmer # pickit5_isp
3127+
id = "pickit5_isp";
3128+
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in ISP Mode";
3129+
type = "pickit5_isp";
3130+
prog_modes = PM_ISP;
3131+
extra_features = HAS_VTARG_READ;
3132+
connection_type = usb;
3133+
usbvid = 0x04d8;
3134+
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
3135+
;
3136+
3137+
#------------------------------------------------------------
3138+
# pickit5_dw
3139+
#------------------------------------------------------------
3140+
programmer # pickit5_dw
3141+
id = "pickit5_dw";
3142+
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in dW Mode";
3143+
type = "pickit5_dw";
3144+
prog_modes = PM_debugWIRE;
3145+
extra_features = HAS_VTARG_READ;
3146+
connection_type = usb;
3147+
usbvid = 0x04d8;
3148+
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
3149+
;
3150+
3151+
#------------------------------------------------------------
3152+
# pickit5_tpi
3153+
#------------------------------------------------------------
3154+
programmer # pickit5_tpi
3155+
id = "pickit5_tpi";
3156+
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in TPI Mode";
3157+
type = "pickit5_tpi";
3158+
prog_modes = PM_TPI;
3159+
extra_features = HAS_VTARG_READ;
3160+
connection_type = usb;
3161+
usbvid = 0x04d8;
3162+
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
3163+
;
3164+
3165+
#------------------------------------------------------------
3166+
# pickit5_pdi
3167+
#------------------------------------------------------------
3168+
programmer # pickit5_tpi
3169+
id = "pickit5_pdi";
3170+
desc = "MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode";
3171+
type = "pickit5_pdi";
3172+
prog_modes = PM_PDI;
3173+
extra_features = HAS_VTARG_READ;
3174+
connection_type = usb;
3175+
usbvid = 0x04d8;
3176+
usbpid = 0x9036, 0x9012, 0x9018; # PK5, PK4 (pic mode), snap (pic mode)
3177+
;
3178+
30953179
#------------------------------------------------------------
30963180
# snap /snap_jtag
30973181
#------------------------------------------------------------

src/doc/avrdude.texi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,10 @@ See below for some hints about FLIP version 1 protocol behaviour.
400400
@cindex PICkit 4
401401
@cindex PICkit 5
402402
@cindex SNAP
403-
The MPLAB(R) PICkit 4 and MPLAB(R) SNAP are supported in JTAG, TPI, ISP, PDI and UPDI mode.
403+
The MPLAB(R) PICkit 4/5 and MPLAB(R) SNAP are supported in JTAG, TPI, ISP, PDI and UPDI mode.
404404
@cindex Curiosity nano
405405
The Curiosity Nano board is supported in UPDI mode. It is dubbed ``PICkit on
406406
Board'', thus the name @code{pkobn_updi}.
407-
The MPLAB(R) PICkit 5 is currently only supported in UPDI mode.
408407

409408
@cindex SerialUPDI
410409
SerialUPDI programmer implementation is based on Microchip's
@@ -1338,8 +1337,9 @@ The PICkit 5 and PICkit 4 (PIC Mode) programmer can accept following extended pa
13381337
Specify a voltage between 1.8 and 5.5@w{ }V that the programmer should supply
13391338
to the target. If there is already a valid voltage applied to the VTG Pin,
13401339
this setting will be ignored. When AVRDUDE detects an external voltage outside
1341-
of this range, it will terminate the operation. You can disable this by
1342-
setting the voltage to 0@w{ }V.
1340+
of this range, it will terminate the operation. You can disable this check by
1341+
setting the voltage to 0@w{ }V. If an XMEGA part was selected, a requested voltage
1342+
above 3.49@w{ }V will lead to an abort of operation.
13431343
@item hvupdi
13441344
High-voltage UPDI programming is used to enable a UPDI pin that has previously
13451345
been set to RESET or GPIO mode. Use @code{-x hvupdi} to enable high-voltage UPDI

src/pgm_type.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ const PROGRAMMER_TYPE programmers_types[] = { // Name(s) the programmers call
9797
{"micronucleus", micronucleus_initpgm, micronucleus_desc}, // "micronucleus" or "Micronucleus V2.0"
9898
{"par", par_initpgm, par_desc}, // "PPI"
9999
{"pickit2", pickit2_initpgm, pickit2_desc}, // "pickit2"
100+
{"pickit5_dw", pickit5_initpgm, pickit5_desc}, // "pickit5"
101+
{"pickit5_isp", pickit5_initpgm, pickit5_desc}, // "pickit5"
102+
{"pickit5_jtag", pickit5_initpgm, pickit5_desc}, // "pickit5"
103+
{"pickit5_pdi", pickit5_initpgm, pickit5_desc}, // "pickit5"
104+
{"pickit5_tpi", pickit5_initpgm, pickit5_desc}, // "pickit5"
100105
{"pickit5_updi", pickit5_initpgm, pickit5_desc}, // "pickit5"
101106
{"serbb", serbb_initpgm, serbb_desc}, // "SERBB"
102107
{"serialupdi", serialupdi_initpgm, serialupdi_desc}, // "serialupdi"

0 commit comments

Comments
 (0)