Go Down

Topic: can't get rid of old program (on mini) (Read 1 time) previous topic - next topic

mr.m

Hello,

First of all: Arduino rules ... including the website arduino.cc and especially the people who spend their spare time to develop arduino. Thank you very much!

However like most other people I post to this forum because I need help...

Just like described in the following post
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1164357893  
I am unable to flash over an old sketch. This happened suddenly and I don't know which of my actions could have caused this problem.

The only difference to the other thread: I have a arduino mini (atmega 168) with Firmware Version: 1.15

Everything seems to upload perfectly - a small sketch takes less long to flash than a big one - however 10 seconds after the process is complete the old scetch starts.

What shall I do? Shall I try to burn a new bootloader as described in the above mentioned thread? What other options do I have?

lg, Mr.M

mellis

So it was working before with the same computer and setup?

Is it possible you accidently uploaded a program when the environment was configured for an ATmega8?  It's possible that could mess things up.

What does the old program do?  Does it appear to be running normally?

mr.m

Yes, the computer and the setup is the same.  Hm, it might be that the board recieved less than 5 volts while running the old program for a while (low batteries). However I am sure that it did not receive more than 5 Volts at any time, because I always use a voltage regulator (and big capacitors).

... I am sure that the environment was set to atmega168 at all times.

The old program runs perfectly (It is pretty big - all parts of it work normally)

---

Could it be that this strange behavior results from bad soldered contacts, or is the programming done all "in-chip"?

I have a second "normal" USB Arduino-board which I programmed with the software from here http://tinker.it/now/2006/12/04/turn-arduino-into-an-avr-isp-programmer/ , however now I am stuck...

Where can I get the bootloader hex for the mini arduino (atmega168) and what tool should I use to write the bootloader to the mini-board?

lg, Mr.M

mellis

You can get the source code from http://www.arduino.ws/: go to Upload, then Software, bootloader_v5  (m168) and download the zip.  You'll need to use avrdude to burn it.

mr.m

#4
Jan 24, 2007, 10:53 pm Last Edit: Jan 24, 2007, 10:58 pm by mr.m Reason: 1
Thank you very much mellis. I'll look into it tomorrow...

lg, Mr.M

mr.m

Hi again,

Just tried to burn the bootloader onto a second USB-Arduino board by using the "AVR-ISP" Arduino-board...

I used AVRDude from WinAVR with the commandline:

avrdude -F -P com3 -c stk500v2 -p ATMEGA8 -b 115200 -vvvv ATmegaBOOT.hex

However I needed to specify the -F switch, because avrdude complained with the following message:

<quote>
avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
        Double check connections and try again, or use -F to override
        this check.
<\quote>

Everything seems to work fine - but the board worked fine before, so I am not sure if flashing was successful (*phew* - At least I didn't brick it)

--

Now I would like to do the same thing with the arduino mini-board. However the sck-pin (pin 17) of the atmega168 seems not to be soldered to any pin of the mini-board. Do I have to contact the pin directly on the chip?

Is the following command correct for flashing the bootloader onto the atmega 168?

avrdude -F -P com3 -c stk500v2 -p ATMEGA168 -b 115200 -vvvv ATmegaBOOT_168.hex

lg, Mr.M

mr.m

#6
Jan 25, 2007, 08:43 pm Last Edit: Jan 25, 2007, 08:58 pm by mr.m Reason: 1
Hi,

I think I wrote the bootloader onto the mini arduino. I gave avrdude the parameters I mentioned in the last post. The last few lines of output were:

-----
...
...
...
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: . [1b]   [20] . [00] . [08] . [0e] . [1d] . [04] . [04] . [00] P
[50] . [08] . [00] . [00] x [78]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: safemode: efuse reads as 7
avrdude: safemode: Fuses OK
avrdude: Send: . [1b] ! [21] . [00] . [03] . [0e] . [11] . [01] . [01] & [26]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:

avrdude done.  Thank you.

-----

Then I used the 0007er to upload the led-blink scratch - it still does _not_ work - uploading seems to work, however after the reset, the old scratch still executes.

I tried to upload from completely different machines - the scratch remains flashed...

What do you think... shall I dispose of this mini and buy another one?

lg, Mr.M

Edit: I used avrdude again and tried to erase the chip - without success. The old bootloader is still there. So avrdude did not write the new bootloader to flash as I thought.

admin

i've had terrible results with avrdude and the atmega168

sadly the only reliable way to do this is to use avr studio on windows (yuck...)

massimo

Go Up