Teensy 4.1 only works if powered by USB cable

Steve_C

Member
Hello,
I restarted a project again that uses a custom PCB to interface (and power) my Teensy 4.1. No luck communicating over USB when powered by my board. To narrow down the problem, I took a brand new Teensy 4.1 purchased from Digikey a few months ago and downloaded the attached test program using a standard, unmodified 18" USB cable. Teensy was not installed in any PCB at this time and worked as expected. I then took another USB cable (that worked before I modified it) and cut the +5V wire in it. I supplied 5V from a Rigol DP832A to the 5V pin in the corner by the USB connector and ground to the pin next to it. Device manager shows a "USB Serial Device (COM5)" just like before, Arduino under Tools/Port shows "COM5 (Teensy)" but when I try to re-download the program I get:

Teensy did not respond to a USB-based request to enter program mode.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

Pressing the button I get two red flashes from the LED by the USB port and did not help trying to program. Trying to open the Arduino Serial Monitor I see "TeensyMonitor: COM5 Offline". Note: for this test I did not cut the trace on the bottom to separate the 5V from the USB cable and 5V from the 5V pin in the corner. I suspect if I do cut the trace on this test Teensy, use an unmodified USB cable and power it from the Rigol power supply I will get similar results.

For the Teensy 4.1s I've previously used for my project in my custom PCB I did cut this trace, all worked as you might expect. Now those Teensys have similar behavior as above. I took one of them and soldered a bridge over the cut trace, it it works fine with an unmodified USB cable but not with my modified USB cable, powered from my Rigol DP832A. This is using a Windows 10 desktop (that I have used for this project before). I get the same results from a Windows 10 laptop, which also worked before. I've tried several different unmodified cables with the Teensy with the trace cut in my PCB, so I don't believe my troubles are due to a too long or low quality USB cable.

Any suggestions?
- Steve
 

Attachments

  • Teensy_printf_test.ino
    417 bytes · Views: 8
Note: your sketch has:
while (!Serial);

Which will hang there until the USB is plugged in and probably a serial monitor....
 
Yes, thank you. I wanted to determine when USB communication would be established. When I plug it in with no terminal open, nothing happens. When I open TeraTerm or the Serial Monitor right away the orange LED starts blinking and I get the test message.
 
2 blinks means no JTAG connectivity between U1 and U2. Maybe the board got damaged during soldering or handling? Visually inspecting the area between those 2 chips with a magnifier and bright light might be a good idea. Or swap that Teensy out with a new one.

In this broken state, the board will probably manage to run previously loaded code. But programming new code won't be possible.
 
Yes, thank you. I wanted to determine when USB communication would be established. When I plug it in with no terminal open, nothing happens. When I open TeraTerm or the Serial Monitor right away the orange LED starts blinking and I get the test message.
Typically you want to use code like:

Code:
  while (!Serial && millis () < 3000)
    ;

This will wait up to 3 second for the USB to be connected, and if not continue on. Otherwise, it will hang forever until you connect the USB cable.
 
Note: your sketch has:
while (!Serial);

Which will hang there until the USB is plugged in and probably a serial monitor....

2 blinks means no JTAG connectivity between U1 and U2. Maybe the board got damaged during soldering or handling? Visually inspecting the area between those 2 chips with a magnifier and bright light might be a good idea. Or swap that Teensy out with a new one.
Thank you for the quick reply. The Teensy I used for this test today was brand new, just out of the anti-static bag and foam, and no soldering was done to it. Yesterday I saw the same behavior with the older teensys (the double blink when I press the button).
- Steve
 
It is theoretically possible (but unlikely) for code running on the board to interfere with JTAG between the chips.

Teensy 4 has a special restore process which wipes the flash memory and writes a known-good LED blink, the same as when shipped by PJRC. To do this, hold the pushbutton for 13 to 17 seconds. At the 13 second point, the red LED gives a quick blink to let you know you're at the beginning of the 4 second window.

If your hardware is still intact, you'll see the red LED turn on bright while it slowly wipes the memory. This process takes over 1 minute (far longer than my attention span) so please let it slowly complete. When finished, your Teensy should reboot and you'll see the orange LED blinking. As when Teensy was new, it will appear to your PC as a HID device (not serial). Arduino IDE should recognize and show it in the menu. Upload should work.

If your hardware is damaged, you'll see the quick blink at 13 seconds, but then the red LED will not stay on because U2 can't access anything on U1 and U3 to actually perform the erase and restore.
 
It is theoretically possible (but unlikely) for code running on the board to interfere with JTAG between the chips.

Teensy 4 has a special restore process which wipes the flash memory and writes a known-good LED blink, the same as when shipped by PJRC. To do this, hold the pushbutton for 13 to 17 seconds. At the 13 second point, the red LED gives a quick blink to let you know you're at the beginning of the 4 second window.

If your hardware is still intact, you'll see the red LED turn on bright while it slowly wipes the memory. This process takes over 1 minute (far longer than my attention span) so please let it slowly complete. When finished, your Teensy should reboot and you'll see the orange LED blinking. As when Teensy was new, it will appear to your PC as a HID device (not serial). Arduino IDE should recognize and show it in the menu. Upload should work.

If your hardware is damaged, you'll see the quick blink at 13 seconds, but then the red LED will not stay on because U2 can't access anything on U1 and U3 to actually perform the erase and restore.

Thanks. I made the change MichaelMeissner suggested. Now when I power up the Teensy with with an unmodified cable (no terminal program open) it waits 3 seconds and then starts blinking. If I then remove the USB cable and power it from my new (few months old) Rigol power supply (as described in the first post) nothing happens until I press the button, then get the double red blink. Remove the Rigol connections, plug it back into an unmodified USB cable and it works as expected again (Orange LED blinking). I'm beginning to suspect my power supply... My Fluke 87 reads 4.994V at the Teensy, 3.299V on the 3.3V pin. Now to find a different power supply. I might also try adding a decoupling cap between the 5V and ground on the Teensy. For what it's worth, the Rigol says the Teensy is drawing 37mA when it is powering it.

 
Ugh! I had the current limit set to 0.1A on the Rigol. When I bump it up to 0.25A, it works now... I kept bumping the current limit down, and it works when set to 0.11A. Which, now that it is running, the Teensy drawss 0.105A. I didn't know how much the Teensy drew, so the 37 mA didn't catch my attention enough.

Thank you everyone for the quick replies! I'm not sure how long it would have taken me if I were not carefully implementing all your suggestions and noting the results so I could report back.

- Steve
 
Back
Top