Author Topic: Arduino UNO bootloader  (Read 7617 times)

0 Members and 1 Guest are viewing this topic.

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
Arduino UNO bootloader
« on: August 27, 2013, 03:09:59 pm »
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?
 

Offline sacherjj

  • Frequent Contributor
  • **
  • Posts: 993
  • Country: us
Re: Arduino UNO bootloader
« Reply #1 on: August 27, 2013, 03:29:25 pm »
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
 

Offline ColinA

  • Contributor
  • Posts: 34
Re: Arduino UNO bootloader
« Reply #2 on: August 27, 2013, 03:57:29 pm »
 

Offline MatCat

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: us
Re: Arduino UNO bootloader
« Reply #3 on: August 27, 2013, 04:01:54 pm »
You can also bitbang the AVRDUDE protocol with FTDI as well: http://doswa.com/2010/08/24/avrdude-5-10-with-ftdi-bitbang.html
 

Offline Thor-Arne

  • Supporter
  • ****
  • Posts: 500
  • Country: no
  • tinker - tinker, little noob.....
Re: Arduino UNO bootloader
« Reply #4 on: August 27, 2013, 05:17:36 pm »
Try with these switched on:
Uno R2: SPIEN, EESAVE, BOOTRST, BODLEVEL1, BLB12, BLB11
Uno R3: SPIEN, BOOTRST, BODLEVEL1, BLB12, BLB11

At least that's what my MiniPro reads from the 328P.
 

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
Re: Arduino UNO bootloader
« Reply #5 on: August 27, 2013, 06:57:33 pm »
could someone send me the actual hex file please?
 

Offline Thor-Arne

  • Supporter
  • ****
  • Posts: 500
  • Country: no
  • tinker - tinker, little noob.....
Re: Arduino UNO bootloader
« Reply #6 on: August 27, 2013, 08:12:11 pm »
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.
 

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
Re: Arduino UNO bootloader
« Reply #7 on: August 27, 2013, 09:01:44 pm »
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  |O) 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=0x00
To me is that the 328P chip is not communicating.
« Last Edit: August 27, 2013, 09:04:51 pm by IvoS »
 

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
Re: Arduino UNO bootloader
« Reply #8 on: August 27, 2013, 09:21:19 pm »
using minipro, I am getting this error, did I forget to check something?
« Last Edit: August 27, 2013, 09:24:10 pm by IvoS »
 

Offline Thor-Arne

  • Supporter
  • ****
  • Posts: 500
  • Country: no
  • tinker - tinker, little noob.....
Re: Arduino UNO bootloader
« Reply #9 on: August 27, 2013, 09:23:57 pm »
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?
 

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
Re: Arduino UNO bootloader
« Reply #10 on: August 27, 2013, 09:25:45 pm »
RX TX LEDs flashing just a few times, and then they stop
 

Offline Thor-Arne

  • Supporter
  • ****
  • Posts: 500
  • Country: no
  • tinker - tinker, little noob.....
Re: Arduino UNO bootloader
« Reply #11 on: August 27, 2013, 09:28:26 pm »
using minipro, I am getting this error, did I forget to check something?

You does not have a project (*.prj) file opened, you need to open the project file which will set all fuses and data/code memory.
 

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
Re: Arduino UNO bootloader
« Reply #12 on: August 27, 2013, 09:29:12 pm »
I just programmed fuses first and then the code memo. No error. But still no go in Arduino Uno.
 

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
Re: Arduino UNO bootloader
« Reply #13 on: August 27, 2013, 09:32:40 pm »
Kick me in the head!  |O |O
Yes! It works now! didn't open the file in prj option. All works now. Many thanks.  :-+
 

Offline Thor-Arne

  • Supporter
  • ****
  • Posts: 500
  • Country: no
  • tinker - tinker, little noob.....
Re: Arduino UNO bootloader
« Reply #14 on: August 27, 2013, 09:33:54 pm »
You're welcome  :)
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Arduino UNO bootloader
« Reply #15 on: August 27, 2013, 11:06:17 pm »
Quote
there are bunch of fuses that I don't know how to set them up.
The appropriate fuse values for an actual Arduino are listed in hardware/arduino/boards.txt
or in the bootloader Makefiles in hardware/arduino/bootloaders/optiboot/...
(If you want it to function differently, you should use a fuse calculator like http://www.engbedded.com/fusecalc/ to figure out the values.  Or pour over the chip datasheet...)

 

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
Re: Arduino UNO bootloader
« Reply #16 on: August 28, 2013, 07:00:52 pm »
Thanks, I tried that website info already but unfortunately that didn't work.
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3437
  • Country: us
Re: Arduino UNO bootloader
« Reply #17 on: August 30, 2013, 03:33:57 am »
Thanks, I tried that website info already but unfortunately that didn't work.

Don'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
 

Offline davec

  • Contributor
  • Posts: 15
  • Country: gb
    • Tynemouth Software Blog
Re: Arduino UNO bootloader
« Reply #18 on: August 30, 2013, 08:29:51 am »
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.html

I 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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf