Yes, use the teensy_loader_cli with the '-s' option.
mike@ubuntu:~/Downloads/teensy_loader_cli-master$ teensy_loader_cli --mcu=TEENSY40 blink_slow_Teensy40.hex -vs
Teensy Loader, Command Line, Version 2.2
Read "blink_slow_Teensy40.hex": 12132 bytes, 0.6% usage
Error opening USB device: No error
Waiting for Teensy device...
(hint: press the reset button)
The "Error opening USB device: No error" may suggests a bad cable or some other software on the system has taken control of the USB Serial port or the Teensy doesn't have an active USB Stack running to recognize the incoming request.
There was a recent update to the (udev?) "RULES" with TD 1.54 Beta 7 to account for new linux behavior
Teensy Loader, Command Line, Version 2.1
Read "spi_example.hex": 15572 bytes, 1.5% usage
Error opening USB device: No error
Waiting for Teensy device...
(hint: press the reset button)
Teensy Loader, Command Line, Version 2.1
Read "spi_example.hex": 15572 bytes, 1.5% usage
Soft reboot performed
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read "spi_example.hex": 15572 bytes, 1.5% usage
Programming................
Booting
Teensy Loader, Command Line, Version 2.1
Read "spi_example.hex": 18396 bytes, 0.9% usage
Unable to soft reboot with USB error: error sending control message: Broken pipe
Waiting for Teensy device...
(hint: press the reset button)
The broken pipe error was caused by a too short "SET_LINE_REQUEST_TYPE" message. The system was expecting 7 bytes (4 bytes for speed, 1 for stop bit, 1 for data bits, and another for parity) but the loader was only sending 1 byte. Grab the latest version from Github; it's fixed there.Maybe because I'm not on version 2.2?
The broken pipe error was caused by a too short "SET_LINE_REQUEST_TYPE" message. The system was expecting 7 bytes (4 bytes for speed, 1 for stop bit, 1 for data bits, and another for parity) but the loader was only sending 1 byte. Grab the latest version from Github; it's fixed there.
Teensy Loader, Command Line, Version 2.2
Read "spi_example.hex": 18396 bytes, 0.9% usage
Soft reboot performed
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read "spi_example.hex": 18396 bytes, 0.9% usage
Programming...............
Booting
$./teensy_loader_cli --mcu=TEENSY40 blink_slow_Teensy40.hex -vs
Teensy Loader, Command Line, Version 2.2
Read "blink_slow_Teensy40.hex": 12132 bytes, 0.6% usage
Soft reboot performed
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read "blink_slow_Teensy40.hex": 12132 bytes, 0.6% usage
Programming.........
Booting
me@raspberrypi:~/Documents/src/teensy_loader_cli $ ./teensy_loader_cli --mcu=TEENSY41 blink_slow_Teensy40.hex -v -s
Teensy Loader, Command Line, Version 2.2
Read "blink_slow_Teensy40.hex": 12132 bytes, 0.1% usage
Soft reboot performed
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read "blink_slow_Teensy40.hex": 12132 bytes, 0.1% usage
Programming.........
Booting
me@raspberrypi:~/Documents/src/teensy_loader_cli $ ./teensy_loader_cli --mcu=TEENSY41 blink_slow_Teensy40.hex -v -s
Teensy Loader, Command Line, Version 2.2
Read "blink_slow_Teensy40.hex": 12132 bytes, 0.1% usage
Error opening USB device: No error
Waiting for Teensy device...
(hint: press the reset button)
me@raspberrypi:~/Documents/src/teensy_loader_cli $ ./teensy_loader_cli --mcu=TEENSY41 blink_slow_Teensy41.hex -v -s
Teensy Loader, Command Line, Version 2.2
Read "blink_slow_Teensy41.hex": 13428 bytes, 0.2% usage
Soft reboot performed
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read "blink_slow_Teensy41.hex": 13428 bytes, 0.2% usage
Programming...........
Booting
me@raspberrypi:~/Documents/src/teensy_loader_cli $ ./teensy_loader_cli --mcu=TEENSY41 blink_slow_Teensy41.hex -v -s
Teensy Loader, Command Line, Version 2.2
Read "blink_slow_Teensy41.hex": 13428 bytes, 0.2% usage
Soft reboot performed
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read "blink_slow_Teensy41.hex": 13428 bytes, 0.2% usage
Programming...........
Booting
pi@raspberrypi:~/dev/teensy_loader_cli $ ./teensy_loader_cli --mcu=TEENSY40 -w -v ../firmware.hex
Teensy Loader, Command Line, Version 2.2
Read "../firmware.hex": 77824 bytes, 3.8% usage
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read "../firmware.hex": 77824 bytes, 3.8% usage
Programming.........................................................................
Booting
int soft_reboot(void)
{
usb_dev_handle *serial_handle = NULL;
serial_handle = open_usb_device([B][U]0x16C0, 0x0483[/U][/B]);
if (!serial_handle) {
char *error = usb_strerror();
printf("Error opening USB device: %s\n", error);
return 0;
}
char reboot_command[] = {0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08};
int response = usb_control_msg(serial_handle, 0x21, 0x20, 0, 0, reboot_command, sizeof reboot_command, 10000);
usb_release_interface(serial_handle, 0);
usb_close(serial_handle);
if (response < 0) {
char *error = usb_strerror();
printf("Unable to soft reboot with USB error: %s\n", error);
return 0;
}
return 1;
}
pi@raspberrypi:~/dev/teensy_loader_cli $ lsusb
Bus 001 Device 009: ID [B][U]16c0:048a[/U][/B] Van Ooijen Technische Informatica
Bus 001 Device 004: ID 0bda:818b Realtek Semiconductor Corp. RTL8192EU 802.11b/g/n WLAN Adapter
Bus 001 Device 005: ID 0483:5750 STMicroelectronics
Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~/dev/teensy_loader_cli $ ./teensy_loader_cli --mcu=TEENSY40 -s -v ../firmware.hex
Teensy Loader, Command Line, Version 2.2
Read "../firmware.hex": 77824 bytes, 3.8% usage
Soft reboot performed
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read "../firmware.hex": 77824 bytes, 3.8% usage
Programming.........................................................................
Booting