aboutsummaryrefslogtreecommitdiff
path: root/docs/isp_flashing_guide.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/isp_flashing_guide.md')
-rw-r--r--docs/isp_flashing_guide.md24
1 files changed, 12 insertions, 12 deletions
diff --git a/docs/isp_flashing_guide.md b/docs/isp_flashing_guide.md
index c2668c63b..8abc45486 100644
--- a/docs/isp_flashing_guide.md
+++ b/docs/isp_flashing_guide.md
@@ -17,8 +17,8 @@ If you're having trouble flashing/erasing your board, and running into cryptic e
17 atmel.c:1434: Error flashing the block: err -2. 17 atmel.c:1434: Error flashing the block: err -2.
18 ERROR 18 ERROR
19 Memory write error, use debug for more info. 19 Memory write error, use debug for more info.
20 commands.c:360: Error writing memory data. (err -4) 20 commands.c:360: Error writing memory data. (err -4)
21 21
22You're likely going to need to ISP flash your board/device to get it working again. Luckily, this process is pretty straight-forward, provided you have any extra programmable keyboard, Arduino, or Teensy 2.0/Teensy 2.0++. There are also dedicated ISP flashers available for this, but most cost >$15, and it's assumed that if you are googling this error, this is the first you've heard about ISP flashing, and don't have one readily available (whereas you might have some other AVR board). __We'll be using a Teensy 2.0 with Windows 10 in this guide__ - if you are comfortable doing this on another system, please consider editing this guide and contributing those instructions! 22You're likely going to need to ISP flash your board/device to get it working again. Luckily, this process is pretty straight-forward, provided you have any extra programmable keyboard, Arduino, or Teensy 2.0/Teensy 2.0++. There are also dedicated ISP flashers available for this, but most cost >$15, and it's assumed that if you are googling this error, this is the first you've heard about ISP flashing, and don't have one readily available (whereas you might have some other AVR board). __We'll be using a Teensy 2.0 with Windows 10 in this guide__ - if you are comfortable doing this on another system, please consider editing this guide and contributing those instructions!
23 23
24## Software Needed 24## Software Needed
@@ -37,7 +37,7 @@ This is pretty straight-forward - we'll be connecting like-things to like-things
37 Flasher B3 <-> Keyboard B3 (MISO) 37 Flasher B3 <-> Keyboard B3 (MISO)
38 Flasher VCC <-> Keyboard VCC 38 Flasher VCC <-> Keyboard VCC
39 Flasher GND <-> Keyboard GND 39 Flasher GND <-> Keyboard GND
40 40
41## The ISP Firmware 41## The ISP Firmware
42 42
43Make sure your keyboard is unplugged from any device, and plug in your Teensy. 43Make sure your keyboard is unplugged from any device, and plug in your Teensy.
@@ -51,20 +51,20 @@ Then scroll down until you see something that looks like this block of code:
51 // Configure which pins to use: 51 // Configure which pins to use:
52 52
53 // The standard pin configuration. 53 // The standard pin configuration.
54 #ifndef ARDUINO_HOODLOADER2 54 #ifndef ARDUINO_HOODLOADER2
55 55
56 #define RESET 0 // Use 0 (B0) instead of 10 56 #define RESET 0 // Use 0 (B0) instead of 10
57 #define LED_HB 11 // Use 11 (LED on the Teensy 2.0) 57 #define LED_HB 11 // Use 11 (LED on the Teensy 2.0)
58 #define LED_ERR 8 // This won't be used unless you have an LED hooked-up to 8 (D3) 58 #define LED_ERR 8 // This won't be used unless you have an LED hooked-up to 8 (D3)
59 #define LED_PMODE 7 // This won't be used unless you have an LED hooked-up to 7 (D2) 59 #define LED_PMODE 7 // This won't be used unless you have an LED hooked-up to 7 (D2)
60
61And make the changes in the last four lines. If you're using something besides the Teensy 2.0, you'll want to choose something else that makes sense for `LED_HB`. We define `RESET` as `0`/`B0` because that's what's close - if you want to use another pin for some reason, [you can use the pinouts to choose something else](https://www.pjrc.com/teensy/pinout.html).
62 60
63Once you've made your changes, you can click the Upload button (right arrow), which will open up the Teensy flasher app - you'll need to press the reset button on the Teensy the first time, but after that, it's automatic (you shouldn't be flashing this more than once, though). Once flashed, the orange LED on the Teensy will flash on and off, indicating it's ready for some action. 61And make the changes in the last four lines. If you're using something besides the Teensy 2.0, you'll want to choose something else that makes sense for `LED_HB`. We define `RESET` as `0`/`B0` because that's what's close - if you want to use another pin for some reason, [you can use the pinouts to choose something else](https://www.pjrc.com/teensy/pinout.html).
62
63Once you've made your changes, you can click the Upload button (right arrow), which will open up the Teensy flasher app - you'll need to press the reset button on the Teensy the first time, but after that, it's automatic (you shouldn't be flashing this more than once, though). Once flashed, the orange LED on the Teensy will flash on and off, indicating it's ready for some action.
64 64
65## The `.hex` File 65## The `.hex` File
66 66
67Before flashing your firmware, you're going to need to and do a little preparation. We'll be appending [this bootloader (also a .hex file)](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1_0_0.hex) to the end of our firmware by opening the original .hex file in a text editor, and removing the last line, which should be `:00000001FF` (this is an EOF message). After that's been removed, copy the entire bootloader's contents and paste it at the end of the original file, and save it. 67Before flashing your firmware, you're going to need to and do a little preparation. We'll be appending [this bootloader (also a .hex file)](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1_0_0.hex) to the end of our firmware by opening the original .hex file in a text editor, and removing the last line, which should be `:00000001FF` (this is an EOF message). After that's been removed, copy the entire bootloader's contents and paste it at the end of the original file, and save it.
68 68
69It's possible to use other bootloaders here in the same way, but __you need a bootloader__, otherwise you'll have to ISP to write new firmware to your keyboard. 69It's possible to use other bootloaders here in the same way, but __you need a bootloader__, otherwise you'll have to ISP to write new firmware to your keyboard.
70 70
@@ -75,7 +75,7 @@ Make sure your keyboard is unplugged from any device, and plug in your Teensy.
75Open `cmd` and navigate to your where your modified .hex file is. We'll pretend this file is called `main.hex`, and that your Teensy 2.0 is on the `COM3` port - if you're unsure, you can open your Device Manager, and look for `Ports > USB Serial Device`. Use that COM port here. You can confirm it's the right port with: 75Open `cmd` and navigate to your where your modified .hex file is. We'll pretend this file is called `main.hex`, and that your Teensy 2.0 is on the `COM3` port - if you're unsure, you can open your Device Manager, and look for `Ports > USB Serial Device`. Use that COM port here. You can confirm it's the right port with:
76 76
77 avrdude -c avrisp -P COM3 -p atmega32u4 77 avrdude -c avrisp -P COM3 -p atmega32u4
78 78
79and you should get something like the following output: 79and you should get something like the following output:
80 80
81 avrdude: AVR device initialized and ready to accept instructions 81 avrdude: AVR device initialized and ready to accept instructions
@@ -90,8 +90,8 @@ and you should get something like the following output:
90 90
91Since our keyboard uses an `atmega32u4` (common), that is the chip we'll specify. This is the full command: 91Since our keyboard uses an `atmega32u4` (common), that is the chip we'll specify. This is the full command:
92 92
93 avrdude -c avrisp -P COM3 -p atmega32u4 -U flash:w:main.hex:i 93 avrdude -c avrisp -P COM3 -p atmega32u4 -U flash:w:main.hex:i
94 94
95You should see a couple of progress bars, then you should see: 95You should see a couple of progress bars, then you should see:
96 96
97 avrdude: verifying ... 97 avrdude: verifying ...
@@ -100,7 +100,7 @@ You should see a couple of progress bars, then you should see:
100 avrdude: safemode: Fuses OK 100 avrdude: safemode: Fuses OK
101 101
102 avrdude done. Thank you. 102 avrdude done. Thank you.
103 103
104Which means everything should be ok! Your board may restart automatically, otherwise, unplug your Teensy and plug in your keyboard - you can leave your Teensy wired to your keyboard while testing things, but it's recommended that you desolder it/remove the wiring once you're sure everything works. 104Which means everything should be ok! Your board may restart automatically, otherwise, unplug your Teensy and plug in your keyboard - you can leave your Teensy wired to your keyboard while testing things, but it's recommended that you desolder it/remove the wiring once you're sure everything works.
105 105
106If you have any questions/problems, feel free to [open an issue](https://github.com/qmk/qmk_firmware/issues/new)! 106If you have any questions/problems, feel free to [open an issue](https://github.com/qmk/qmk_firmware/issues/new)!