Arduino _command_line_ sketch upload: avrdude: stk500_recv(): programmer is not responding - arduino

When trying to upload the sketch from the command line I get a
avrdude -vvv -F -V -c arduino -p ATMEGA328P -P /dev/ttyACM0 -b 115200 -U flash:w:test.hex
avrdude: Version 6.0.1, compiled on Oct 21 2013 at 15:55:32
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/toni/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
but from the Arduino IDE it works flawlessly, so, obviously, the IDE is doing something I don't know about.
I've tried activating "Show detailed output during upload" but the output window history is way too short to view the commands launched. I can only see the end of the successful upload.
I'm guessing the IDE resets somehow the Arduino to talk to the booloader before the already loaded sketch starts running
Ho could I do this from the command line (without the IDE) ?

Related

No matter what I do, I get this error avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xbe

My problem is no matter what I do to upload a blink program to my Arduino pro-mini, I'm getting the not in sync error(below I have attached the error for reference).
Let me briefly explain my issue, I've like 60 pro-minis in that 30 are loaded with some code previously(and all are working fine), now I've lost the code because of my HDD issue(unfortunately I don't have a backup) now the things is I've to code the remaining pro-mini with the same code, I tried to retrieve the code using AVR Dude but I was getting this not in a sync error. later I tried to upload using a blink program from IDE and cmd line too still I was getting the same error while uploading. So, I tried with another Promini to my surprise same error and another and another I tried all 30 pro-minis all are giving me the same error (All 60 pro--minis are from the same vendor), I tried to upload the blink program to the remaining 30 prominis it worked like a charm. I don't know why the heck, those pms are not syncing. I tried uploading in different ways all to vein.
What I observed is the pm's reset led blinks rapidly for few seconds whenever I connect power and when I press the reset button and while uploading too.
Please help me out here
Here are things I've tried:
I tried to upload using Arduino uno, Mega, USB - TTL, FTDI...
changed the USB cable.
tried with a different computer.
Nothing worked with the preloaded pms but worked with empty pms. I went through a lot of posts for around two weeks nothing worked.
Below is the error message
Arduino: 1.8.13 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (5V, 16 MHz)"
Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM11 -b57600 -D -Uflash:w:C:\Users\BJI\AppData\Local\Temp\arduino_build_411622/sketch_apr15a.ino.hex:i
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM11
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xce
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xf7
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x6b
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xa8
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xee
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x4f
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xa8
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xbe
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xed
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x9e
avrdude done. Thank you.
An error occurred while uploading the sketch
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Solved by using Arduino as ISP programmer. If I try to upload directly it was throwing error but when I upload using a ISP Programmer it works.

Arduino Nano cannot upload sketch

I have tested a circuit with an arduino nano. Afterwards I created a pcb with the ATMega328 on it and with the exactly same circuit.
If I try to upload my sketch now I get this Error msg.
Thank you for your help in advance.
`
Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"
Sketch uses 9704 bytes (31%) of program storage space. Maximum is 30720 bytes.
Global variables use 390 bytes (19%) of dynamic memory, leaving 1658 bytes for local variables. Maximum is 2048 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM7 -b57600 -D -Uflash:w:C:\Users\loren\AppData\Local\Temp\arduino_build_829064/slave_test_with_arduino.ino.hex:i
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM7
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x55
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x55
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x55
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x55
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x55
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x55
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x55
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x55
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x55
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x55
avrdude done. Thank you.
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
`
Try the following, this should work.
Remove connections to the board pins, especially the 0 (RX) and 1 (TX) digital pins while uploading.
The above thing worked for me, after uploading again make connections to those pins.
If this is not helpful check the following :-
1. Check your board and port selections :- In the top menu bar, make sure the correct board is selected in Tools > Board, and that you’ve selected the right port in Tools > Port. Try disconnecting and reconnecting your board if you’re unsure which port is being used (close and reopen the Port menu to refresh the list). For more information, see Select the right port and board.
2. Check your sketch for errors :- Click the Verify button Verify button to compile your sketch without uploading it. If you still get an error, see Compilation errors when uploading.
3. Check your connections :- Your board needs to be connected with a data USB cable (charge-only cables will not work). Make sure the cable is fully inserted in the port on each end. Try a different USB cable, and avoid hubs and other adapters if possible. Remove connections to the board pins, especially the 0 (RX) and 1 (TX) digital pins.
For further help refer this
https://support.arduino.cc/hc/en-us/articles/4403365313810-Errors-when-uploading-a-sketch

Code is not uploading in new aurdino mega

I am new(new purched board and me also) in arduino programming. when I am uploading my code in ardino mega board (using Aurdino 1.8.2) i am getting following error
Arduino: 1.8.2 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
Sketch uses 1482 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM3 -b115200 -D -Uflash:w:C:\Users\Admin\AppData\Local\Temp\arduino_build_393128/Blink.ino.hex:i
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM3
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
An error occurred while uploading the sketch
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude done. Thank you.
How i solve this problem.
My setting are as follows
.
rest of them are as default. also my driver are up to date in device manager.
First, try a loopback test. If that fails, you have a problem with the hardware most likely. If it passes, try replacing the avr directory with another version. Additionally, if pins 1 or 0 are connected to anything, this error could be caused. That is because these pins are used for Tx/Rx. Additionally, the bootloader for the mega will break if you use !!! in your code. If all of that fails to help, try reinstalling the FTDI drivers.

Arduino Ethernet - unable to upload stk500_getsync() not in sync: resp=0x01

First of all I did a big Research session before asking here but I didn't found a solution to fix my Problem.
I have the Arduino Ethernet chip and I have downloaded the latest Beta from the Arduino SDK (I also tried it with the latest stable, same result)
Now when I try to compile it says the following:
avrdude: Version 6.0.1, compiled on Apr 3 2014 at 23:12:16
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf"
Using Port : COM8
Using Programmer : arduino
Overriding Baud Rate : 115200 avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not responding avrdude:
stk500_recv(): programmer is not responding avrdude: stk500_getsync()
attempt 1 of 10: not in sync: resp=0x01
[...]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding avrdude:
stk500_getsync() attempt 10 of 10: not in sync: resp=0x01
avrdude done. Thank you.
Yep, I have selected the rigth board, yep I have selected the rigth comport, nope, there is no cable in Output 1 or 2.
I have also tried it with the eclipse plugin, same resulte (due it's the same SDK)
My OS: Windows 8.1 x64
My Programmer: Diamex-AVR
to the programmers.txt file I added this code:
diamexavr.name=DIAMEX-AVR
diamexavr.communication=Serial
diamexavr.protocol=stk500v2
Any ideas?
Thanks in Advance,
Spider

Arduino nano 3 - avrdude: stk500_getsync(): not in sync: resp=0x00

I have got an arduino nano v 3.0.
When I tried to install drivers using arduino installation folder, it not shows any driver for nano board. I installed the driver from FTDI website.
When i upload the program to board, it's uploaded correctly, but the program is not working. IDE shows the error
avrdude: stk500_getsync(): not in sync: resp=0x00
at console after uploading the program to board.
My OS is Win 8.1 64 bit
Solution for my problem with Nano clone (based on CH340 not FTDI) was to change baud rate to 57600.
Following command line works for me:
avrdude.exe -v -P COM3 -c arduino -p atmega328p -b57600 ...
I was able to fix this by selecting the right board that I was using from the Tools Menu. Tools>Boards>Arduino Model
I had the same problem with a nano chinese clone with the 340. The solution for me was to reset the baud rate in device manager to 57600. At first it did not work until I pressed the reset on the nano. Bottom line baud rate to 57600 press reset before uploading.
i have removed all drivers available in computer currentely for arduino connecitn while it is connected to computer.
installed this file
http://www.ftdichip.com/Drivers/CDM/CDM20824_Setup.exe
It worked perfect.

Resources