Shiny new error uploading code?

Status
Not open for further replies.

ljdankov

Member
Howdy all,
I am working with a teensy 3.2 in the Arduino IDE environment (Arduino 1.8.5, Teensyduino 1.41).

Just went to upload a slight modification of the code that I have been working on and got the error below. I then tried uploading the blink example (the simplest hello world I could think of) both to it and a backup teensy 3.2. And tried rebooting computer. All resulted inn error below consistently.Oddly, changing the USB type under tools from 'Serial' to 'All the things' seems to allow me to upload code fine. Any idea what is going on?


Linking everything together...
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-gcc" -O2 -Wl,--gc-sections,--relax,--defsym=__rtc_localtime=1519406355 "-TC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/mk20dx256.ld" -lstdc++ -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -o "C:\Users\shado\AppData\Local\Temp\ArduinoServer\MW/arr_loop_allpins.ino.elf" "C:\Users\shado\AppData\Local\Temp\ArduinoServer\MW\sketch\arr_loop_allpins.ino.cpp.o" "C:\Users\shado\AppData\Local\Temp\ArduinoServer\MW/..\..\arduino_cache_279896\core\core_teensy_avr_teensy31_usb_serial,speed_72,opt_o2std,keys_en-us_4939f5412a75a8560acb0f9e98268f02.a" "-LC:\Users\shado\AppData\Local\Temp\ArduinoServer\MW" -larm_cortexM4l_math -lm
C:\Users\shado\AppData\Local\Temp\ArduinoServer\MW/..\..\arduino_cache_279896\core\core_teensy_avr_teensy31_usb_serial,speed_72,opt_o2std,keys_en-us_4939f5412a75a8560acb0f9e98268f02.a(mk20dx128.c.o): In function `ResetHandler':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/mk20dx128.c:1130: undefined reference to `main'

C:\Users\shado\AppData\Local\Temp\ArduinoServer\MW/..\..\arduino_cache_279896\core\core_teensy_avr_teensy31_usb_serial,speed_72,opt_o2std,keys_en-us_4939f5412a75a8560acb0f9e98268f02.a(pins_teensy.c.o): In function `delay':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/pins_teensy.c:1197: undefined reference to `yield'

collect2.exe: error: ld returned 1 exit status

Error compiling for board Teensy 3.2 / 3.1.
 
#define BTserial Serial2
int readPins[]={0,1,15,16,17,18,19,22,23,25,32,33}; // on breadboard these correspond to 27,26, 23, 22, 20, 19,9,10
int selectPins[]={0,1,2,3,4,5,6,7,8,9,10,11};//all possible pins
void setup() {BTserial.setRX(26); BTserial.setTX(31);BTserial.begin(9600);
Serial.begin(9600);}

void loop() {
int arrSize = sizeof(selectPins) / sizeof( int );
int x=0;
int currentRead=0;
while(x<arrSize){// cycle through set of pins to be
currentRead=touchRead(readPins[selectPins[x]]);
BTserial.print(currentRead); Serial.print(currentRead);
if (x<arrSize-1){BTserial.print(","); Serial.print(",");}
else{BTserial.println();Serial.println();}
x++;
delay(50);}
}
 
Should be noted that Blink generates same error
/* LED Blink, Teensyduino Tutorial #1
http://www.pjrc.com/teensy/tutorial.html

This example code is in the public domain.
*/

// Teensy 2.0 has the LED on pin 11
// Teensy++ 2.0 has the LED on pin 6
// Teensy 3.x / Teensy LC have the LED on pin 13
const int ledPin = 13;

// the setup() method runs once, when the sketch starts

void setup() {
// initialize the digital pin as an output.
pinMode(ledPin, OUTPUT);
}

// the loop() methor runs over and over again,
// as long as the board has power

void loop() {
digitalWrite(ledPin, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(ledPin, LOW); // set the LED off
delay(1000); // wait for a second
}
 
This certainly looks like one or more files inside Arduino or perhaps the compiled code in the temp directory may have been corrupted.

I highly recommend making a backup of all important data from your PC as soon as possible, if you don't have a recent backup. This may be a random problem, or there may be some difficult-to-understand cause, but it may be a sign of PC serious trouble to come. Could be hardware, could be malware at work, could be other buggy software?

After making a backup, try reinstalling Teensyduino. It's fine to install again into the same copy of Arduino. The installer will re-write all the files. If something has been corrupted, that will give you a fresh copy. Windows Defender and various anti-virus programs are notorious for interfering with installers. You may need to temporarily disable them. The Teensyduino installer doesn't use any networking, so you can temporarily unplug from the internet to be save with the anti-malware turned off.
 
This certainly looks like one or more files inside Arduino or perhaps the compiled code in the temp directory may have been corrupted.

I highly recommend making a backup of all important data from your PC as soon as possible, if you don't have a recent backup. This may be a random problem, or there may be some difficult-to-understand cause, but it may be a sign of PC serious trouble to come. Could be hardware, could be malware at work, could be other buggy software?

After making a backup, try reinstalling Teensyduino. It's fine to install again into the same copy of Arduino. The installer will re-write all the files. If something has been corrupted, that will give you a fresh copy. Windows Defender and various anti-virus programs are notorious for interfering with installers. You may need to temporarily disable them. The Teensyduino installer doesn't use any networking, so you can temporarily unplug from the internet to be save with the anti-malware turned off.

Hi Paul,
This could well be a matter of having too many devices that have overwritten each other in Arduino. In past month or two I have been working with a variety of boards running from ESP 32 to various flavors of Teensy to Adafruit to plain old Arduino. It is conceivable that the combination of installers has corrupted a few files within Arduinos directories. At any rate rerunning the Teensy installer seems to have done the job.
 
Status
Not open for further replies.
Back
Top