I broke the bootloader

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: I broke the bootloader

Post by uze6666 »

Also, I can't recall, do you have a Uzebox kit (the red one) or one you made yourself? If you have the kit, things are easy. I was successfully able to both flash a blank chip and reflash a chip which had the fuses set to use an external clock.

As Janka, mentionned, just leave the chip in the Uzebox, it will use the onboard crystal. But unplug power and any cable from isp port.

Download the latest Arduino IDE: http://arduino.cc/en/Main/Software. When installing Arduino insure the virtual COM port USB driver is installed. I'm on Windows with a UNO so adjust accordingly.

Start Arduino, go to Files->Examples and open ArduinoISP. Then from Tools->Board select Arduino Uno, from Tools->Programmer select AVR ISP or Arduino as ISP. Access Tools->Serial Port and select a port (ex. COM3) which is needed for avrdude. For me COM3 did not work, but I had another one in the list, COM5 which worked.

Finally, press Files->Upload, to load ArduinoISP to Arduino Uno. This operation transforms Arduino Uno into an ISP programmer.

Next Wire from Aduino (UNO)->Uzebox EXT header:
Pin10: RESET
Pin11: MOSI
Pin12: MISO
Pin13: SCK
5V: VCC
GND: GND

Next run avrdude, use the same COM port as selected in the Arduino IDE:

Code: Select all

avrdude -P COM5 -b 19200 -c avrisp -p m644 –n
You should have this:

Code: Select all

avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.07s
avrdude: Device signature = 0x1e9609
avrdude: safemode: Fuses OK
avrdude done.  Thank you.
Flash the fuses:

Code: Select all

avrdude -P COM5 -b 19200 -c avrisp -p m644 -U lfuse:w:0xD7:m -U hfuse:w:0xD2:m -U efuse:w:0xFF:m
Flash the bootloader & EEPROM (attachments):

Code: Select all

avrdude -P COM5 -b 19200 -c avrisp -p m644 -U flash:w:Bootloader_0_4_4.hex -U eeprom:w:eeprom.hex
Hopefully you'll be back on track!
Attachments
eeprom.hex
(5.64 KiB) Downloaded 479 times
Bootloader_0_4_4.hex
(11.14 KiB) Downloaded 481 times
HolyCarHorn
Posts: 21
Joined: Wed Dec 11, 2013 4:03 pm

Re: I broke the bootloader

Post by HolyCarHorn »

Yeah I forgot to answer when you asked. Yes I do the one from adafruit. Real quick I'll answer your other question. It's an arduino uno and I believe it's r3 smd edition. Thanks I'll give it a shot!
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: I broke the bootloader

Post by uze6666 »

I tried on Ubuntu, but can't seem to be able to make it work with /dev/ttyACM0. Perhaps it's because I'm running in it VMWare...
User avatar
Janka
Posts: 214
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Re: I broke the bootloader

Post by Janka »

uze6666 wrote:I tried on Ubuntu, but can't seem to be able to make it work with /dev/ttyACM0. Perhaps it's because I'm running in it VMWare...
Or maybe the modem manager is hogging ttyACM0. I once helped someone who had a similar problem with a chipcard reader on ttyACM0.
HolyCarHorn
Posts: 21
Joined: Wed Dec 11, 2013 4:03 pm

Re: I broke the bootloader

Post by HolyCarHorn »

Janka wrote:
uze6666 wrote:I tried on Ubuntu, but can't seem to be able to make it work with /dev/ttyACM0. Perhaps it's because I'm running in it VMWare...
Or maybe the modem manager is hogging ttyACM0. I once helped someone who had a similar problem with a chipcard reader on ttyACM0.
Yeah didn't work for me either. I can borrow somebody's windows machine but I'd like to get it working on mine so I'll be able to fix it again should it happen. I have a different port, ttyS0. Maybe I could hook it to that. Trouble is I don't know how...

Edit: Oh and here is the error I was getting:

Code: Select all

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12

avrdude done.  Thank you.
Edit: Edit:
This seems relevant:
https://groups.google.com/forum/#!msg/b ... 4_uo6V1ocJ
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: I broke the bootloader

Post by uze6666 »

If it of any help, this is exactly the errors I got in Ubuntu on VMWare. I see a lot of bug fix attempt for this issue, but none worked for me. I still can't explain why in works on windows but not linux...

For the record, my avrdude on windows is v5.10 and unbuntu is v5.11.1, perhaps a bug was introduced in this version.
HolyCarHorn
Posts: 21
Joined: Wed Dec 11, 2013 4:03 pm

Re: I broke the bootloader

Post by HolyCarHorn »

So I managed to get ahold of a windows computer, and was able to flash one of the chips. I didn't bother with the other one cause I wanted to save it for testing. If I ever manage to get it working I'll tell you. Thanks everyone!
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: I broke the bootloader

Post by uze6666 »

Awesome!! Just in time! :mrgreen:
User avatar
Kerby
Posts: 90
Joined: Wed Feb 06, 2013 6:02 pm

Re: I broke the bootloader

Post by Kerby »

Sometimes it happens that defective, properly connected chip ATmega ceases to be determined for the firmware program. This can occur as a consequence of several reasons:
  - Programming via SPI smoking 
- RESET leg became usual ping port 
- Improperly selected clock source
Post Reply