From 07bb9d8b75edb3add5939879706f2d031621da5e Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 14 Apr 2014 12:33:22 +0200 Subject: [PATCH 1/3] Support the Atmel STK500 development board for ISP --- hardware/arduino/avr/programmers.txt | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/hardware/arduino/avr/programmers.txt b/hardware/arduino/avr/programmers.txt index 0c38151b047..2836a404c43 100644 --- a/hardware/arduino/avr/programmers.txt +++ b/hardware/arduino/avr/programmers.txt @@ -51,18 +51,6 @@ usbGemma.program.tool=avrdude usbGemma.program.extra_params= usbGemma.config.path={runtime.platform.path}/bootloaders/gemma/avrdude.conf -# STK500 firmware version v1 and v2 use different serial protocols. -# Using the 'stk500' protocol tells avrdude to try and autodetect the -# firmware version. If this leads to problems, we might need to add -# stk500v1 and stk500v2 entries to allow explicitely selecting the -# firmware version. -stk500.name=Atmel STK500 development board -stk500.communication=serial -stk500.protocol=stk500 -stk500.program.protocol=stk500 -stk500.program.tool=avrdude -stk500.program.extra_params=-P{serial.port} - ## Notes about Dangerous Prototypes Bus Pirate as ISP ## Bus Pirate V3 need Firmware v5.10 or later ## Bus Pirate V4 need Firmware v6.3-r2151 or later @@ -76,3 +64,14 @@ buspirate.program.protocol=buspirate buspirate.program.tool=avrdude buspirate.program.extra_params=-P{serial.port} +# STK500 firmware version v1 and v2 use different serial protocols. +# Using the 'stk500' protocol tells avrdude to try and autodetect the +# firmware version. If this leads to problems, we might need to add +# stk500v1 and stk500v2 entries to allow explicitely selecting the +# firmware version. +stk500.name=Atmel STK500 development board +stk500.communication=serial +stk500.protocol=stk500 +stk500.program.protocol=stk500 +stk500.program.tool=avrdude +stk500.program.extra_params=-P{serial.port} From 75017fd96d14d4fdb1ea51b05131d2e35b232731 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 2 May 2014 12:01:53 +0200 Subject: [PATCH 2/3] Add support for the JTAGICE3 programmer This adds the configuration needed to support JTAGICE3. Note that burning a bootloader doesn't work yet, due to bugs in avrdude. Uploading sketches works as expected. --- hardware/arduino/avr/programmers.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/hardware/arduino/avr/programmers.txt b/hardware/arduino/avr/programmers.txt index 2836a404c43..be28e408e63 100644 --- a/hardware/arduino/avr/programmers.txt +++ b/hardware/arduino/avr/programmers.txt @@ -75,3 +75,31 @@ stk500.protocol=stk500 stk500.program.protocol=stk500 stk500.program.tool=avrdude stk500.program.extra_params=-P{serial.port} + +# Note that until https://savannah.nongnu.org/bugs/?21954 and +# https://savannah.nongnu.org/bugs/?42267 are fixed, burning a +# bootloader does not work. +# As a workaround, you can add -V to disable verification and modify +# boards.txt to set all unused lock bits to 1 instead of 0. +jtag3isp.name=Atmel JTAGICE3 (ISP mode) +jtag3isp.communication=usb +jtag3isp.protocol=jtag3isp +jtag3isp.program.protocol=jtag3isp +jtag3isp.program.tool=avrdude +# Set a bitclock of 1us (the fastest supported value). This works for +# microcontrollers running at 4Mhz and above. +jtag3isp.program.extra_params=-B1 + +# Note that until https://savannah.nongnu.org/bugs/?21954 is fixed, +# burning a bootloader does not work. +# As a workaround, you can modify boards.txt to set all unused lock bits +# to 1 instead of 0. +jtag3.name=Atmel JTAGICE3 (JTAG mode) +jtag3.communication=usb +jtag3.protocol=jtag3 +jtag3.program.protocol=jtag3 +jtag3.program.tool=avrdude +# Set a bitclock of 0.1us (the fastest supported value). This should +# work regardless of the crystal used, since JTAG doesn't use the MCU +# clock but dictates its own clock. +jtag3.program.extra_params=-B0.1 From 29ad5704121d5d0b9e1cd2f09792a28e59f02648 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 21 Apr 2015 12:27:20 +0200 Subject: [PATCH 3/3] Add slow mode for the JTAG3 ISP programmer This uses a slower bitclock, allowing programming of parts < 4Mhz (like fresh 328 MCU's, which run at 1Mhz by default). For the JTAG version, this is not needed, since the JTAG clock completely drives the chip, regardless of the configured CPU clock. --- hardware/arduino/avr/programmers.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hardware/arduino/avr/programmers.txt b/hardware/arduino/avr/programmers.txt index be28e408e63..85661c495fb 100644 --- a/hardware/arduino/avr/programmers.txt +++ b/hardware/arduino/avr/programmers.txt @@ -81,7 +81,7 @@ stk500.program.extra_params=-P{serial.port} # bootloader does not work. # As a workaround, you can add -V to disable verification and modify # boards.txt to set all unused lock bits to 1 instead of 0. -jtag3isp.name=Atmel JTAGICE3 (ISP mode) +jtag3isp.name=Atmel JTAGICE3 (ISP mode, for chips at or above 4Mhz) jtag3isp.communication=usb jtag3isp.protocol=jtag3isp jtag3isp.program.protocol=jtag3isp @@ -90,6 +90,20 @@ jtag3isp.program.tool=avrdude # microcontrollers running at 4Mhz and above. jtag3isp.program.extra_params=-B1 +# Note that until https://savannah.nongnu.org/bugs/?21954 and +# https://savannah.nongnu.org/bugs/?42267 are fixed, burning a +# bootloader does not work. +# As a workaround, you can add -V to disable verification and modify +# boards.txt to set all unused lock bits to 1 instead of 0. +jtag3ispslow.name=Atmel JTAGICE3 (ISP mode, for chips below 4Mhz) +jtag3ispslow.communication=usb +jtag3ispslow.protocol=jtag3isp +jtag3ispslow.program.protocol=jtag3isp +jtag3ispslow.program.tool=avrdude +# Set a bitclock of 125us (the slowest supported value). This works for +# microcontrollers running at 8kHz and above. +jtag3ispslow.program.extra_params=-B125 + # Note that until https://savannah.nongnu.org/bugs/?21954 is fixed, # burning a bootloader does not work. # As a workaround, you can modify boards.txt to set all unused lock bits