downloading program into the new teensy 4.1: not working on my PC

ig-or

Active member
Ubuntu Linux 20.04, latest artuino env + latest teensyDuino.
I tried to work from Arduino environment and from makefile directly, results are the same. "Teensy" looks like does not load program into the 4.1 board.

Arduino tell me :

Code:
/home/igor/Downloads/arduino-1.8.16/hardware/teensy/../tools/teensy_post_compile -file=Blink.pde -path=/tmp/arduino_build_6692 -tools=/home/igor/Downloads/arduino-1.8.16/hardware/teensy/../tools/ -board=TEENSY41
Opening Teensy Loader...
Unable find Teensy Loader.  (p)  Is the Teensy Loader application running?
quitexit status 1
Error compiling for board Teensy 4.1.

same output from the "make" command (after adjusting makefile to the 4.1 version)

"Teensy" software opens up, and reports following:

Code:
15:16:47.348 (loader): Teensy Loader 1.55, begin program
15:16:47.381 (loader): File "/home/igor/Downloads/arduino-1.8.16/hardware/teensy/avr/cores/teensy4/main.hex", 22528 bytes
15:16:47.381 (loader): File "main.hex". 22528 bytes
15:16:47.381 (loader): Unable to listen for remote control
15:16:47.381 (loader): initialized, showing main window
15:26:16.392 (loader): Verbose Info event

I'm doing something wrong probably.. How to correctly program Teensy 4.1? Quick search on the forum showed nothing relevant..
 
Localhost networking (IP number 127.0.0.1) is needed for communication between these 2 programs. It should be set up by default on all Linux distros. Maybe you system's network config got changed or messed up somehow?

In a terminal, run "ifconfig lo". On my Ubuntu 20.04 system is prints this:

Code:
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1457441  bytes 119512853 (119.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1457441  bytes 119512853 (119.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 
Thank you Paul for paying attention to this issue. Will check all this today. Also, will try on different PCs. Best regards!
 
OK, I tried on another PC now, Windows 10. I created a hex file, and trying to use teensy.exe to upload this file to the teensy 4.1. But "program" and "reboot" buttons are not active. This is the log:

Code:
14:16:43.800 (loader): Teensy Loader 1.55, begin program
14:16:43.907 (loader): File "C:\Users\space\teetest\build1\teetest.hex", 22528 bytes
14:16:43.907 (loader): File "teetest.hex". 22528 bytes
14:16:43.928 (loader): Listening for remote control on port 3149
14:16:43.928 (loader): initialized, showing main window
14:16:44.148 (loader): HID/win32:  vid:413C pid:2113 ver:0108  usb:0/140000/0/D/E
14:16:44.148 (loader): HID/win32:  vid:046D pid:C52B ver:2410  usb:0/140000/0/2/3
14:16:44.148 (loader): HID/win32:  vid:046D pid:C52B ver:2410  usb:0/140000/0/2/3
14:16:44.148 (loader): HID/win32:  vid:046D pid:C52B ver:2410  usb:0/140000/0/2/3
14:16:44.148 (loader): HID/win32:  vid:046D pid:C52B ver:2410  usb:0/140000/0/2/4
14:16:44.148 (loader): HID/win32:  vid:046D pid:C52B ver:2410  usb:0/140000/0/2/4
14:16:44.148 (loader): HID/win32:  vid:046D pid:0A46 ver:0115  usb:0/140000/0/3/6
14:16:44.148 (loader): HID/win32:  vid:046D pid:0A46 ver:0115  usb:0/140000/0/3/6
14:16:44.148 (loader): HID/win32:  vid:046D pid:C52B ver:2410  usb:0/140000/0/2/4
14:16:44.148 (loader): HID/win32:  vid:413C pid:2113 ver:0108  usb:0/140000/0/D/E
14:16:46.324 (loader): Verbose Info event
14:17:01.218 (loader): Open File event
14:17:04.365 (loader): File "C:\Users\space\teetest\build1\teetest.hex", 22528 bytes
14:17:04.365 (loader): File "teetest.hex". 22528 bytes

Teensy board is attached to the USB of the PC, tried different ports.. Yellow led is blinking. If push a button on a board, then nothing is blinking.. How to upload the new program in to the teensy4.1?


If working from Arduino, same results..
from Arduino window:

Code:
Linking everything together...
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-gcc" -O2 -Wl,--gc-sections,--relax "-TC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4/imxrt1062_t41.ld" -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/Blink.pde.elf" "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385\\sketch\\Blink.pde.cpp.o" "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/..\\arduino_cache_869791\\core\\core_e612ed3a92f8769e6d06d6bf8e29c1af.a" "-LC:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385" -larm_cortexM7lfsp_math -lm -lstdc++
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/Blink.pde.elf" "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/Blink.pde.eep"
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/Blink.pde.elf" "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/Blink.pde.hex"
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/teensy_secure" encrypthex TEENSY41 "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/Blink.pde.hex"
No key .pem file found, skipping .ehex encryption
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/teensy_post_compile" -file=Blink.pde "-path=C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385" "-tools=C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/" -board=TEENSY41
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/stdout_redirect" "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/Blink.pde.sym" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objdump" -t -C "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/Blink.pde.elf"
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/teensy_size" "C:\\Users\\AppData\\Local\\Temp\\1\\arduino_build_388385/Blink.pde.elf"
Memory Usage on Teensy 4.1:
  FLASH: code:9548, data:2324, headers:8604   free for files:8105988
   RAM1: variables:12992, code:6880, padding:25888   free for local variables:478528
   RAM2: variables:12384  free for malloc/new:511904
No Teensy boards were found on any USB ports of your computer.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

No traces of the corresponding COM ports in "device manager".
 
This looks like there is no USB communication between Teensy and your Windows 10 machine.

By far the most common problem is charge-only cables.
 
This was it!! I tried 7 cables, with three of them the board showed a small red light after I pressed a button, but only one cable showed me "USB device attached" windows message and teensy.exe interface looks alive ("program" buttons is green.)
Thanks for fast response!
 
Glad it's working. It's a real shame those charge-only cables aren't clearly labeled as not having data connection. It's by far the most common problem we see over and over.

But the localhost issue is rare. I am kinda curious what went wrong with localhost networking on that Linux machine. If you use it again, any chance you could run "ifconfig lo" and copy the result here? It's a very unusual problem these days (long ago Zone Alarm firewall on Windows stupidly blocked localhost by default) but it has come up a couple times. All systems have supposed to have localhost where 127.0.0.1 allows programs running on the same computer to connect to each other. If you have any insight about how that got messed up, it might help others in the future who hit the same issue.
 
Code:
(base) igor@Igor-notebook:~$ ifconfig lo
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 570  bytes 65179 (65.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 570  bytes 65179 (65.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

(base) igor@Igor-notebook:~$


Arduino output:
Code:
Linking everything together...
/home/igor/Downloads/arduino-1.8.16/hardware/teensy/../tools/arm/bin/arm-none-eabi-gcc -O2 -Wl,--gc-sections,--relax -T/home/igor/Downloads/arduino-1.8.16/hardware/teensy/avr/cores/teensy4/imxrt1062_t41.ld -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o /tmp/arduino_build_848392/Blink.pde.elf /tmp/arduino_build_848392/sketch/Blink.pde.cpp.o /tmp/arduino_build_848392/core/core.a -L/tmp/arduino_build_848392 -larm_cortexM7lfsp_math -lm -lstdc++
/home/igor/Downloads/arduino-1.8.16/hardware/teensy/../tools/arm/bin/arm-none-eabi-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/arduino_build_848392/Blink.pde.elf /tmp/arduino_build_848392/Blink.pde.eep
/home/igor/Downloads/arduino-1.8.16/hardware/teensy/../tools/arm/bin/arm-none-eabi-objcopy -O ihex -R .eeprom /tmp/arduino_build_848392/Blink.pde.elf /tmp/arduino_build_848392/Blink.pde.hex
/home/igor/Downloads/arduino-1.8.16/hardware/teensy/../tools/teensy_secure encrypthex TEENSY41 /tmp/arduino_build_848392/Blink.pde.hex
No key .pem file found, skipping .ehex encryption
/home/igor/Downloads/arduino-1.8.16/hardware/teensy/../tools/teensy_post_compile -file=Blink.pde -path=/tmp/arduino_build_848392 -tools=/home/igor/Downloads/arduino-1.8.16/hardware/teensy/../tools/ -board=TEENSY41
Opening Teensy Loader...
Unable find Teensy Loader.  (p)  Is the Teensy Loader application running?
quitexit status 1
Error compiling for board Teensy 4.1.

Teensy software:
Code:
10:07:52.035 (loader): Teensy Loader 1.55, begin program
10:07:52.071 (loader): File "/home/igor/Downloads/arduino-1.8.16/hardware/teensy/avr/cores/teensy4/main.hex", 22528 bytes
10:07:52.071 (loader): File "main.hex". 22528 bytes
10:07:52.072 (loader): Unable to listen for remote control
10:07:52.072 (loader): initialized, showing main window
10:08:50.642 (loader): Verbose Info event
 
after teensy board attached

Code:
10:07:52.072 (loader): initialized, showing main window
10:08:50.642 (loader): Verbose Info event
10:11:58.428 (loader): action add: /dev/hidraw4
10:11:58.430 (loader): USB add /dev/hidraw4, vid=16C0, pid=0478, ver=0105, serial=000FE426, location=usb2/2-1/2-1.3/
10:11:58.487 (loader): opening /dev/hidraw4, usage: 0025: Teensy 4.1 (IMXRT1062)
10:11:58.488 (loader): Device came online, code_size = 8126464
10:11:58.488 (loader): Board is: Teensy 4.1 (IMXRT1062), version 1.05
10:11:58.500 (loader): File "/home/igor/Downloads/arduino-1.8.16/hardware/teensy/avr/cores/teensy4/main.hex", 22528 bytes
10:11:58.501 (loader): File "main.hex". 22528 bytes, 0% used
10:11:58.530 (loader): set background IMG_ONLINE
10:12:11.520 (loader): Verbose Info event

So it looks like working..
 
Everything looks like it's working, except for this:

Teensy software:
Code:
10:07:52.035 (loader): Teensy Loader 1.55, begin program
10:07:52.071 (loader): File "/home/igor/Downloads/arduino-1.8.16/hardware/teensy/avr/cores/teensy4/main.hex", 22528 bytes
10:07:52.071 (loader): File "main.hex". 22528 bytes
[COLOR="#FF0000"]10:07:52.072 (loader): Unable to listen for remote control[/COLOR]
10:07:52.072 (loader): initialized, showing main window
10:08:50.642 (loader): Verbose Info event

Then of course you set the "Unable find Teensy Loader. (p) Is the Teensy Loader application running?" message in Arduino, because it can't talk to Teensy Loader.

I don't understand why it can't listen on localhost. Maybe a firewall rule is blocking it?
 
There should be nothing special. Just my own Ubuntu 20.04 installation. What is the port number? And protocol? Recently I saw port-blocking behavior on Windows10 (HyperV subsystem blocked some ports which I used to use for my projects).
 
Back
Top