Upload produces error message but still succeeds

Status
Not open for further replies.

bmears

New member
I'm finally trying out a Teensy 3.2 I've had on the shelf for a while and am getting a minor issue. Using Arduino 1.8.9 on Linux Mint, uploading a simple sketch works - the LED flashes at the rate specified in the program. However, I always get an error message in the IDE: "An error occurred while uploading the sketch"

The fact that the sketch actually loads and executes is good but I'm wondering if there is some subtle error going on that I need to address.

Thanks in advance for any help you can provide.

/*
Blink
*/
#include <Arduino.h>

const int led = LED_BUILTIN;

void setup() {
pinMode(led, OUTPUT);
}

void loop() {
for (int ii=0; ii<3; ++ii)
{
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200);
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(200);
}
delay(1000);
}




#################### Output from build process

/mnt/vol1/work/opt/arduino-1.8.9/arduino-builder -dump-prefs -logger=machine -hardware /mnt/vol1/work/opt/arduino-1.8.9/hardware -hardware /home/brad/.arduino15/packages -tools /mnt/vol1/work/opt/arduino-1.8.9/tools-builder -tools /mnt/vol1/work/opt/arduino-1.8.9/hardware/tools/avr -tools /home/brad/.arduino15/packages -built-in-libraries /mnt/vol1/work/opt/arduino-1.8.9/libraries -libraries /work/brad/dev/Arduino/libraries -fqbn=teensy:avr:teensy31:usb=serial,speed=72,opt=o2std,keys=en-us -ide-version=10809 -build-path /tmp/arduino_build_362599 -warnings=default -build-cache /tmp/arduino_cache_441330 -verbose /work/brad/dev/Arduino/MyExamples/MyBlink/MyBlink.ino
/mnt/vol1/work/opt/arduino-1.8.9/arduino-builder -compile -logger=machine -hardware /mnt/vol1/work/opt/arduino-1.8.9/hardware -hardware /home/brad/.arduino15/packages -tools /mnt/vol1/work/opt/arduino-1.8.9/tools-builder -tools /mnt/vol1/work/opt/arduino-1.8.9/hardware/tools/avr -tools /home/brad/.arduino15/packages -built-in-libraries /mnt/vol1/work/opt/arduino-1.8.9/libraries -libraries /work/brad/dev/Arduino/libraries -fqbn=teensy:avr:teensy31:usb=serial,speed=72,opt=o2std,keys=en-us -ide-version=10809 -build-path /tmp/arduino_build_362599 -warnings=default -build-cache /tmp/arduino_cache_441330 -verbose /work/brad/dev/Arduino/MyExamples/MyBlink/MyBlink.ino
Using board 'teensy31' from platform in folder: /mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/avr
Using core 'teensy3' from platform in folder: /mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/avr
Detecting libraries used...
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=146 -DARDUINO=10809 -DF_CPU=72000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/avr/cores/teensy3 /tmp/arduino_build_362599/sketch/MyBlink.ino.cpp -o /dev/null
Generating function prototypes...
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=146 -DARDUINO=10809 -DF_CPU=72000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/avr/cores/teensy3 /tmp/arduino_build_362599/sketch/MyBlink.ino.cpp -o /tmp/arduino_build_362599/preproc/ctags_target_for_gcc_minus_e.cpp
/mnt/vol1/work/opt/arduino-1.8.9/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_362599/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/precompile_helper /mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/avr/cores/teensy3 /tmp/arduino_build_362599 /mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=146 -DARDUINO=10809 -DF_CPU=72000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/avr/cores/teensy3 /tmp/arduino_build_362599/pch/Arduino.h -o /tmp/arduino_build_362599/pch/Arduino.h.gch
Using previously compiled file: /tmp/arduino_build_362599/pch/Arduino.h.gch
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=146 -DARDUINO=10809 -DF_CPU=72000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/tmp/arduino_build_362599/pch -I/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/avr/cores/teensy3 /tmp/arduino_build_362599/sketch/MyBlink.ino.cpp -o /tmp/arduino_build_362599/sketch/MyBlink.ino.cpp.o
Compiling libraries...
Compiling core...
Using precompiled core: /tmp/arduino_cache_441330/core/core_teensy_avr_teensy31_usb_serial,speed_72,opt_o2std,keys_en-us_020211ef3f0f2ff6d5b1dfaef63e479d.a
Linking everything together...
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-gcc -O2 -Wl,--gc-sections,--relax,--defsym=__rtc_localtime=1556232004 -T/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/avr/cores/teensy3/mk20dx256.ld -lstdc++ -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -o /tmp/arduino_build_362599/MyBlink.ino.elf /tmp/arduino_build_362599/sketch/MyBlink.ino.cpp.o /tmp/arduino_build_362599/../arduino_cache_441330/core/core_teensy_avr_teensy31_usb_serial,speed_72,opt_o2std,keys_en-us_020211ef3f0f2ff6d5b1dfaef63e479d.a -L/tmp/arduino_build_362599 -larm_cortexM4l_math -lm
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/arduino_build_362599/MyBlink.ino.elf /tmp/arduino_build_362599/MyBlink.ino.eep
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-objcopy -O ihex -R .eeprom /tmp/arduino_build_362599/MyBlink.ino.elf /tmp/arduino_build_362599/MyBlink.ino.hex
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/stdout_redirect /tmp/arduino_build_362599/MyBlink.ino.lst /mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-objdump -d -S -C /tmp/arduino_build_362599/MyBlink.ino.elf
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/stdout_redirect /tmp/arduino_build_362599/MyBlink.ino.sym /mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-objdump -t -C /tmp/arduino_build_362599/MyBlink.ino.elf
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/teensy_post_compile -file=MyBlink.ino -path=/tmp/arduino_build_362599 -tools=/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/ -board=TEENSY31
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/arm/bin/arm-none-eabi-size -A /tmp/arduino_build_362599/MyBlink.ino.elf
Sketch uses 9376 bytes (3%) of program storage space. Maximum is 262144 bytes.
Global variables use 3436 bytes (5%) of dynamic memory, leaving 62100 bytes for local variables. Maximum is 65536 bytes.
/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools/teensy_post_compile -file=MyBlink.ino -path=/tmp/arduino_build_362599 -tools=/mnt/vol1/work/opt/arduino-1.8.9/hardware/teensy/../tools -board=TEENSY31 -reboot -port=/dev/ttyACM0 -portlabel=(null) -portprotocol=(null)
An error occurred while uploading the sketch
 
Are you sure that the sketch really did upload correctly? If you are uploading the same sketch as was in there before, maybe the upload fails and the T3.2 is running what was already loaded.
Try changing the first delay(200) to delay(1000) so that the LED should stay on for a second to make it obvious when it has uploaded.

Pete
 
Yes, I am sure that the new code is getting executed. Each time I uploaded, I varied the blink pattern by modifying the loop counter and/or delay time periods. Each time, I received the error message but the blink pattern changed to what I expected. I went through this process 6 - 8 times.
 
Status
Not open for further replies.
Back
Top