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

Thread: Teensy freezes my computer when I try to upload code

  1. #1
    Junior Member
    Join Date
    Feb 2017
    Posts
    7

    Teensy freezes my computer when I try to upload code

    I have just installed ubuntu 16.04 (32bit) on my computer (I deleted everything from my HD when I installed. I was using my teensy3.5 previously with no problems).

    I have installed the Arduino IDE 1.8.2, Teensyduino and the Teensy loader.

    I have also placed the "49-teensy.rules" file in "/etc/udev/rules.d" as well as in "/lib/udev/rules.d".
    The last path is suggested in the comments "(req'd on some broken systems)" in the "49-teensy.rules" file .

    When I look into "/etc/udev/rules.d" there is nothing apart from "49-teensy.rules" while in "/lib/udev/rules.d" there are lots of ".rules" files.

    If I try to upload ANY code on my teensy3.5 my computer freezes and I have to shut it down from the power button.

    Meanwhile uploading code to my arduino nano seems to cause no such problem.

    I should also say that when I plug in my teensy in the usb port the system does seem to recognize it.

    Hope someone can help.
    Thanks in advance.
    Last edited by tetraktys; 06-04-2017 at 01:22 AM.

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,583
    There is most probably messed something up with your USB subsystem.
    What does lsusb show on the screen before and after you connect your Teensy?
    If your Teensy is not correctly listed, it's rather an udev problem and not Teensyduino's fault.
    You might also try a different USB cable for your Teensy or another Teensy (a serious developer has always a few spares in the drawer) for a differential diagnose.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,115
    Try running "tail -f /var/log/syslog" in another terminal window. Maybe the kernel is logging info about whatever problem is occurring?

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,949
    I was also going to suggest the same things.
    Like I just plugged a new Teensy 3.5 into my UP board running Ubuntu 16.04 (although mine is 64 bit)

    And I see:
    Code:
    kurt@kurt-UP-CHT01:~$ ls /etc/udev/rules.d
    49-teensy.rules  99-SaleaeLogic.rules
    kurt@kurt-UP-CHT01:~$ lsusb
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 005: ID 0424:2530 Standard Microsystems Corp.
    Bus 001 Device 008: ID 16c0:0486 Van Ooijen Technische Informatica Teensyduino RawHID
    Bus 001 Device 007: ID 04ca:0027 Lite-On Technology Corp.
    Bus 001 Device 006: ID 1241:1177 Belkin Mouse [HT82M21A]
    Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
    Bus 001 Device 003: ID 0424:4603 Standard Microsystems Corp.
    Bus 001 Device 002: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    So Teensy shows up as RawHID.

    I would then probably check out what dmesg tells me. like:
    Code:
    kurt@kurt-UP-CHT01:~$ dmesg | tail -30
    [    6.074160] audit: type=1400 audit(1496542448.110:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=796 comm="apparmor_parser"
    [    6.078599] audit: type=1400 audit(1496542448.114:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine" pid=800 comm="apparmor_parser"
    [    6.078626] audit: type=1400 audit(1496542448.114:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=800 comm="apparmor_parser"
    [    6.082794] audit: type=1400 audit(1496542448.118:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/cups-browsed" pid=801 comm="apparmor_parser"
    [    6.085426] audit: type=1400 audit(1496542448.122:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="webbrowser-app" pid=799 comm="apparmor_parser"
    [    6.085454] audit: type=1400 audit(1496542448.122:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="webbrowser-app//oxide_helper" pid=799 comm="apparmor_parser"
    [    6.773063] Bluetooth: Core ver 2.21
    [    6.773107] NET: Registered protocol family 31
    [    6.773112] Bluetooth: HCI device and connection manager initialized
    [    6.773122] Bluetooth: HCI socket layer initialized
    [    6.773129] Bluetooth: L2CAP socket layer initialized
    [    6.773143] Bluetooth: SCO socket layer initialized
    [    7.189661] IPv6: ADDRCONF(NETDEV_UP): wlxf4f26d0c56f8: link is not ready
    [    7.624619] IPv6: ADDRCONF(NETDEV_UP): wlxf4f26d0c56f8: link is not ready
    [    7.644803] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
    [    7.695842] r8169 0000:01:00.0 enp1s0: link down
    [    7.696065] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
    [    7.878615] IPv6: ADDRCONF(NETDEV_UP): wlxf4f26d0c56f8: link is not ready
    [    8.646234] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [    8.646243] Bluetooth: BNEP filters: protocol multicast
    [    8.646255] Bluetooth: BNEP socket layer initialized
    [   10.516163] IPv6: ADDRCONF(NETDEV_CHANGE): wlxf4f26d0c56f8: link becomes ready
    [  107.920501] usb 1-7.1.4: new full-speed USB device number 8 using xhci_hcd
    [  108.009847] usb 1-7.1.4: New USB device found, idVendor=16c0, idProduct=0486
    [  108.009876] usb 1-7.1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  108.009883] usb 1-7.1.4: Product: Teensyduino RawHID
    [  108.009891] usb 1-7.1.4: Manufacturer: Teensyduino
    [  108.009897] usb 1-7.1.4: SerialNumber: 2277920
    [  108.014897] hid-generic 0003:16C0:0486.0004: hiddev0,hidraw3: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-7.1.4/input0
    [  108.017379] hid-generic 0003:16C0:0486.0005: hidraw4: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-7.1.4/input1
    kurt@kurt-UP-CHT01:~$
    Now if I instead plug one in that has program on it, I see:
    Code:
    kurt@kurt-UP-CHT01:~$ lsusb
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 005: ID 0424:2530 Standard Microsystems Corp.
    Bus 001 Device 009: ID 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial
    Bus 001 Device 007: ID 04ca:0027 Lite-On Technology Corp.
    Bus 001 Device 006: ID 1241:1177 Belkin Mouse [HT82M21A]
    Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
    Bus 001 Device 003: ID 0424:4603 Standard Microsystems Corp.
    Bus 001 Device 002: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    kurt@kurt-UP-CHT01:~$ dmesg | tail -20
    [    8.646255] Bluetooth: BNEP socket layer initialized
    [   10.516163] IPv6: ADDRCONF(NETDEV_CHANGE): wlxf4f26d0c56f8: link becomes ready
    [  107.920501] usb 1-7.1.4: new full-speed USB device number 8 using xhci_hcd
    [  108.009847] usb 1-7.1.4: New USB device found, idVendor=16c0, idProduct=0486
    [  108.009876] usb 1-7.1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  108.009883] usb 1-7.1.4: Product: Teensyduino RawHID
    [  108.009891] usb 1-7.1.4: Manufacturer: Teensyduino
    [  108.009897] usb 1-7.1.4: SerialNumber: 2277920
    [  108.014897] hid-generic 0003:16C0:0486.0004: hiddev0,hidraw3: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-7.1.4/input0
    [  108.017379] hid-generic 0003:16C0:0486.0005: hidraw4: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:00:14.0-7.1.4/input1
    [  446.421321] usb 1-7.1.4: USB disconnect, device number 8
    [  453.276095] usb 1-7.1.4: new full-speed USB device number 9 using xhci_hcd
    [  453.365362] usb 1-7.1.4: New USB device found, idVendor=16c0, idProduct=0483
    [  453.365391] usb 1-7.1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  453.365409] usb 1-7.1.4: Product: USB Serial
    [  453.365423] usb 1-7.1.4: Manufacturer: Teensyduino
    [  453.365437] usb 1-7.1.4: SerialNumber: 2278560
    [  453.405640] cdc_acm 1-7.1.4:1.0: ttyACM0: USB ACM device
    [  453.406978] usbcore: registered new interface driver cdc_acm
    [  453.406986] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    So you might check it out on your system and see if these give you any more information

  5. #5
    Junior Member
    Join Date
    Feb 2017
    Posts
    7
    OK so lsusb gives me:

    Code:
        Bus 001 Device 002: ID 8087:07e6 Intel Corp. 
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 002 Device 003: ID 04f2:b469 Chicony Electronics Co., Ltd 
    Bus 002 Device 007: ID 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial
    Bus 002 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub
    Bus 002 Device 005: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Which seems OK. Teensy is running code which I had previously uploaded. Also if I open up the serial monitor it does print out.

    Typing tail -f /var/log/syslog gives:

    Code:
     Jun  4 13:59:52 tetraktys-Aspire-E3-112 org.gnome.zeitgeist.SimpleIndexer[1462]: ** (zeitgeist-fts:1991): WARNING **: Unable to get info on application:///home/tetraktys/Desktop/arduino-arduinoide.desktop
    Jun  4 14:00:11 tetraktys-Aspire-E3-112 kernel: [  975.814795] usb 2-2.2: new full-speed USB device number 7 using xhci_hcd
    Jun  4 14:00:11 tetraktys-Aspire-E3-112 kernel: [  975.916497] usb 2-2.2: New USB device found, idVendor=16c0, idProduct=0483
    Jun  4 14:00:11 tetraktys-Aspire-E3-112 kernel: [  975.916513] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Jun  4 14:00:11 tetraktys-Aspire-E3-112 kernel: [  975.916524] usb 2-2.2: Product: USB Serial
    Jun  4 14:00:11 tetraktys-Aspire-E3-112 kernel: [  975.916534] usb 2-2.2: Manufacturer: Teensyduino
    Jun  4 14:00:11 tetraktys-Aspire-E3-112 kernel: [  975.916543] usb 2-2.2: SerialNumber: 2520280
    Jun  4 14:00:11 tetraktys-Aspire-E3-112 kernel: [  976.112521] cdc_acm 2-2.2:1.0: ttyACM0: USB ACM device
    Jun  4 14:00:11 tetraktys-Aspire-E3-112 kernel: [  976.113311] usbcore: registered new interface driver cdc_acm
    Jun  4 14:00:11 tetraktys-Aspire-E3-112 kernel: [  976.113314] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    Jun  4 14:17:02 tetraktys-Aspire-E3-112 CRON[4187]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,115
    All that info looks good, but it looks like just plugging in an already-programmed Teensy.

    Earlier you said the problem happens when you upload, so I'm confused...

  7. #7
    Junior Member
    Join Date
    Feb 2017
    Posts
    7
    Before I installed ubuntu 16.04, I was using my teensy without any issues. So the teensy is definitely fine. Also if I connect it and open up a serial monitor it prints out what is suppose to. So the code on it is running.

    But if I try to upload any new code now the loading bar goes to full and then at the moment when the teensy loader pops up my computer freezes.

    If I only do a compile the teensy loader pops up with no problems. Also If I then press the "restart" button on my teensy the loader pops up the loading graphic and that goes well too.

    But if I try to upload the code.... my computer freezes and I want to cry

  8. #8
    Junior Member
    Join Date
    Feb 2017
    Posts
    7
    OK!!!!! Something weird happens.

    If I only click the "verify" button in the arduino IDE, after the compile the teensy loader pops up. Now if I press the restart button on my teensy the teenys loader pops up the "programming" graphic with the loading bar. The bar loads to full then it gives the "reboot OK" message and the code is actually uploaded on my teensy !!!!! Without having to click on the "upload" button of the arduino IDE.

    I guess there is some issue with my ubuntu system, the udev and the usb functionality in general.

    Well at least I can upload code

  9. #9
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,949
    Maybe the program that runs to set the Teensy into program mode is bad? Although not sure why it would require you to reboot?

  10. #10
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,379
    try to upload blink program

Posting Permissions

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