The sketch seems to upload fine, but it doesn't replace the previous one.

Hi. So I've been using this Uno for a little while with my other laptop, but I just put that hard drive into this new laptop (I don't know how relevant that is), and now when I upload a sketch, it seems to go smoothly, but the Uno keeps running the last sketch I put on there. And here I thought we were friends. In the Tools menu, I have the right board selected, and I'm pretty sure I have the right port 'cause there's only one option. I'm using a USB, so the programmer doesn't matter, right? I'm super green. :slight_smile:

What sketch did you have on there before? How do you know the new one isn't running?

Are you using 1.6.8 on windows? Does the sketch work if you open the serial monitor? It has a bug that causes it to continually poll serial ports unless the serial monitor is open, which causes the board to reset. Use 1.6.5r5 on windows for now - the later releases all have some significant bugs, and if you're new at Arduino, it's best to use a version that doesn't have those problems.

Hi. :smiley: I had a slightly altered version of the CapacitiveSensor example sketch on there. I'm trying to upload another altered version of the same example, and I know the new one isn't running 'cause none of my new stuff is taking effect. For example, I removed the constant printing of information to the serial monitor, but it still shows up in there. I'm using 1.6.7 on Windows 7. I'll try 1.6.5r5. Thank ya. :smiley:

Ugh. Well, that worked for a little while. I uploaded the CapacitiveSensor example again with a longer delay, and that took effect. Then I added some stuff, and that worked too. Added some more, and now I'm back to the original problem. A sketch will upload, but it won't replace the previous one. I just wanna use you, Arduinoooo!

I noticed that the sketches upload suspiciously quickly when it isn't working. I don't know if that's an indication of something. I closed the IDE, brought up a new one, and uploaded the Blink example, which worked. I'm just writing this 'cause I don't feel like dealing with that all the time, so if anyone knows what might be going on there, I'd love to hear about it. :smiley:

This is a recurring problem, probably down to 1.6.8 IDE. You can either download an earlier version (1.6.5 seems to be favoured) or press the RESET button on your board as the compiler starts compiling - sometimes that works too (it does for me).

And/or unload and reload the IDE. That too sometimes sorts things out.

It might be a problem with the code itself if only one code is not uploading and others are. Though a newbie is always advised to use IDE 1.6.5

We're stumbling around in the dark here, let's turn on the lights...

Using 1.6.5, and making sure there aren't any other open Arduino windows. Preferences, enable verbose compile, verbose upload output. Now when you compile or upload, it will output tons of stuff in the bottom part of the window.

Now reproduce the problem - when it fails to replace the existing sketch, copy/paste everything from the output pane at the bottom of the window and post it.

It makes me feel better that this is a common issue. I'm using the 6.5, and I'll post that verbose stuff if it happens again. I've threatened it pretty hard too, so maybe that'll solve the problem. :smiley:

"Threatened it pretty hard"
Rofl. Well that should definitely solve your problem...

Okay, when it happened again, I enabled the verbose upload stuff, then it worked, and it was doing fine for a while. Then it got bored of fine and decided I didn't have enough hurdles getting in my way. But here's the info it gave me:

Sketch uses 5,800 bytes (17%) of program storage space. Maximum is 32,256 bytes.
Global variables use 638 bytes (31%) of dynamic memory, leaving 1,410 bytes for local variables. Maximum is 2,048 bytes.
C:\Users\CVan\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\tools\avr/bin/avrdude -CC:\Users\CVan\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:\Users\CHRIST~1\AppData\Local\Temp\build9113180101612092441.tmp/sketch_apr18a.cpp.hex:i

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Users\CVan\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM3
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "C:\Users\CHRIST~1\AppData\Local\Temp\build9113180101612092441.tmp/sketch_apr18a.cpp.hex"
avrdude: writing flash (5800 bytes):

Writing | ################################################## | 100% 0.94s

avrdude: 5800 bytes of flash written
avrdude: verifying flash memory against C:\Users\CHRIST~1\AppData\Local\Temp\build9113180101612092441.tmp/sketch_apr18a.cpp.hex:
avrdude: load data flash data from input file C:\Users\CHRIST~1\AppData\Local\Temp\build9113180101612092441.tmp/sketch_apr18a.cpp.hex:
avrdude: input file C:\Users\CHRIST~1\AppData\Local\Temp\build9113180101612092441.tmp/sketch_apr18a.cpp.hex contains 5800 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.75s

avrdude: verifying ...
avrdude: 5800 bytes of flash verified

avrdude done. Thank you.

avrdude: 5800 bytes of flash verified

avrdude done. Thank you

Er, am I missing something here or am I not seeing that hurdle you mentioned? Did this not work?

Yeah, exactly. It totally seems to have worked, but it runs the code that I previously had on there. I print a word to the serial monitor and change it every time I upload the sketch now just to make sure that it's running the newest version of the sketch that I uploaded. Whatever. It's a small price to pay for all the Arduino wonderfulness.

And you don't have another Arduino connected anywhere to which you are accidentally uploading instead? (Don't ask, it happened to me.)

You've selected the correct board type, processor type (if that is an option for the board you are using) and port number?

A bit odd that the verbose settings indicate it's actually checked what was written successfully.

Try uploading a simple blink sketch and see what happens.

Haha, nope, only one's connected. Yeah, I believe I have the right stuff selected. I'm using an Uno, and there's a chance it's inauthentic. I don't know how much that matters. The Blink sketch worked, which is probable. I'm getting accustomed to it now. It'll give me several good uploads, then it just stops. But it's good to go again after I close the program and bring it back up. Maybe I should wait for it to happen again. I was sure that I was facing the problem when it gave me that verbose stuff that I posted, but maybe I made a mistake. I'm pretty good at those.

Ashleyyyyy:
I'm using an Uno, and there's a chance it's inauthentic. I don't know how much that matters.

I don't think it matters at all. The UNO design is Open Source - anyone can make an UNO board as long as they don't call an Arduino or Genuino - most clones refer to themselves as UNO Compatible which is fine.

Anyway, if you have not reverted to 1.6.5 I suggest you should as 1.6.8 has a lot to answer for.

There are many kinds of "Uno's"

  • Arduino.cc / Genuino Uno R3 (the "official" ones)
  • Arduino.org Uno (there is ongoing litigation over their claiming to be the real Arduino)
  • Third party, faithful clones from reputable vendors - these use the 16u2 like the official boards, and I think some of them kickback some money from sales to Arduino

  • Typical clones from china. Very cheap ($5-8 last I checked - pro mini's $2 each). These use a different serial adapter, normally a CH340G, which uses different drivers. You can't reprogram the serial adapter to make the device look like a mouse or keyboard - but almost nobody uses that functionality anyway.
  • Counterfeit Arduino boards, with the arduino markings and trademark, marketed as official, but actually a typical chinese clone.

None of them should display the sort of behavior described above - that behavior is wacky, and I can't understand how the upload process could possibly complete without writing the new program to the flash.

Okay. I bought it on Amazon like the day I found out that a microcontroller is a thing, so I didn't know what was going on. Some people in the comments loved it. Some deemed it counterfeit. Whatever. Anyway, maybe I messed up. I'll wait for it to happen again.

Ashleyyyyy:
Okay. I bought it on Amazon like the day I found out that a microcontroller is a thing, so I didn't know what was going on. Some people in the comments loved it. Some deemed it counterfeit. Whatever. Anyway, maybe I messed up. I'll wait for it to happen again.

Word of warning about amazon in general - Amazon pools sellers of the "same" product together, so you can compare prices. They are not very good at this, though, and sometimes you end up with slightly different products being treated as the same by Amazon. Arduino boards and clones thereof are one of these - apparently the ones that don't work at all (counterfeit FTDI chips that don't work with current drivers - see FTDIgate) were still showing up on amazon well after they'd vanished from ebay. But yeah - I don't think this is relevant here - the bizzaro failure mode reported is not suggestive of a bad board - boards of dubious build quality either work or don't work.

The re-order of mailing labels for my tindie shop wasn't the same either - there's no marking on the back of the new ones, so I don't know which side should be facing up in the printer until I peel it off and find that the sticky side is blank.

Wow, that's good to know. I bought a Mega too, and I figured I shouldn't push my luck, so I got it here. It's fun looking back on my introduction to these things, 'cause now I see them all over the place. In like every YouTube tutorial.