Blink sketch does nothing on Teensy 4.1

Status
Not open for further replies.

hrglc

New member
I'm trying to upload the default blink sketch:
Code:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

When I upload it to the Teensy it does nothing. Probing pin 13 with an oscilloscope shows it remains at LOW. When I try to upload it, the IDE says there is an error but pressing the programming button on the Teensy allows the upload to continue. I am not able to select the port the Teensy is connected to from inside the IDE unless the button has been pressed. I am using a fresh install of the Arduino IDE and Teensyduino on a x64 Linux system. UDEV rules are set up correctly. I have tried this on two Teensy 4.1 boards and they are both displaying the same behavior. Connecting to a different port on my computer does not help. Using another (x64 Linux) computer does not help. Restarting my computer does not help.
 
I think I found the problem, it appears that setting the optimization to "Debug" causes the sketch to not work properly.
 
By default a Teensy will ship with a default program that does not communicate using USB...

For a new Teensy, I will typically do something like:
Load up that blink sketch,
In the Arduino IDE, do a Verify/Compile command, which should complete and bring up the Teensy program. With the Teensy program visible, press the program button on the Teensy and it should upload that program and start blinking...

If for some reason this fails, then, I will try plugging in the Teensy to USB while holding in the program button, and try the upload command again...

If this fails, I reset the Teensy to it's shipping program, by holding in the program button for something like 20 seconds, until the small led near the USB blinks and then release. The Teensy bootloader will then reprogram the Teensy using a saved blink program back to the original state... At which point you should be able to do the first step again which should assign the /dev/ttyACMx and the like..... (Assuming you have the USB Type to one of the types that also does serial)...

If all else fail, there are a few other threads talking about steps.

Also if still failing might help to see some status information from your machine.

Things like plug in the Teensy and then in terminal window commands like:
lsusb
dmesg | tail -30
...
 
Status
Not open for further replies.
Back
Top