Go Down

Topic: Can Only Upload Once (Read 809 times) previous topic - next topic

Andy R

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?

Coding Badly

Did you set the lock bits after uploading the bootloader?

retrolefty

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

tim7

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

floresta

Is the BOOTRST fuse set?

Don

johnwasser

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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Andy R

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.

johnwasser


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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Go Up