Arduino UNO bootloader - Page 1
Forum section: electronics / general

author: IvoS
author_rank: Frequent Contributor
timestamp: August 27, 2013, 03:09:59 pm
content: I was playing with the 328P chip and I screwed up the bootloader. Now I need to burn the bootloader back. I was trying to use my MiniPro programmer loading the 328 bootloader hex file to it but it didn't work because there are bunch of fuses that I don't know how to set them up. Is that the only way to load the bootloader into the chip by using the ICSP header? I also have FTDI friend board that I can possibly use?

author: sacherjj
author_rank: Frequent Contributor
timestamp: August 27, 2013, 03:29:25 pm
content: Yes, you need to flash it via the ICSP header. You can use an ICSP programmer and another Ardunio device. Spark Fun has a pretty good page on this:https://www.sparkfun.com/tutorials/247

author: ColinA
author_rank: Contributor
timestamp: August 27, 2013, 03:57:29 pm
content: http://arduino.cc/en/Tutorial/ArduinoISP

author: MatCat
author_rank: Frequent Contributor
timestamp: August 27, 2013, 04:01:54 pm
content: You can also bitbang the AVRDUDE protocol with FTDI as well:http://doswa.com/2010/08/24/avrdude-5-10-with-ftdi-bitbang.html

author: Thor-Arne
author_rank: Unknown
timestamp: August 27, 2013, 05:17:36 pm
content: Try with these switched on:Uno R2: SPIEN, EESAVE, BOOTRST, BODLEVEL1, BLB12, BLB11Uno R3: SPIEN, BOOTRST, BODLEVEL1, BLB12, BLB11At least that's what my MiniPro reads from the 328P.

author: IvoS
author_rank: Frequent Contributor
timestamp: August 27, 2013, 06:57:33 pm
content: could someone send me the actual hex file please?

author: Thor-Arne
author_rank: Unknown
timestamp: August 27, 2013, 08:12:11 pm
content: First check your voltages.If voltage to the 328 is ok, check that the Uno is recognized on the usb.If it's not, then it can be that the Atmega8U2/16U2 that is bricked.If this is the case, you might be able to reprogram it with ICSP.You don't need ICSP for programming the 328, the minipro will do it just fine.

author: IvoS
author_rank: Frequent Contributor
timestamp: August 27, 2013, 09:01:44 pm
content: Yes, the UNO board is recognized under device manager as Arduino Uno, so the Atmega8U2/16U2 must be good.I didn't do anything with the board other than I physically removed the chip from the socket (f*cked up the bootloader) and put it back to socket. No matter what I do I can not program the bootloader using MiniPro.I am getting this error: avrdude: stk500_getsync(): not in sync: resp=0x00To me is that the 328P chip is not communicating.

author: IvoS
author_rank: Frequent Contributor
timestamp: August 27, 2013, 09:21:19 pm
content: using minipro, I am getting this error, did I forget to check something?

author: Thor-Arne
author_rank: Unknown
timestamp: August 27, 2013, 09:23:57 pm
content: Hm, it means that the Atmega8U2/16U2 still is alive. There can still be something wrong with it however.If only removing and inserting the 328 bricked it, I suspect ESD as the culprit here.I've done that many times and it was never a problem, however always done in a ESD safe environment. If this is the case, you need a new 328 chip.Does burning with the minipro succeed? Does it verify ok?When burning with the minipro the hex files contains both the bootloader and the program space.If successful the 328 should run that program when powered up, normally flashing the led on D13.I'm not sure about the error message from avrdude.It's possible that the Atmega8U2/16U2 is not communicating correctly with the 328.Do you have any activity on the RX/TX leds?

author: IvoS
author_rank: Frequent Contributor
timestamp: August 27, 2013, 09:25:45 pm
content: RX TX LEDs flashing just a few times, and then they stop

author: Thor-Arne
author_rank: Unknown
timestamp: August 27, 2013, 09:28:26 pm
content: Quote from: IvoS on August 27, 2013, 09:21:19 pmYou does not have a project (*.prj) file opened, you need to open the project file which will set all fuses and data/code memory.

author: IvoS
author_rank: Frequent Contributor
timestamp: August 27, 2013, 09:29:12 pm
content: I just programmed fuses first and then the code memo. No error. But still no go in Arduino Uno.

author: IvoS
author_rank: Frequent Contributor
timestamp: August 27, 2013, 09:32:40 pm
content: Kick me in the head!Yes! It works now! didn't open the file in prj option. All works now. Many thanks.

author: Thor-Arne
author_rank: Unknown
timestamp: August 27, 2013, 09:33:54 pm
content: You're welcome

author: westfw
author_rank: Super Contributor
timestamp: August 27, 2013, 11:06:17 pm
content: QuoteThe appropriate fuse values for an actual Arduino are listed in hardware/arduino/boards.txtor in the bootloader Makefiles in hardware/arduino/bootloaders/optiboot/...(If you want it to function differently, you should use a fuse calculator likehttp://www.engbedded.com/fusecalc/to figure out the values. Or pour over the chip datasheet...)

author: IvoS
author_rank: Frequent Contributor
timestamp: August 28, 2013, 07:00:52 pm
content: Thanks, I tried that website info already but unfortunately that didn't work.

author: Rick Law
author_rank: Super Contributor
timestamp: August 30, 2013, 03:33:57 am
content: Quote from: IvoS on August 28, 2013, 07:00:52 pmDon't try anything fancy.I followed the instruction from the Arduino website, use a working UNO connected to a virgin ATMega on a breadboard. First run I had a problem. I recheck (a cap or a resistor that they said must be there) and then next run I followed the instruction very very carefully and the bootloader loaded onto the virgin ATMega328 no problem.Nothing fancy, no short cuts, just followed the instructions closely.Jameco sells ATMega328 with Ardunio bootloader already loaded at a slight premium. When I killed mine, I didn't have a working UNO. I got the bootloader-already-installed ATMega from Jameco to get the UNO working. I then get a blank 328 from Tayda and loaded the bootloader on it. Now I know I won't get caught like I did the first time.Rick

author: davec
author_rank: Contributor
timestamp: August 30, 2013, 08:29:51 am
content: Not sure if it's the same issue, but I've used the mini pro in the past to recover from seemingly dead arduino's. I have always managed to get them running again.More details here:http://blog.tynemouthsoftware.co.uk/2013/05/arduino-revival-with-eprom-programmer.htmlI don't expect it's the case here, but I did have an email conversation with someone about similar problems and further investigation finally showed he had put the ATMega328P back the wrong way around in the UNO board. It worked fine once rotated!Thanks,Dave