sync error when trying to program via command prompt in windows

Hi everyone,

I am trying to program my Arduino Uno R3 via the command interface (as Administrator) of Windows 8.1 but I am constantly getting a sync error :
avrdude: stk500_getsync(): not in sync: resp=0x00

This is the command I use to to perform an upload : avrdude -p atmega328p -c s tk500v1 -P \.\COM3 -U flash:w:blink.hex:i

fyi, my avrdude config file is in the same folder from where I run the avrdude.exe

I am pretty sure about the COM3 port because when I use another number I have another error and by the way all is working fine when I want to upload sketches through the IDE interface with this same COM3 port to the Arduino one

What can be wrong here? Any advice ..? Is it something to do because it is connected via USB?
This is driving me nuts :frowning:

Regards
Kurt

Look at the 1000,s of posts on this topic in the installation and trouble shooting section. Learn to read and follow the instructions. If you had you would Know the com port.

Mark

Marc

I have done that ..It is already for a few days I'm searching for a solution.
Most posts of this sync error is related to users of the IDE ...
My IDE here IS working with COM3. The problem I face to is to upload a hex file trough the command line on COM3
I dont understand what you are trying to say with "If you had you would Know the com port" I am pretty sure that my arduino is on COM3 coz it works with COM3 in the IDE

br
Kurt

Can you upload the same sketch to the same Arduino using the IDE? Is fo, what benefit is there using the command line? Is you command line command EXACTLY the same one the IDE uses?

To PaulS
the benefit to do it with the command line is to be able to reduce dramaticly in memory recources, coz u can write a program in pure C, compile it and upload it.
So, this program in pure C is not really working through the Arduino IDE as far as I understood because there isnt the usual structure of a program as used in the IDE
void setup() {
}
void loop() {
}
This is my gueass, so please, someone correct me if i'm wrong ..

I finally find out what I did wrong ..
I am new to this and maybe my findings will also help new arduino users

The reason why I had always this damn sync error is because I simply didnt pushed the reset button before sending the avrdude command! you just have to know this :-s
Now here is what followed:
I finally get rid of that sync error to receive a new error :frowning:
this time it was : Yikes! Invalid device signature with this command:
avrdude -p atmega328p -c stk500v1 -P \.\COM3 -U flash:w:blink.hex:i

So I searched further and then I saw somewhere a post where they used 'arduino' instead of 'stk500v1'
So This command ( avrdude -p atmega328p -c arduino -P \.\COM3 -U flash:w:blink.hex:i) was working fine!!
Finally :slight_smile:

Now, can someone explain me what this stk500v1 is exactly, and why it generated this "Invalid device signature" ??

I also remarked that with 'arduino' in the command there was no need to push the reset button for uploading the program