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

Thread: Force Teensy to reboot and load program via USB

  1. #1
    Junior Member
    Join Date
    Jan 2016
    Posts
    13

    Force Teensy to reboot and load program via USB

    Hello,

    is there a possibility to force the teensy to restart via usb, although the message "Teensy did not respond to a USB-based request to automatically reboot. Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch." appears? I did built my teensy into a case and I definetely want to avoid to re-open that case.

    Restarting PC, changing USB-Port, switching to an other PC didn't help.

    Hope someone might have a helping advice.

    Greetings
    Jonas

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,769
    Forum search for tyqt perhaps it does what you need

  3. #3
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    thanks, but I have a Teensy 3.2 and TyQt seems to not support them. It doesn't show up in the programm gui, when I connect it to my computer..

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,769
    Tyqt fully supports the 3.2 very well. Something else is going on.

  5. #5
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    okay, well it doesn't show up in TyQt unfortunately. The teensy itself seems to work, the program I uploaded before is running without problems, but I cant't upload any new program. Do you maybe have some further advice or do you think I have to open the case and press that program button?
    Last edited by JonasJonas; 08-12-2016 at 01:08 PM.

  6. #6
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,345
    Quote Originally Posted by JonasJonas View Post
    okay, well it doesn't shop up in TyQt unfortunately. The teensy itself seems to work, the program I uploaded before is running without problems, but I cant't upload any new program. Do you maybe have some further advice or do you think I have to open the case and press that program button?
    Do you have any indication that Teensy is running after power cycle? I assume you have USB enabled. Does PC makes nose after power cycle?
    If yes, you should be able to reprogram, if program crashes (also if PC looses connection to teensy) only way is to press button (or short prog line to ground)
    In that case, I'm afraid you have to open the case.

  7. #7
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    Teensy is running after power cycle. But the problem remains. Yes, USB enabled, USB type is MIDI. What do you mean by "PC makes nose after power cycle"? A restart of the PC doesn't help. But the PC seems to recognise and accept the teensy, it is listed in the device manager with no driver problems or something else indicated.

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,769
    Do you have a second Teensy that you could work with to see how it works - test the cable and software? Was USB type Serial enabled on the uploaded sketch?

    This link won't help much if you can't reprogram or push the button - but if you went through it on a second Teensy you should see it work and maybe come to the difference?

  9. #9
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    No, unfortunately no second teensy aviable.. Well no, I think I had USB type MIDI, but it might have been USB type MIDI + Serial. I didn't upload the previous sketch, a friend of mine did..
    Last edited by JonasJonas; 08-12-2016 at 01:22 PM.

  10. #10
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,345
    Quote Originally Posted by JonasJonas View Post
    Teensy is running after power cycle. But the problem remains. Yes, USB enabled, USB type is MIDI. What do you mean by "PC makes nose after power cycle"? A restart of the PC doesn't help. But the PC seems to recognise and accept the teensy, it is listed in the device manager with no driver problems or something else indicated.
    (power cycle of teensy) but you said it is running, then change cable.
    If teensy shows up ad HID device or Com device and Teensyduino is set for proper Teensy, then it should reprogram.
    Last edited by WMXZ; 08-12-2016 at 02:14 PM.

  11. #11
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    cable changed -> nothing changed..
    Yes, the teensy shows up as HID device and works fine as a MIDI controller in my DAW. It's really strange, that it's not possible to reprogram it then.

  12. #12
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,345
    Quote Originally Posted by JonasJonas View Post
    cable changed -> nothing changed..
    Yes, the teensy shows up as HID device and works fine as a MIDI controller in my DAW. It's really strange, that it's not possible to reprogram it then.
    At this point, IMO, the programming is not clear.
    what is your setup versions of Arduino, Teensyduino, etc. try to compile a simple blink program from Arduino ide, with proper settings of USB type and processor
    why?
    we have to use the simplest program to know what may going on.

    Your OP did not say anything on what type of program you tried to download.

  13. #13
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    Arduino 1.6.9, Teensyduino 1.29

    Can't upload the simplest program because the teensy doesn't respond to the usb-based request to reboot..
    USB type MIDI, Board Teensy 3.2/3.1, CPU 96MHZ optimized (overclock).

    The program thats currently running on the teensy seems to be a MIDI + Serial USB-Type program because the teensy appears as a HID and a Serial device in my device manager.. Might that be a reason for my problem?

  14. #14
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,345
    Quote Originally Posted by JonasJonas View Post
    Arduino 1.6.9, Teensyduino 1.29

    Can't upload the simplest program because the teensy doesn't respond to the usb-based request to reboot..
    USB type MIDI, Board Teensy 3.2/3.1, CPU 96MHZ optimized (overclock).

    The program thats currently running on the teensy seems to be a MIDI + Serial USB-Type program because the teensy appears as a HID and a Serial device in my device manager.. Might that be a reason for my problem?
    No, that should not inhibit a reprograming request. (you mean reprogram and not reboot, right).

    what happens if you run form terminal the attached program (PC only,in zip file)
    teensyloader_cli -l
    this lists all hid and com devices
    and
    teensyLoader_cli -mmcu=mk20dx256 -v blink_31.hex
    downloads a blink program
    Attached Files Attached Files

  15. #15
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    Thanks, but no success again.. This shows up after trying to program it with the blink program:

    Code:
    Device Instance: 1
      DeviceRegistryProperty: acquired
      Key type: REG_MULTI_SZ
        property: USB\VID_16C0&PID_0485&REV_0200&MI_00
        property: USB\VID_16C0&PID_0485&MI_00
    
    found_hid
     vid = 0x06CB, pid = 0x7407 ser = 9999
    no Teensy
    
    found_hid
     vid = 0x045E, pid = 0x0805 ser =
    no Teensy
    
    found_hid
     vid = 0x06CB, pid = 0x7407 ser = 9999
    no Teensy
    
    found_hid
     vid = 0x2BF6, pid = 0xA096 ser =
    no Teensy
    
    found_hid
     vid = 0x2BF6, pid = 0xA096 ser =
    no Teensy
    Teensy Loader, Command Line, Version 2.1d (WMXZ)

  16. #16
    Junior Member
    Join Date
    Aug 2016
    Posts
    18
    Interesting - when I set USB to MIDI with Serial using Arduino 1.6.9 and Teensyduino 1.29, I always have to press the program button as upload always fails. The only difference is I'm on a Mac instead of Windows.

  17. #17
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,345
    Quote Originally Posted by JonasJonas View Post
    Thanks, but no success again.. This shows up after trying to program it with the blink program:

    Code:
    Device Instance: 1
      DeviceRegistryProperty: acquired
      Key type: REG_MULTI_SZ
        property: USB\VID_16C0&PID_0485&REV_0200&MI_00
        property: USB\VID_16C0&PID_0485&MI_00
    
    found_hid
     vid = 0x06CB, pid = 0x7407 ser = 9999
    no Teensy
    
    found_hid
     vid = 0x045E, pid = 0x0805 ser =
    no Teensy
    
    found_hid
     vid = 0x06CB, pid = 0x7407 ser = 9999
    no Teensy
    
    found_hid
     vid = 0x2BF6, pid = 0xA096 ser =
    no Teensy
    
    found_hid
     vid = 0x2BF6, pid = 0xA096 ser =
    no Teensy
    Teensy Loader, Command Line, Version 2.1d (WMXZ)
    OK,
    it found the teensy

    program looks first for com ports
    it found a teensy with PID 485, which describes a MIDI.
    It could not find a teensy as HID device (only other attached devices, wich is weird as I thought MIDI is HID, but I don't know anything about MIDI)

    Unfortunately, the program as it stands now, ignores PID 485 for Serial ports. It looks for 483 or 487.
    Consequently program thinks, there is no valid teensy and asks for button press.
    This MIDI + Serial was introduced a couple of month ago, but did not get unique PID.

    I'm out of town today, but will try to look into my program in about 12 h from now.
    OK you always, can press button, but I'm curies to see if my theory is correct.
    Solution should be trivial, but needs testing.

  18. #18
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,345
    Quote Originally Posted by WMXZ View Post
    OK you always, can press button, but I'm curies to see if my theory is correct.
    Or, if you are in a hurry, you can open device manager, identify comport, say com19

    follow usual download procedure (i.e. from Arduino/Teensyduino)
    on request press program button
    open terminal program (I use PuTTYtel), open comport with Baud rate set to 134 (sic)
    it should then put teensy into programming mode
    you will see comport disappearing and HID coming up with PID 478
    and program should start loading.

  19. #19
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,345
    Quote Originally Posted by WMXZ View Post
    Or, if you are in a hurry, you can open device manager, identify comport, say com19

    follow usual download procedure (i.e. from Arduino/Teensyduino)
    on request press program button
    open terminal program (I use PuTTYtel), open comport with Baud rate set to 134 (sic)
    it should then put teensy into programming mode
    you will see comport disappearing and HID coming up with PID 478
    and program should start loading.
    concerning OP, open terminal with 134 baud is the best way to force teensy into reboot without pressing prog button.
    (as of TD 1.29 and until Paul upgrades teensy_reboot.exe)

    Obviously this requires serial set in Arduino tools and therefore accessible comport (no crashed mcu)
    so far this is only necessary for recently added midi + protocols (i.e all usb protocols that use CDC)
    plain usb_serial is already handled in teensy_reboot.exe

  20. #20
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    Thanks for your time!

    I'm not that into this topic, so I am struggling with understanding what to do now.. Sorry for that!

    What exactly do I have to do with PuTTYtel now? Setting Baud rate to 134 is possible in the device manager as well, isn't it?

  21. #21
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,345
    Quote Originally Posted by JonasJonas View Post
    Thanks for your time!

    I'm not that into this topic, so I am struggling with understanding what to do now.. Sorry for that!

    What exactly do I have to do with PuTTYtel now? Setting Baud rate to 134 is possible in the device manager as well, isn't it?
    I know, you always can open the box and press the pro button.
    yes, you can set baud rate in the device manager, but this does not open the device.

    what I do in PuTTtel (the only one I have) is

    - open PuTTYtel
    - change port to the one teensy is on and baudrate to 134 and press open. that's all.

    once you connect to teensy with that baud rate, it will go into program mode.

    That is how teensyduino does it. Obviously TD does more, and does something different for HID devices.
    Last edited by WMXZ; 08-14-2016 at 04:52 PM.

  22. #22
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    okay, but is it correct that nothing happens, when I press open? No window, no message, nothing..

  23. #23
    Junior Member
    Join Date
    Jan 2016
    Posts
    13
    okay I got it! I used the windows cmd, PuTTY dind't work. But now it's fully programmable with Arduino/Teensyduino again.

    Code:
    C:\Users\Ich>powershell
    Windows PowerShell
    Copyright (C) 2015 Microsoft Corporation. Alle Rechte vorbehalten.
    
    PS C:\Users\Ich> [System.IO.Ports.SerialPort]::getportnames()
    COM3
    PS C:\Users\Ich> $port= new-Object System.IO.Ports.SerialPort COM3,134,None,8,one
    PS C:\Users\Ich> $port.open()
    PS C:\Users\Ich> $port.Close()
    PS C:\Users\Ich> exit
    Thank you very much for your help!

Posting Permissions

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