Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Teensy 4.0 - On Program/Reboot Teensy loses power & disconnects! (Beginner)

  1. #1
    Junior Member
    Join Date
    Dec 2019
    Posts
    15

    Teensy 4.0 - On Program/Reboot Teensy loses power & disconnects! (Beginner)

    Hello PJRC!

    I got a Teensy 4.0 and soldered on the audio shield, following this tutorial: https://www.youtube.com/watch?v=UJcZxyB5rVc

    Everything seemed fine, I plugged it in to my computer, the driver automatically was installed and the red light on the Teensy began flashing, running what I assumed was the default blinking program. I downloaded and was able to also program the fast blinking hex. When I tried to switch back to the original blinking program, nothing would happen.

    Now, when I plug the Teensy in, my computer will recognize that the device is there, but the red light doesn't come on like it did before. When I press the button on the board, the red light comes and stays on and my computer will once again make the sound that a hardware device has been plugged in. The Teensy Loader application will recognize the board, and when I program the file, the file name will appear at the bottom of the Teensy Loader window. When I click either Reboot or Auto, it disconnects, the light turns off and nothing happens. If I click the button on the board again (not in Auto mode), it will reconnect and the red light stays on. IfI'm in auto, pressing the button will reconnect the Teensy by USB, bring up the Programming loading bar, show a message saying 'Reboot Ok', and on the board the red light will quickly turn much brighter before the board disconnects and the red light turns off.

    Hope I provided ample detail, like the title says I'm a noob to all this stuff so any help is extra appreciated!

    Will be happy to clarify any additional details.

    Thanks!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,128
    Red LED blinking (slowly) means something is wrong with the USB cable or port. It only does the slow blink when you're in bootloader mode, but your PC hasn't performed any USB communication, not even enumeration to detect which USB device is connected. Normally this should never happen with a good USB cable, because the first thing your PC does when it sees a newly connect USB device is the enumeration process to detect which USB device it really is.

    Usually that red LED blink is caused by a charge-only cable. Clearly your USB cable has data wires since it is able to communicate sometimes. Still, as a first step I'd recommend getting another USB cable. If you have a flaky USB cable, which is very likely if you're seeing the slow red LED blink, more troubleshooting with the same cable is only going to cause you a lot more frustration.

  3. #3
    Junior Member
    Join Date
    Dec 2019
    Posts
    15
    Quote Originally Posted by PaulStoffregen View Post
    Red LED blinking (slowly) means something is wrong with the USB cable or port. It only does the slow blink when you're in bootloader mode, but your PC hasn't performed any USB communication, not even enumeration to detect which USB device is connected. Normally this should never happen with a good USB cable, because the first thing your PC does when it sees a newly connect USB device is the enumeration process to detect which USB device it really is.

    Usually that red LED blink is caused by a charge-only cable. Clearly your USB cable has data wires since it is able to communicate sometimes. Still, as a first step I'd recommend getting another USB cable. If you have a flaky USB cable, which is very likely if you're seeing the slow red LED blink, more troubleshooting with the same cable is only going to cause you a lot more frustration.


    Thanks for the reply Paul. I'm not seeing a slow red LED blink. Also the Teensy is showing up as a USB device when its plugged in (Teensy USB Serial). What is happening is as follows:

    When I press the button on the board, the red light comes and stays on and my computer will once again make the sound that a hardware device has been plugged in. The Teensy Loader application will recognize the board, and when I program the file, the file name will appear at the bottom of the Teensy Loader window. When I click either Reboot or Auto, it disconnects, the light turns off and nothing happens. If I click the button on the board again (not in Auto mode), it will reconnect and the red light stays on. IfI'm in auto, pressing the button will reconnect the Teensy by USB, bring up the Programming loading bar, show a message saying 'Reboot Ok', and on the board the red light will quickly turn much brighter before the board disconnects and the red light turns off.

    Does the Teensy 4.0 need to be connected to 3.3V power to run the loaded program? I had believed that power supply from the USB was good enough.

    Thanks so much again for the reply and helping me figure this out

  4. #4
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    329
    Does it work with the blink example program and nothing connected to it?

  5. #5
    Junior Member
    Join Date
    Dec 2019
    Posts
    15
    Quote Originally Posted by jonr View Post
    Does it work with the blink example program and nothing connected to it?
    When I first connected it to my computer it did. Somewhere during the course of me attempting to switch between the fast blink and slow blink programs is when I began to experience the issue noted above.

    I've only been trying to power it with the USB port so far, including it with a 5V power block in an outlet directly to the Teensy USB port. I haven't tried with a 3.3V power supply.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,128
    Quote Originally Posted by bigtony View Post
    The Teensy Loader application will recognize the board, and when I program the file, the file name will appear at the bottom of the Teensy Loader window. When I click either Reboot or Auto, it disconnects, the light turns off and nothing happens. If I click the button on the board again (not in Auto mode), it will reconnect and the red light stays on. IfI'm in auto, pressing the button will reconnect the Teensy by USB, bring up the Programming loading bar, show a message saying 'Reboot Ok', and on the board the red light will quickly turn much brighter before the board disconnects and the red light turns off.
    Everything you've described sounds like Teensy 4.0 is working perfectly, but you're programming a HEX file onto it which does nothing.

    On this page, you can download known-good HEX files. Click the "LED Blink, Both Slow & Fast" link.

    https://www.pjrc.com/teensy/loader_win10.html

    When you extract this ZIP file, you'll see it has blink fast and blink slow files for every Teensy board. In Teensy Loader, click File > Open, and then open either "blink_fast_Teensy40.hex" or "blink_slow_Teensy40.hex".

    You'll see the ZIP also contains .elf files for each .hex file. If you keep these together, Teensy Loader also looks at the .elf file to check that it really matches the Teensy model you're programming. So if you try to use "blink_fast_Teensy36.hex", as long as "blink_fast_Teensy36.elf" is in the same folder, Teensy Loader will know you have the wrong board and it will not program your Teensy 4.0 with the wrong data. However, if you don't have the .elf file, then Teensy Loader has much less info... and it will program whatever data happens to be "blink_fast_Teensy36.hex" onto your Teensy 4.0. Obviously that won't work and Teensy 4.0 will do nothing when it reboots... exactly the behavior you're seeing, which is why I'm writing this to explain.

    Use Teensy Loader to program either of those known-good hex files onto your Teensy 4.0 and I'm confident it will blink the orange LED when it reboot to run the program.

    Also, Teensy 4.0 has a special 15 second restore feature. It has a copy of the slow LED blink permanently stored. If you hold the button on Teensy 4.0 for 15 seconds, it will give you a quick flash at the 15 second time, and release the button within a couple seconds of that moment, it will do a full erase of the memory and restore that LED blink program. You'll see the red LED bright while it's doing the erase and restore.

  7. #7
    Junior Member
    Join Date
    Dec 2019
    Posts
    15
    Thanks for the help Paul. Using the hex file for the 4.0 worked! I must have been using an old version of the blink code that wasn't working.

    I'm trying to make sure I soldered the Audio Shield correctly, now attempting to run code that will help me test this. Right now I'm trying to load this code from the video I linked in my OP:

    Code:
    // Teensy-Synth Part 1 
    // Basic test program
    // By Notes and Volts
    // www.notesandvolts.com
    
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioSynthWaveform       waveform1;      //xy=429,378
    AudioOutputI2S           i2s1;           //xy=747,377
    AudioConnection          patchCord1(waveform1, 0, i2s1, 0);
    AudioConnection          patchCord2(waveform1, 0, i2s1, 1);
    AudioControlSGTL5000     sgtl5000_1;     //xy=588,480
    // GUItool: end automatically generated code
    
    
    void setup() {
      Serial.begin(9600);
      AudioMemory(20);
      sgtl5000_1.enable();
      sgtl5000_1.volume(0.32);
      waveform1.begin(WAVEFORM_SAWTOOTH);
      waveform1.amplitude(0.75);
      waveform1.frequency(50);
      waveform1.pulseWidth(0.15);
    }
    
    void loop() {
     for(int freq = 50; freq <= 500; freq++){
      waveform1.frequency(freq);
      delay(10);
     }
    }
    Any idea why nothing is happening when I reboot my Teensy with this code? Would you happen to have any hex files for the 4.0 on hand that I could use to test that my Audio Shield is installed properly?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •