Pages: [1]   Go Down
Author Topic: Can Only Upload Once  (Read 777 times)
0 Members and 1 Guest are viewing this topic.
NYC
Offline Offline
Full Member
***
Karma: 0
Posts: 129
The singularity is near!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Steps to reproduce:
Burn a ATMEGA328P-PU with an ArduinoISP - No errors
Download blink sketch - No errors and it blinks
Download blink sketch a second time - Fails with following error:
  avrdude: stk500_recv(): programmer is not responding
  avrdude: stk500_recv(): programmer is not responding

Burning and downloads from Arduino Development Environment on a Mac. Arduino is breadboard variety like http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard

If the atmega is burned again, a sketch can be downloaded once.

Any ideas for diagnosing this? Is there anything funky about ArduinoISP burning?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you set the lock bits after uploading the bootloader?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which bootloader code are you using. This sounds like on of the Uno bootloader bugs that surfaced a while back. There is a newer version around that solves it, search around. I don't own a Uno so I haven't kept a link.

Lefty
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lefty, are you thinking of the "amnesia" bug?  This sounds different.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 4435
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the BOOTRST fuse set?

Don
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like that breadboard does not implement auto-reset.

Connect the Reset pin (Pin 1 of the ATmega) to ground until you see the "Binary sketch size" message in the IDE.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

NYC
Offline Offline
Full Member
***
Karma: 0
Posts: 129
The singularity is near!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It was the auto reset issue!

I'm not sure why the first sketch uploads without holding the reset button, but burn and repeated upload worked with 2 atmega328p chips.

Also had to move freshly burned chip to another breadboard (instead of uploading on same board as Arduino ISP), but this is a good idea anyway.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It was the auto reset issue!

I'm not sure why the first sketch uploads without holding the reset button.

I think it's because with a fresh bootloader there is no sketch to run so the bootloader just waits for your upload.

Once a sketch has been uploaded the bootloader only gets control for a short time after reset before turning control over to the sketch.  If the upload doesn't start during that window the bootloader won't process it.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Pages: [1]   Go Up
Jump to: