Teensy 4.1 not working with Ubuntu 20.04

jpunkt

New member
Hi all,

I am new to teensy but have experience in microcontroller programming on multiple platforms. I have recently started working on a project using vs code and platformIO with teensy boards. I was using teensy 3.2 first, but then decided to switch to teensy 4.1 because I expect to need more I/Os. My problem is: I can't flash a single teensy 4.1 on my system (tried 4 different ones, see below). 3.2 works fine. This is driving me crazy.

The error is always the same: the loader software does not recognize that the board is in programming mode. I am confident that my USB cable is functioning properly (it works with all other microcontrollers, including a teensy 3.2). Here is what I have done so far:

  1. Tried to upload a simple blink program using vs code and platformIO with the default GUI loader. The loader says it can't detect the board and I should press the programming button. I press it, the blinking LED goes off and the red indicator goes on, but the board is not detected.
  2. Switched to command line loader with vs code and platformIO. Same result (see output below).
  3. Tried every USB port of my laptop. Same result.
  4. Power off and power on computer, same result.
  5. Did 15s reset, tried to flash the board again. Same result.
  6. Tried four (4) different teensy 4.1 boards. Same result.
  7. Compiled the latest teensy_loader_cli (2.2) from source, downloaded sample blink program from pjrc.com, tried flashing on the command line. This is the output (same as before):
    Code:
    $ ./teensy_loader_cli --mcu=TEENSY41 -v ../blink_fast_Teensy41.hex 
    Teensy Loader, Command Line, Version 2.2
    Read "../blink_fast_Teensy41.hex": 14452 bytes, 0.2% usage
    Unable to open device (hint: try -w option)
  8. If I use the -w option on the command line tool it just waits for my board forever. I can press the button as often as I like, it doesn't change anything. I tried waiting for 3 minutes, the board is still not detected.

As I mentioned, I have used a teensy 3.2 before with the same setup, and it works fine. The udev-rules file is installed. To be absolutely sure, I flashed your sample blink hexfile on to that same teensy 3.2 using the same command line tool and options as above (except for --mcu=TEENSY32 of course), with the same cable, and that works fine too.

However, it seems there is something wrong with the teensy's (all of them?). This is a sample dmesg output when I plug/unplug my boards:

Code:
[ 5420.076998] usb usb1-port3: attempt power cycle
[ 5420.488758] usb 1-3: new high-speed USB device number 12 using xhci_hcd
[ 5420.488932] usb 1-3: Device not responding to setup address.
[ 5420.696938] usb 1-3: Device not responding to setup address.
[ 5420.904919] usb 1-3: device not accepting address 12, error -71
[ 5421.032975] usb 1-3: new high-speed USB device number 13 using xhci_hcd
[ 5421.033150] usb 1-3: Device not responding to setup address.
[ 5421.241516] usb 1-3: Device not responding to setup address.
[ 5421.448934] usb 1-3: device not accepting address 13, error -71
[ 5421.449060] usb usb1-port3: unable to enumerate USB device
[ 5448.097185] usb 1-3: new high-speed USB device number 14 using xhci_hcd
[ 5448.224838] usb 1-3: device descriptor read/64, error -71
[ 5448.461222] usb 1-3: device descriptor read/64, error -71
[ 5448.697192] usb 1-3: new high-speed USB device number 15 using xhci_hcd
[ 5448.825220] usb 1-3: device descriptor read/64, error -71
[ 5449.061246] usb 1-3: device descriptor read/64, error -71
[ 5449.168922] usb usb1-port3: attempt power cycle
[ 5449.580880] usb 1-3: new high-speed USB device number 16 using xhci_hcd
[ 5449.581420] usb 1-3: Device not responding to setup address.
[ 5449.789111] usb 1-3: Device not responding to setup address.

I understand and expect that one board could just be faulty. But I have four, which are all new, and they all show the exact same problem. What am I missing here?

Do you have any ideas what I could still try? Or what is causing the problem?

I am using an up-to-date Ubuntu 20.04 with an Intel Core i7-10875H CPU.

Best wishes,
J.
 
I found the problem: my USB-cable was too long! After trying on a windows machine, with a different cable, and experiencing the same problems, I switched from using a 2m cable to a 1m cable, and now it works.

BTW, both cables are high-quality, branded and in excellent condition.

Maybe someone could add an extra warning about long cables to the troubleshooting list? https://www.pjrc.com/teensy/troubleshoot.html
 
Back
Top