Go Down

Topic: Uploading sketch problem (Read 237 times) previous topic - next topic

Blake-Cobalt

HI, I am brand new to arduino and I am in need of some assistance. When I try to upload the sketch I get a "Problem uploading to board." error. Here are the error messages:
Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino Nano, ATmega328P"

C:\Users\Dr-Wh\Desktop\Full_Phaser_1\Full_Phaser_1.ino: In function 'setup':

C:\Users\Dr-Wh\Desktop\Full_Phaser_1\Full_Phaser_1.ino:35:21: warning: iteration 10 invokes undefined behavior [-Waggressive-loop-optimizations]

     pinMode(ledPin,OUTPUT);

                     ^

C:\Users\Dr-Wh\Desktop\Full_Phaser_1\Full_Phaser_1.ino:33:3: note: containing loop

   for (int i = 0; i < 11; i++)

   ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\main.cpp: In function 'main':

C:\Users\Dr-Wh\Desktop\Full_Phaser_1\Full_Phaser_1.ino:35:21: warning: iteration 10 invokes undefined behavior [-Waggressive-loop-optimizations]

     pinMode(ledPin,OUTPUT);

                     ^

C:\Users\Dr-Wh\Desktop\Full_Phaser_1\Full_Phaser_1.ino:33:3: note: containing loop

   for (int i = 0; i < 11; i++)

   ^

Sketch uses 5150 bytes (16%) of program storage space. Maximum is 30720 bytes.
Global variables use 285 bytes (13%) of dynamic memory, leaving 1763 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x16
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x16
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x16
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x16
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x16
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x16
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x16
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x16
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x16
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x16
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.


Any help is appreciated thanks :)

Column01

What programmer do you have selected? This is the one you should have selected if I remember correctly. Can be found in: Tools -> Programmer in the Arduino IDE v1.8.5

Blake-Cobalt

I have AVRISP mkll  selected.

ballscrewbob

Get rid of the window store app and download the proper IDE.
Many people have mentioned issues with the APP version and most seem to be OK once they go to the real IDE.

The programmer wont matter for the NANO as the IDE will use what it needs in that regard.


It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

Blake-Cobalt

Ok, thanks for all the suggestions, nothing I do works, it might be worth noting that I have a CH340G chip on the NANO. This is the most recent error...

Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino Nano, ATmega328P"

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware -hardware C:\Users\Dr-Wh\Documents\ArduinoData\packages -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools C:\Users\Dr-Wh\Documents\ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\Dr-Wh\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10805 -build-path C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095 -warnings=none -build-cache C:\Users\Dr-Wh\AppData\Local\Temp\arduino_cache_32990 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.avr-gcc.path=C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -verbose C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\examples\01.Basics\Fade\Fade.ino
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\arduino-builder -compile -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware -hardware C:\Users\Dr-Wh\Documents\ArduinoData\packages -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools C:\Users\Dr-Wh\Documents\ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\Dr-Wh\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10805 -build-path C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095 -warnings=none -build-cache C:\Users\Dr-Wh\AppData\Local\Temp\arduino_cache_32990 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.avr-gcc.path=C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -verbose C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\examples\01.Basics\Fade\Fade.ino
Using board 'nano' from platform in folder: C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21
Using core 'arduino' from platform in folder: C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21
Detecting libraries used...
"C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR   "-IC:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\variants\eightanaloginputs" "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095\sketch\Fade.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR   "-IC:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\variants\eightanaloginputs" "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095\sketch\Fade.ino.cpp" -o "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR   "-IC:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\variants\eightanaloginputs" "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095\sketch\Fade.ino.cpp" -o "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095\sketch\Fade.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095/Fade.ino.elf" "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095\sketch\Fade.ino.cpp.o" "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095/..\arduino_cache_32990\core\core_arduino_avr_nano_cpu_atmega328_d9660dada2dcd9910c298792dbc774be.a" "-LC:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095" -lm
"C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095/Fade.ino.elf" "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095/Fade.ino.eep"
"C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -R .eeprom  "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095/Fade.ino.elf" "C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095/Fade.ino.hex"
Sketch uses 1150 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 13 bytes (0%) of dynamic memory, leaving 2035 bytes for local variables. Maximum is 2048 bytes.
C:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino9/bin/avrdude -CC:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf -v -patmega328p -carduino -PCOM5 -b115200 -D -Uflash:w:C:\Users\Dr-Wh\AppData\Local\Temp\arduino_build_772095/Fade.ino.hex:i
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

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:\Users\Dr-Wh\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf"

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200

ballscrewbob

#5
Feb 26, 2018, 03:26 am Last Edit: Feb 26, 2018, 03:26 am by ballscrewbob
What usually works for most is to get the official CH340/341 drivers from here

Mileage on the next two steps varies a little but I always do both and have had no issues.

Turn OFF driver enforcement
Install the drivers as ADMINISTRATOR

Both those steps turn up easy in a google search.

You should be seeing the CH340 device in a similar fashion to the picture below (but not as many LOL)

It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

Go Up