I'm guessing that by "command line loader" you are asking for a tool that will load the hex file into the Teensy. Two capabilities are required, but only one of those capabilities is implemented in the command line loader right now.
- Send hex image to a Teensy running its bootloader -- Working
- Request that the Teensy start the bootloader -- Not implemented
Several owners of Teensys have been successful in using the command line loader in situations where we have local desktop access: Pressing Teensy's reboot button forces the the Teensy into bootloader mode. (This is where the mini54 chip comes in, which is the basis of the unbrickable nature of the Teensy 3.x.).
As currently provided by Paul, the command line loader depends on libusb-0.1-x and should compile on any Linux machine with a compatible libusb, including the RPi. The command line loader requires minimal system resources, and should run very comfortably on the RPi.
That leaves the question of how to persuade the Teensy to start the bootloader. The obvious way, either press the button or temporarily ground the reboot signal (equivalent to pressing the button), requires access to the Teensy, either physically or electrically.
Another way is programatically. Paul's graphical loader sends USB control packets that the Teensy interprets as a request to reboot, which starts the bootloader, and subsequently loads the image. The function used to start the bootloader can be executed by the sketch on command. The following code snippet does an equivalent operation on request. In this code, upon seeing a substring "reboot" anywhere in a commandBuffer character array, the unit waits 10 seconds (to allow the user to disconnect a serial monitor or whatever), then calls _reboot_Teensyduino_() which starts the bootloader.
Code:
else if( strstr(commandBuffer, "reboot") )
{
Serial.write(" Rebooting\r\n");
delay(10000);
_reboot_Teensyduino_();
break;
}
One final note: If the RPi has moved on to libusb-1.0 (as I learned is the default for my various Ubuntu systems), it is necessary either to find libusb-0.1-x or use an updated version of the bootloader. I have been sneaking a few hours of maintenance time into the bootloader to support libusb-1.0. That code is up on github:
https://github.com/len-samuelson/teensy_loader_cli
The Makefile allows selecting the version of libusb to use, defaulting to the original libusb-0.1. If you clone the git repository and have difficulty compiling or using it, I will try to answer any questions you may have. I have not asked Paul to pull it yet, as I have not had time to verify it beyond some basic sanity checks; consider it to be experimental. It is known to compile and run on Ubuntu-14.04 workstation and an Odroid-U2 (ARMv7 architecture dev board).