Teensy LC Arduino "Unable to Reboot" and "Download Error"

Status
Not open for further replies.

Matthewteta

New member
I received my Teensy LC today and plugged it in to my Windows 7 PC. I downloaded the newest Teensy Loader and installed the drivers and libraries for Arduino. The first thing I noticed was that is was difficult to connect to the program because they tell you to tap when you really have to hold for a few seconds. When I connected it, I pressed the "Reboot" button and the software said "Unable to Reboot." Here is the log when I tried to reboot:
21:42:18: Teensy Loader 1.17, begin program
21:42:18: File "Blink.cpp.hex". 10076 bytes, 15% used
21:42:18: Listening for remote control on port 3149
21:42:18: initialized, showing main window
21:42:18: HID/win32: vid:16C0 pid:0478 ver:0102
21:42:18: HID/win32: usage_page:FF9C, usage:0020
21:42:18: Device came online, code_size = 65536
21:42:18: Board is: Unknown board, version 1.02
21:42:18: File "Blink.cpp.hex". 10076 bytes, 15% used
21:42:18: HID/win32: HidD_GetPreparsedData ok, device still online :)
21:42:22: Reboot event
21:42:22: begin operation
21:42:22: sending reboot
21:42:22: begin wait_until_offline
21:42:22: HID/win32: HidD_GetPreparsedData ok, device still online :)
21:42:25: offline failed, timeout after 50
21:42:25: reboot error
21:42:25: end operation
21:42:25: redraw timer set, image 13 to show for 4000 ms
21:42:27: Verbose Info event
21:42:29: redraw, image 10

I then tried to Upload simple blink code from Arduino and made sure all the settings for the board and port were correct and pressed upload. Teensy Loader Immediately says "Download Error". Here is the Verbose Info:
21:46:12: Teensy Loader 1.17, begin program
21:46:12: File "Blink.cpp.hex". 10076 bytes, 15% used
21:46:12: Listening for remote control on port 3149
21:46:12: initialized, showing main window
21:46:13: HID/win32: vid:16C0 pid:0478 ver:0102
21:46:13: HID/win32: usage_page:FF9C, usage:0020
21:46:13: Device came online, code_size = 65536
21:46:13: Board is: Unknown board, version 1.02
21:46:13: File "Blink.cpp.hex". 10076 bytes, 15% used
21:46:13: HID/win32: HidD_GetPreparsedData ok, device still online :)
21:46:19: file changed
21:46:19: File "Blink.cpp.hex". 10076 bytes, 15% used
21:46:19: remote connection opened
21:46:19: remote cmd: "comment: Teensyduino 1.21 - WINDOWS"
21:46:19: remote cmd: "dir:C:\Users\MATTHE~1\AppData\Local\Temp\build2206859881146974548.tmp\"
21:46:19: remote cmd: "file:Blink.cpp.hex"
21:46:19: File "Blink.cpp.hex". 10076 bytes, 15% used
21:46:19: remote cmd: "status"
21:46:19: status data sent
21:46:19: remote cmd: "auto:eek:n"
21:46:19: File "Blink.cpp.hex". 10076 bytes, 15% used
21:46:19: elf size appears to be 65536
21:46:19: elf binary data matches hex file
21:46:19: Code size from .elf file = 65536
21:46:19: begin operation
21:46:19: remote connection closed
21:46:20: flash, block=0, bs=1024, auto=1
21:46:20: program: write error
21:46:20: HID/win32: HidD_GetPreparsedData ok, device still online :)
21:46:20: end operation
21:46:20: redraw timer set, image 11 to show for 4000 ms
21:46:20: remote connection opened
21:46:20: remote cmd: "status"
21:46:20: status data sent
21:46:20: remote cmd: "auto:eek:n"
21:46:20: File "Blink.cpp.hex". 10076 bytes, 15% used
21:46:20: elf size appears to be 65536
21:46:20: elf binary data matches hex file
21:46:20: Code size from .elf file = 65536
21:46:20: begin operation
21:46:20: flash, block=0, bs=1024, auto=1
21:46:20: program: write error
21:46:20: HID/win32: HidD_GetPreparsedData ok, device still online :)
21:46:20: end operation
21:46:20: redraw timer set, image 11 to show for 4000 ms
21:46:20: remote connection closed
21:46:23: Verbose Info event
21:46:24: redraw, image 10

I haven't tried much else other than disconnecting and reconnecting the board. Thanks for the help!



EDIT: I solved the issue by having the Arduino program start Teensy Loader. I didn't realize it but the Teensy loader was recognizing it as a different type of board. It looked black instead of the green one I have.
 
Last edited:
Is Windows giving you "new USB device" messages and installing drivers? If so, you need to let that finish first and then try again. (It will do that for each USB type - keyboard, MIDI, rawHID etc - you use, the first time you use it. You can speed things up a little by telling Windows not to search online on Windows Update, which it will do (each time) without ever finding anything).

When you say you "downloaded the newest Teensy Loader and installed the drivers and libraries for Arduino" should that be taken to mean
a) You downloaded and unzipped Arduino (which version) and then downloaded Teensyduino (which version) and ran that, updating the unzipped Arduino to add Teensy support, or
b) You only downloaded the Teensy Loader (which is available as a standalone download, but is only used to upload hex files to Teensy, which were created in another environment (or by someone else with a full teensyduino install)
 
I have long wanted to find a way for Teensyduino to detect when the New Hardware Wizard is running. Sadly, searching always turns up a sea of end-user Windows troubles. Maybe programming info is out there somewhere?

If Teensyduino could detect when that damn Wizzard was running, it could lengthen the time it waits. Normally, Teensy responds rapidly, so those waits aren't very long before Teensyduino detects communication errors. But the Wizzard adds delays on the scale of 10 seconds to a minute. If I could detect it, I could have Teensy Loader display a special dialog box to show it's waiting for the New Hardware Wizard. That box could have some strongly worded advice to NOT press the button on Teensy while the Wizzard slowly does its thing.

But so far, I've been unable to find any technical info about any way a Windows user-space program can tell when the New Hardware Wizard is running and delaying the device enumeration.
 
Paul: Is there a safe ping you could do? Device might be non-responsive in a special way when this is happening. Assuming you get to see the device initially before windows tries to update it and takes it under its wing.
 
Paul: Is there a safe ping you could do?

No. Or at least not from user-space programming, and there's no way I'm going to venture into the deep waters of installing kernel-level code.

The trouble is USB enumeration takes an unknown length of time. Enumeration is the process where the USB root hub or any connected hub has detected a new device, and various drivers perform many steps to initialize it and query its capabilities, which causes more drivers to load and do their initialization.

I believe I have the threshold for error at 5 seconds. But the New Hardware Wizard blocks enumeration and spends far more than 5 seconds. Only Windows is so slow.

I can't do some sort of ping or query, partly because the wait is during a time when kernel-level code isn't allowing access from user space, because it's figuring out which drivers to load, but also partly because the normal process is being further disrupted by the New Hardware Wizard.

If I could just find a reliable way to detect when that damn New Hardware Wizard is running and preventing USB stuff from working, I could make the Windows software work so much better. But so far, I've been unable to find any info.
 
I can't do some sort of ping or query, partly because the wait is during a time when kernel-level code isn't allowing access from user space

I suppose I was actually wondering as well if there is something 'innocent & independent' that normally works - that stops working at this time. That independent 'ping' failing that might indicate it is not a good time to try to proceed.
 
Paul: Is this anywhere near responsive to your need and something your code can do and not already doing?
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363431(v=vs.85).aspx

As I read it - you'd get alerted to some device events coming and going that might give you a clue about 'DBT_DEVNODES_CHANGED' on these events happen? All of this may be unrelated or after the fact to a driver update attempt. These links do get you into that part of windows devices in case you spend a minute browsing and recognize something do-able.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa363432(v=vs.85).aspx
Registering for Device Notification
Applications can use the RegisterDeviceNotification function to register to receive notification messages from the system. The following example shows how to register for notification of events for the device interfaces which are members of the interface class whose GUID is passed to the function.
 
I took the liberty of asking a question on StackOverflow- https://stackoverflow.com/questions...w-hardware-wizard-is-running-usb-device-conne

Which so far netted this reply, which I don't entirely understand and you may already know all this anyway, but just in case:

Maybe a slight modification to your approach: "Found New Hardware" doesn't give you actionable information, since that same wizard appears for many different devices. On the other hand, after enumeration and before driver installation (driver identification and installation is the slow part), a device node appears that already has the correct VID and PID associated to it. So you should use the usual methods, but also look for devices categorized as unknown, and not just serial-port or mass-storage or whatever final driver you want.

If you find the matching device, you can tell something about driver install progress by querying the DEVPKEY_Device_InstallState property. Possible values listed here:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff543130(v=vs.85).aspx

– Ben Voigt 33 mins ago
 
Why not VirtualBox? The USB passthrough works well (install the Oracle extension pack though), at least on a Linux host. You can make many snapshots and go back to any of them as much as you want and it's pretty much instantaneous.

Inside the VM configuration, on the USB page, you can set up a filter to automatically capture the USB devices of interest. For example a filter with VID = 0x16C0 will capture every Teensy you plug into the host. This way you don't have to go in the menu each time (which is impratical when the loader reboots the board).
 
I've had a lot of trouble getting accurate results with virtualbox and vmware. The "usb passthrough" feature isn't as transparent as you might think.
 
I've had a lot of trouble getting accurate results with virtualbox and vmware. The "usb passthrough" feature isn't as transparent as you might think.
Yeah the issue seems to be that Teensy shows up as multiple devices and switches back and forth.
In the past I had success by adding USB filters to the VM for the USB device (vendor, device id etc..) and enabling them.. That way the USB device is automatically handed to the guest when it showed up on the bus. In the newer versions of Virtual Box it seems that even if you enable these, the VM doesn't seem to remember the setting and you have to manually turn it back on each time the teensy changes devices and reconnects.
 
Hi, a newbie, try to load program to teensy 2.0, got message let to press button on board, i did, then stopped on the half way, then I cannot do any thing about, no erasing, no reboot...
 
Hi laoadam:

You might want to create a new thread for this as this thread was about the Teensy-LC

You might also include some additional information, like type of PC running what? what version of Arduino did you install, likewise Teensyduino? Did you try loading up a simple sketch like blink. Make sure to choose Teensy 2 in the boards type, make sure the usb type is serial. Make sure the Teensy 2 is connected to your PC with a valid USB cable. Then click Verify in the IDE. Teensyduino program should launch when the verify is complete. Then press the program button, which should then cause the program to be downloaded to your Teensy 2.
 
thanks, I'll start a new one.

Hi laoadam:

You might want to create a new thread for this as this thread was about the Teensy-LC

You might also include some additional information, like type of PC running what? what version of Arduino did you install, likewise Teensyduino? Did you try loading up a simple sketch like blink. Make sure to choose Teensy 2 in the boards type, make sure the usb type is serial. Make sure the Teensy 2 is connected to your PC with a valid USB cable. Then click Verify in the IDE. Teensyduino program should launch when the verify is complete. Then press the program button, which should then cause the program to be downloaded to your Teensy 2.

thanks, I'll start a new one. sorry, I can't start a new topic,why?
 
Last edited:
Status
Not open for further replies.
Back
Top