Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 51 to 75 of 77

Thread: Teensy Loader slow to start up

  1. #51
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,751
    Quote Originally Posted by mjs513 View Post
    Installing fresh Ubuntu on my PI now to see what happens. Using 20.04 LTS instead. Looked like 20.10 support ends april 2021. Using the Raspberry Pi imager then will do the updates.

    And before you ask why fresh - forgot my password and can't get back in ....
    Did you try: ubuntu

  2. #52
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,682
    Of course
    But just remembered the password when I was setting up with the new version Getting the updates now.

  3. #53
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,682
    Quote Originally Posted by KurtE View Post
    Tried new build on RPI4 running Ubuntu 64 bit ARM,

    And the teensy app works

    Tried the Simple USB keyboard example, where I added simple wait up to 5 seconds for serial, and commented out the Keyboard prints, and it built properly and programmed, but again after that could not open Serial terminal, nor automatically program again... Same issue I have seen on Ubuntu x86 64 on 18.04 and 20.04
    Attachment 23768
    Can confirm that the app works with 20.04.02LTS.

    Tried the same sketch as @KurtE and when I selected Serial+Keyboard... did get out on the Serial monitor.
    Click image for larger version. 

Name:	Screenshot from 2021-02-20 09-33-02.png 
Views:	57 
Size:	82.5 KB 
ID:	23771

  4. #54
    Junior Member
    Join Date
    Feb 2021
    Posts
    12
    Great to see the problem is solved. Tested good on Ubuntu 16.04 LTS.

  5. #55
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,751
    @mjs513 - Did you get output if you choose USB type: Keyboard
    This should output using SEREMU

    I just updated one of my 20.04 x86 (64 bit Ubuntu) and the teensy program works, but the SEREMU does not want to either reboot the teensy to program it or for the Serial Monitor to to talk to it
    In this case data shown in Arduino IDE (Unable to open /dev/hidraw6)

    Will investigate some more... Maybe a udev rules issue?

    EDIT: I am guessing that might be it:
    Code:
    kurt@kurt-XPS-8300:~$ ls -l /dev/hi*
    crw------- 1 root root 241, 0 Feb 20 06:27 /dev/hidraw0
    crw------- 1 root root 241, 1 Feb 20 06:27 /dev/hidraw1
    crw------- 1 root root 241, 2 Feb 20 06:27 /dev/hidraw2
    crw------- 1 root root 241, 3 Feb 20 06:27 /dev/hidraw3
    crw------- 1 root root 241, 4 Feb 20 06:27 /dev/hidraw4
    crw------- 1 root root 241, 5 Feb 20 06:42 /dev/hidraw5
    crw------- 1 root root 241, 6 Feb 20 06:42 /dev/hidraw6
    crw------- 1 root root 241, 7 Feb 20 06:42 /dev/hidraw7
    kurt@kurt-XPS-8300:~$

  6. #56
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,682
    @KurtE
    Not to the serial monitor.

    Either output to textEditor or directly into the IDE window - depending which I had selected (active). But I did get output even when I had keyboard printing.

    Have to go finish shoveling then going to play(test) later.

  7. #57
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,751
    Thanks,

    Note: on my 20.04 x86, looking at udev rules associated with hidraw I see:
    Code:
    kurt@kurt-XPS-8300:/etc/udev/rules.d$ grep -i hidraw *
    98-openocd.rules:SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
    kurt@kurt-XPS-8300:/etc/udev/rules.d$ cat 98-openocd.rules 
    
    # Adding Arduino M0/M0 Pro, Primo UDEV Rules for CMSIS-DAP port
    
    ACTION!="add|change", GOTO="openocd_rules_end"
    SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
    
    #Please keep this list sorted by VID:PID
    
    #CMSIS-DAP compatible adapters
    ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"
    
    LABEL="openocd_rules_end"
    kurt@kurt-XPS-8300:/etc/udev/rules.d$
    Looking around net I see: https://unix.stackexchange.com/quest...missions/85459

    So tried:
    Code:
    kurt@kurt-XPS-8300:/etc/udev/rules.d$ cat 99-hidraw-permissions.rules 
    KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"
    kurt@kurt-XPS-8300:/etc/udev/rules.d$
    Now Teensy with keyboard as USB type programs and Serial monitor works

    Not sure what is best way to define this and/or where@!

  8. #58
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,682
    @KurtE

    getting an error when I try to execute your first line:
    Code:
    ubuntu@ubuntu:~$ /etc/udev/rules.d$ cat 99-hidraw-permissions.rules
    bash: /etc/udev/rules.d$: No such file or directory
    EDIT: never mind figured it out as I am remembering how to use Linux

  9. #59
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,682
    Quote Originally Posted by KurtE View Post
    Thanks,

    Note: on my 20.04 x86, looking at udev rules associated with hidraw I see:
    Code:
    kurt@kurt-XPS-8300:/etc/udev/rules.d$ grep -i hidraw *
    98-openocd.rules:SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
    kurt@kurt-XPS-8300:/etc/udev/rules.d$ cat 98-openocd.rules 
    
    # Adding Arduino M0/M0 Pro, Primo UDEV Rules for CMSIS-DAP port
    
    ACTION!="add|change", GOTO="openocd_rules_end"
    SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
    
    #Please keep this list sorted by VID:PID
    
    #CMSIS-DAP compatible adapters
    ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"
    
    LABEL="openocd_rules_end"
    kurt@kurt-XPS-8300:/etc/udev/rules.d$
    Looking around net I see: https://unix.stackexchange.com/quest...missions/85459

    So tried:
    Code:
    kurt@kurt-XPS-8300:/etc/udev/rules.d$ cat 99-hidraw-permissions.rules 
    KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"
    kurt@kurt-XPS-8300:/etc/udev/rules.d$
    Now Teensy with keyboard as USB type programs and Serial monitor works

    Not sure what is best way to define this and/or where@!
    ok - as shown didn;t really work for me - but then I really have no idea with Linux so just used gedit to create the file. Restarted and it now works with serial monitor as you said.

    Maybe Paul can add it to list of UDEV rules to be downloaded from the Teensyduino download page?

  10. #60
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,751
    Quote Originally Posted by mjs513 View Post
    ok - as shown didn;t really work for me - but then I really have no idea with Linux so just used gedit to create the file. Restarted and it now works with serial monitor as you said.

    Maybe Paul can add it to list of UDEV rules to be downloaded from the Teensyduino download page?
    Good,

    It also might have worked if you had made sure Arduino was not running and the teensy was not plugged in. Then when you plug in the teensy the rule should fire...

    Was going to upload the file here, but it does not like .rules files

    I added the .txt extension to it.
    Should be able to download it and remove the .txt and then sudo cp it to /etc/udev/rules.d directory

    Also @Paul maybe should instead add it to the 49-teensy.rules file.

    Question, does you install script that checks for rules file simply check it exists or does it also check if the contents are different?

    Will now go back to my other notebook with 20.04.02 and see if everything works

    Edit: notebook that I installed Ubuntu 20.04.02 from ISO disk yesterday is working fine with the new build
    Also updated with the udev rules file I mentioned here and building for USB Type of Keyboard works now. Both the reboot code as well as the Serial monitor

    EDIT 2: Updated notebook other install 18.04 and it also works
    Attached Files Attached Files
    Last edited by KurtE; 02-20-2021 at 05:46 PM.

  11. #61
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,682
    Morning again - can't sleep so catching up

    As for restarting. I did close and reopen the IDE but didn't disconnect the Teensy which was probably the issue - didn't even cross my mind to unplug it.

    Also @Paul maybe should instead add it to the 49-teensy.rules file.
    Probably a better approach to just add it to the rules file but for folks that have already downloaded the rules file and just keeps updating TD may not realize they need to update unless a warning is posted as well that the file has changed and please update.

    Question, does you install script that checks for rules file simply check it exists or does it also check if the contents are different?
    ok - remember I just get by with Linux so where do I find that?

    Great that you got it checked out the laptop and with18.04

  12. #62
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,223
    Quote Originally Posted by KurtE View Post
    Also @Paul maybe should instead add it to the 49-teensy.rules file.
    Yes, I agree.

    But so far, I can't reproduce the problem on my Linux desktop.

    Click image for larger version. 

Name:	screenshot.png 
Views:	28 
Size:	59.2 KB 
ID:	23786

    The /dev/hidraw devices are being created with open permissions.

    Click image for larger version. 

Name:	screenshot2.png 
Views:	61 
Size:	87.8 KB 
ID:	23787

    Maybe this is coming from some other udev rule file I installed long ago?

    Later today I'm going to dig up some USB cables and hubs so I can more easily plug into my Raspberry Pi 4 and Jetson Nano. Those 2 boards have had very little use, so they should be a much better test than my heavily used desktop machine.

  13. #63
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,751
    Quote Originally Posted by PaulStoffregen View Post
    Yes, I agree.

    But so far, I can't reproduce the problem on my Linux desktop.

    Click image for larger version. 

Name:	screenshot.png 
Views:	28 
Size:	59.2 KB 
ID:	23786

    The /dev/hidraw devices are being created with open permissions.

    Click image for larger version. 

Name:	screenshot2.png 
Views:	61 
Size:	87.8 KB 
ID:	23787

    Maybe this is coming from some other udev rule file I installed long ago?

    Later today I'm going to dig up some USB cables and hubs so I can more easily plug into my Raspberry Pi 4 and Jetson Nano. Those 2 boards have had very little use, so they should be a much better test than my heavily used desktop machine.
    Sounds good,

    For the fun of it you might try a simple on your machine like: grep hidraw /etc/udev/rules.d/*

  14. #64
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,223
    Well, after much removing and restoring files, I finally tracked it down to this line (meant for some Arduino.org boards):

    Code:
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="*", MODE:="0666"
    I have no idea why this is causing /dev/hidraw devices from Teensy which uses vendor ID 16C0 to get read/write premissions.

    With this removed, I'm able to reproduce the problem. Looking into how the best improve the default udev rules.

  15. #65
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,223
    Today I went down the deep rabbit hole of Linux udev rules.

    To make serial raw mode configure work well on Raspberry Pi, I had to rename the file from 49-teensy.rules to 00-teensy.rules.

    https://www.pjrc.com/teensy/00-teensy.rules

    Hopefully this resolves all the issues. Please let me know if you give it a try?

  16. #66
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,682
    Ok - just tried it on a RPI4 and its now working.
    Click image for larger version. 

Name:	Screenshot from 2021-02-21 19-10-28.png 
Views:	24 
Size:	58.2 KB 
ID:	23799

    Guess the order matters - 00 versus 49. Forgot to document but think you added an extra rule as well to the file.

  17. #67
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,223
    Did you run 32 bits or 64 bits on your Raspberry Pi? So far, I've only tested 32 bits.

    Yup, added the hidraw rule. The usb subsystem rule also applies. But it looks like the more complex wildcard syntax is buggy on some distros. I switched to the simpler but less precise way.

  18. #68
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,682
    Should have mentioned. Running Ubuntu 20.04.02LTS 64 bit on the PI4. Don't really have any other Linux systems. Probably can did out a RPI3 and see what I have on it and give it a try if you think its worth it?

  19. #69
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,223
    Probably not worthwhile. I tested 32 bits on Raspberry Pi 4.

    Unless Kurt turns up any more issues, I'm going to cross ARM64 troubles off my bug list.

  20. #70
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,682
    Hopefully no more issues. Hope that list is getting shorter but have a feeling it’s getting longer.

  21. #71
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,751
    It appeared to work on my RPI4 with 64 bit... looked good when I did ls -l /dev/hidr*
    Plus I told it to program the keyboard one which the reboot worked and so did the terminal monitor.

    Thanks
    (Now back to my main machine - Windows 10)

  22. #72
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,223
    Feels good to finally get these many lingering Linux issues fixed.

  23. #73
    Junior Member
    Join Date
    Feb 2021
    Posts
    12
    I've encountered a problem while trying to update my Asus Laptop running Linux Mint 19.2 Cinnamon. On the Software download page the udev rules have been updated to 00-teensy.rules but the Teensyduino installer is checking for 49-teensy.rules. Is there a step that I'm missing or does the download page need an update? Had a copy of the 49-teensy.rules on my Desktop so was able to finish install on the Laptop.
    Last edited by MikeH; 02-22-2021 at 05:45 PM.

  24. #74
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,426
    Quote Originally Posted by MikeH View Post
    I've encountered a problem while trying to update my Asus Laptop running Linux Mint 19.2 Cinnamon. On the Software download page the udev rules have been updated to 00-teensy.rules but the Teensyduino installer is checking for 49-teensy.rules. Is there a step that I'm missing or does the download page need an update? Had a copy of the 49-teensy.rules on my Desktop so was able to finish install on the Laptop.
    The Teensyduino installer is older than the new rules, that's all.

  25. #75
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,223
    You can also click the button to skip the udev rules check.

Posting Permissions

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