A big problem with Arduino 1.8.15 and Teensy 4.x

Status
Not open for further replies.

MickPF

Member
Hello,

I recently took out my Teensy's 4.1, which I haven't used for a long time, reinstalled the ArduinoIDE 1.8.15 with Teensyduino 1.54 on Ubuntu 20.04.

Even with a simple sketch (see attachments), something happens to the Teensy that I don't understand:
  • I erase the flash by pressing and holding the button until the red LED flashes and lights, wait until the erase process completes.
  • Compile the sketch
Code:
Compiling core...
Using precompiled core: /tmp/arduino_cache_814905/core/core_8eb20ee0cba3f63aca4fdf5012983c04.a
Linking everything together...
/opt/arduino-1.8.15/hardware/teensy/../tools/arm/bin/arm-none-eabi-gcc -O2 -Wl,--gc-sections,--relax -T/opt/arduino-1.8.15/hardware/teensy/avr/cores/teensy4/imxrt1062_t41.ld -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o /tmp/arduino_build_609337/serial_test.ino.elf /tmp/arduino_build_609337/sketch/serial_test.ino.cpp.o /tmp/arduino_build_609337/../arduino_cache_814905/core/core_8eb20ee0cba3f63aca4fdf5012983c04.a -L/tmp/arduino_build_609337 -larm_cortexM7lfsp_math -lm -lstdc++
/opt/arduino-1.8.15/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_609337/serial_test.ino.elf /tmp/arduino_build_609337/serial_test.ino.eep
/opt/arduino-1.8.15/hardware/teensy/../tools/arm/bin/arm-none-eabi-objcopy -O ihex -R .eeprom /tmp/arduino_build_609337/serial_test.ino.elf /tmp/arduino_build_609337/serial_test.ino.hex
/opt/arduino-1.8.15/hardware/teensy/../tools/stdout_redirect /tmp/arduino_build_609337/serial_test.ino.lst /opt/arduino-1.8.15/hardware/teensy/../tools/arm/bin/arm-none-eabi-objdump -d -S -C /tmp/arduino_build_609337/serial_test.ino.elf
/opt/arduino-1.8.15/hardware/teensy/../tools/stdout_redirect /tmp/arduino_build_609337/serial_test.ino.sym /opt/arduino-1.8.15/hardware/teensy/../tools/arm/bin/arm-none-eabi-objdump -t -C /tmp/arduino_build_609337/serial_test.ino.elf
/opt/arduino-1.8.15/hardware/teensy/../tools/teensy_post_compile -file=serial_test.ino -path=/tmp/arduino_build_609337 -tools=/opt/arduino-1.8.15/hardware/teensy/../tools/ -board=TEENSY41
/opt/arduino-1.8.15/hardware/teensy/../tools/teensy_size /tmp/arduino_build_609337/serial_test.ino.elf
Memory Usage on Teensy 4.1:
  FLASH: code:10620, data:1556, headers:8300   free for files:8105988
   RAM1: variables:8896, code:8000, padding:24768   free for local variables:482624
   RAM2: variables:12384  free for malloc/new:511904
  • Upload the sketch
Code:
/opt/arduino-1.8.15/hardware/teensy/../tools/teensy_post_compile -file=serial_test.ino -path=/tmp/arduino_build_609337 -tools=/opt/arduino-1.8.15/hardware/teensy/../tools -board=TEENSY41 -reboot -port=/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3 -portlabel=/dev/hidraw4 RawHID -portprotocol=Teensy

Teensy seems to "arrive" somewhere in nirvana as soon as I upload any sketch.

Can someone help me to solve this problem please?

Is it a known bug?

Thansk in advance,
Michael
 

Attachments

  • Serial_Monitor_after_Reset.png
    Serial_Monitor_after_Reset.png
    17.4 KB · Views: 44
  • ArduinoIDE_Sketch.png
    ArduinoIDE_Sketch.png
    138.2 KB · Views: 50
  • Serial_Monitor_after_Upload.png
    Serial_Monitor_after_Upload.png
    50.5 KB · Views: 45
I ran it here on Ubuntu 20.04. Seems to work fine.

screenshot.png

A couple suggestions...

1: Make sure you installed the latest udev rules. They were recently updated because of problems on various Linux systems.

2: Run "tail -f /var/log/syslog" in a terminal while uploading. The kernel should give you messages as the USB disconnects and reappears.
 
Hello Paul,

I've installed the udev rules file, which is distributed with the Teensyduino, there are no other files in /etc/udev/rules.d, which could override 00-teensy.rules.

The dmesg output looks fine:
Code:
[   27.460940] usb 1-3: new high-speed USB device number 6 using xhci_hcd
[   27.587654] usb 1-3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.80
[   27.587661] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   27.587664] usb 1-3: Product: USB Serial
[   27.587666] usb 1-3: Manufacturer: Teensyduino
[   27.587669] usb 1-3: SerialNumber: 8418150
[   33.661359] usb 1-3: USB disconnect, device number 6
[   82.394938] usb 1-3: new high-speed USB device number 7 using xhci_hcd
[   82.521700] usb 1-3: New USB device found, idVendor=16c0, idProduct=0486, bcdDevice= 2.80
[   82.521707] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   82.521711] usb 1-3: Product: Teensyduino RawHID
[   82.521715] usb 1-3: Manufacturer: Teensyduino
[   82.521718] usb 1-3: SerialNumber: 8418150
[   82.525997] hid-generic 0003:16C0:0486.0004: hiddev1,hidraw3: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-3/input0
[   82.527128] hid-generic 0003:16C0:0486.0005: hidraw4: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-3/input1
[  125.921005] usb 1-3: USB disconnect, device number 7
[  126.252808] usb 1-3: new high-speed USB device number 8 using xhci_hcd
[  126.379993] usb 1-3: New USB device found, idVendor=16c0, idProduct=0478, bcdDevice= 1.05
[  126.379999] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=1
[  126.380002] usb 1-3: SerialNumber: 000CD857
[  126.382958] hid-generic 0003:16C0:0478.0006: hidraw3: USB HID v1.11 Device [HID 16c0:0478] on usb-0000:00:14.0-3/input0
[  126.720163] usb 1-3: USB disconnect, device number 8
[  127.347934] usb 1-3: new high-speed USB device number 9 using xhci_hcd
[  127.475456] usb 1-3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.80
[  127.475463] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  127.475466] usb 1-3: Product: USB Serial
[  127.475469] usb 1-3: Manufacturer: Teensyduino
[  127.475472] usb 1-3: SerialNumber: 8418150

The syslog output looks fine also:
Code:
Jul 13 10:20:28 neptun kernel: [   82.394938] usb 1-3: new high-speed USB device number 7 using xhci_hcd
Jul 13 10:20:29 neptun kernel: [   82.521700] usb 1-3: New USB device found, idVendor=16c0, idProduct=0486, bcdDevice= 2.80
Jul 13 10:20:29 neptun kernel: [   82.521707] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jul 13 10:20:29 neptun kernel: [   82.521711] usb 1-3: Product: Teensyduino RawHID
Jul 13 10:20:29 neptun kernel: [   82.521715] usb 1-3: Manufacturer: Teensyduino
Jul 13 10:20:29 neptun kernel: [   82.521718] usb 1-3: SerialNumber: 8418150
Jul 13 10:20:29 neptun kernel: [   82.525997] hid-generic 0003:16C0:0486.0004: hiddev1,hidraw3: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-3/input0
Jul 13 10:20:29 neptun kernel: [   82.527128] hid-generic 0003:16C0:0486.0005: hidraw4: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-3/input1
Jul 13 10:21:12 neptun kernel: [  125.921005] usb 1-3: USB disconnect, device number 7
Jul 13 10:21:12 neptun kernel: [  126.252808] usb 1-3: new high-speed USB device number 8 using xhci_hcd
Jul 13 10:21:12 neptun kernel: [  126.379993] usb 1-3: New USB device found, idVendor=16c0, idProduct=0478, bcdDevice= 1.05
Jul 13 10:21:12 neptun kernel: [  126.379999] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=1
Jul 13 10:21:12 neptun kernel: [  126.380002] usb 1-3: SerialNumber: 000CD857
Jul 13 10:21:12 neptun kernel: [  126.382958] hid-generic 0003:16C0:0478.0006: hidraw3: USB HID v1.11 Device [HID 16c0:0478] on usb-0000:00:14.0-3/input0
Jul 13 10:21:13 neptun kernel: [  126.720163] usb 1-3: USB disconnect, device number 8
Jul 13 10:21:13 neptun kernel: [  127.347934] usb 1-3: new high-speed USB device number 9 using xhci_hcd
Jul 13 10:21:13 neptun kernel: [  127.475456] usb 1-3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.80
Jul 13 10:21:13 neptun kernel: [  127.475463] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jul 13 10:21:13 neptun kernel: [  127.475466] usb 1-3: Product: USB Serial
Jul 13 10:21:13 neptun kernel: [  127.475469] usb 1-3: Manufacturer: Teensyduino
Jul 13 10:21:13 neptun kernel: [  127.475472] usb 1-3: SerialNumber: 8418150

This problem is most likely caused by the following problem:
The original Ubuntu kernel 5.8.0-xx is buggy (it is a known bug since last year!) and overheats the CPU and the nvme device.
To solve this problem I use the mainline kernel 5.10.xx. I have enough experience with linux kernel to configure and run it on Ubuntu.
But of course it is possible that I have set something wrong in the kernel. I just don't know what right now!

Any idea?
 
Here are syslog message I see on Ubuntu 20.04.

Code:
Jul 13 03:44:14 preston kernel: [5345783.259555] usb 16-1.4: USB disconnect, device number 111
Jul 13 03:44:14 preston kernel: [5345783.259933] cdc_acm 16-1.4:1.0: failed to set dtr/rts
Jul 13 03:42:54 preston snapd[3481816]: hotplug.go:199: hotplug device add event ignored, enable experimental.hotplug
Jul 13 03:44:14 preston systemd-udevd[3870183]: ttyACM0: Process '/bin/stty -F /dev/ttyACM0 raw -echo' failed with exit code 1.
Jul 13 03:44:15 preston kernel: [5345783.600549] usb 16-1.4: new high-speed USB device number 112 using xhci_hcd
Jul 13 03:44:15 preston kernel: [5345783.702367] usb 16-1.4: New USB device found, idVendor=16c0, idProduct=0478, bcdDevice= 1.05
Jul 13 03:44:15 preston kernel: [5345783.702368] usb 16-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=1
Jul 13 03:44:15 preston kernel: [5345783.702369] usb 16-1.4: SerialNumber: 000B9BF1
Jul 13 03:44:15 preston kernel: [5345783.706891] hid-generic 0003:16C0:0478.07DC: hidraw0: USB HID v1.11 Device [HID 16c0:0478] on usb-0000:0f:00.0-1.4/input0
Jul 13 03:44:16 preston kernel: [5345784.603296] usb 16-1.4: USB disconnect, device number 112
Jul 13 03:44:16 preston kernel: [5345785.256541] usb 16-1.4: new high-speed USB device number 113 using xhci_hcd
Jul 13 03:44:17 preston kernel: [5345785.359248] usb 16-1.4: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.80
Jul 13 03:44:17 preston kernel: [5345785.359249] usb 16-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jul 13 03:44:17 preston kernel: [5345785.359250] usb 16-1.4: Product: USB Serial
Jul 13 03:44:17 preston kernel: [5345785.359251] usb 16-1.4: Manufacturer: Teensyduino
Jul 13 03:44:17 preston kernel: [5345785.359252] usb 16-1.4: SerialNumber: 7608170
Jul 13 03:44:17 preston kernel: [5345785.365267] cdc_acm 16-1.4:1.0: ttyACM0: USB ACM device
Jul 13 03:44:17 preston snapd[3481816]: hotplug.go:199: hotplug device add event ignored, enable experimental.hotplug

Yours seems to be missing the "cdc_acm" line. Maybe your kernel doesn't have a compatible cdc_acm driver module?
 
Hallo Paul,

You are almost right!
I configured cdc_acm as a module, but it doesn't load automatically when I plug in Teensy. With STM32 boards (NUCLEO-144 STM32H743Z2) it works.
After loading this module manually it works (again).
I'll put it in /etc/modules ...

Many thanks for your help.
 
Status
Not open for further replies.
Back
Top