teensy_loader_cli with multiple Teensys connected

Martin_Sistemi

New member
My system will have multiple Teensy 4.1 boards connected over USB at the same time, on a PC running Ubuntu. I need to deploy a (python) script to update the code running on all the Teensys.

What I have working (now) is a method to update one of them, when no other Teensy's are connected. I started with one, I haven't yet tried scenario where there are multiple.

The problem i see is that teensy_loader_cli doesn't support setting a target for connection. As I understand from researching this topic, teensy_loader_cli will scan the USB devices and update the first one it finds.

While researching this solution, I thought of the idea if I could send a command to the Teensy to reboot into the bootloader, and then run teensy_loader_cli, it would find the device that I just put into the bootloader. But I could not find a software method to put the Teensy into bootloader. I already have method to send the Teensy commands. What I did implement is to set SCB_AIRCR = 0x05FA0004; but this seems to cause a reset, and not jump to bootloader. I found the page on how to set Teensy 1.0 and 2.0 into bootloader, but not teensy 4.1. I am not sure if setting one of the attached Teensy's into bootloader would make it the target of teensy_loader_cli (while the other Teensy's would be running an application, and they all have a serial port opened to the PC).

Looking for general guidance, from which I could probably resolve the details.
 
Correction call: _reboot_Teensyduino_();

That Teensy will enter bootloader and then active Teensy Loader will upload to that Teensy as it changes to RED LED lit.
 
Last edited:
Years ago, I had the same situation (programming multiple Teensies connected to PC with same code), so I modified a teensy_loader_cli to enumerate first all Teensies on PC, and then downloaded the code to each of them. You can differentiate the different Teensies by their Comport.
 
Back
Top