Upload to teensy 4 without button press

donperryjm

Well-known member
Hello,
Been searching for ways to program without pressing the button. Could the teensy loader software include that as an advanced option?
The projects I've found that do this have so far been limited to standard files, not the encrypted bins.
 
More details needed?

Upload of encrypted sketch .eHex files can only be done with PJRC tools Teensy.exe Loader and the command line version.

That works natively with Arduino IDE, no Button needed.

Can also be facilitated with TyCommander GUI using the --delegate option where it takes the IDE request, pops up a Teensy list to pick for upload and pushes the Teensy to Bootloader for the Teensy.exe to perform the upload. Repeat uploads of same sketch are then associated with that Teensy without asking again.

What OS and what alternate is needed/used? Non development end user upload?
 
Look for the teensy_reboot program. Or teensy_post_compile with "-reboot", which causes it to automatically run teensy_reboot after updating Teensy Loader with the filename.

On Windows using Arduino 1.8.19 with Teensyduino 1.57, the default location is C:/Program Files (x86)/Arduino/hardware/tools.

To see the exact command line Arduino uses to run this stuff, turn on the verbose output options in File > Preferences.
 
The good ole faithful Defragster,

This is in a limited run production item. Sometimes bugs discovered needs a firmware update release.
I have no problem shipping the teensy.exe in the update package.
 
Look for the teensy_reboot program. Or teensy_post_compile with "-reboot", which causes it to automatically run teensy_reboot after updating Teensy Loader with the filename.

On Windows using Arduino 1.8.19 with Teensyduino 1.57, the default location is C:/Program Files (x86)/Arduino/hardware/tools.

To see the exact command line Arduino uses to run this stuff, turn on the verbose output options in File > Preferences.



Ahh that's where I saw it. Alright Uncle
 
So wait, if all files are in c:\temp
and my ehex file is "file.ehex"

what would that upload command look like?

Code:
C:\temp\teensy_post_compile -file=file.ehex-path=C:\temp -tools=C:\temp/../tools -board=TEENSY40 -reboot -port=usb:0/140000/0/1/1/3 -portlabel=(null) -portprotocol=(null)
?
 
Last edited:
I'm almost there. When I run that using file= file.ehex
the teensy.exe says it cannot find file.ehex.hex

That'll have to be worked through - only shipping the .eHex and getting the path to it accepted.
When the IDE builds it has both including the .hex and defers to the .eHex when present if it works.

That has the painful need to expound on the USB numeric address.
 
The following seems to work. Saved as a BAT file that I call "UpdateFirmware.bat"

Code:
@echo off 
start teensy.exe bin.ehex
@echo on 
@echo Firmware will be updated with bin.ehex
@echo 1. Connect the device via USB...

@echo 2. Please close all applications before continuing
@echo off 
pause

start teensy_reboot.exe
 
Back
Top