Tim,
I am trying to achieve seamless 'over-the-air' (OTA) updates for a Teensy microcontroller via a BT link from my PC to a HC-05 connected to the Teensy's Serial1 hardware interface.
I have created a C# executable that is called by the Arduino compile step as a 'post-build' event using the 'board.txt' technique. This actually works pretty well, but is about 3x slower than transferring the .HEX file to the Teensy manually via Tera Term. I have no idea why this is so, but some Googling leads me to believe this is a problem with .NET serial port code
As an alternative, I have created a Tera Term macro that automates the process of transferring the .HEX file using Tera Term. This works very well when I run the macro directly from a Windows 10 command line, but I'm having trouble getting it launched as a post-build step in VS2019/VM using 'board.txt'.
To test everything out, I ran the macro from a command-line console using this command line:
c:\Program Files (x86)\teraterm>ttpmacro.exe /v "c:\users\Frank\Documents\Arduino\Teensy Projects\TeensyOTADemo\TeensyOTA1.ttl" 4
Where 'TeensyOTADemo.ttl' is the Tera Term macro file, and '4' is the COMM port number.
Here's my current 'board.txt' contents.
# Teensy OTA Demo build property overrides
# 10/05/21 gfp - trying to run a post-build command
# 10/15/21 gfp - change to use Tera Term macro vs custom C# program
recipe.hooks.postbuild.1.pattern=cmd.exe /c "c:\Program Files (x86)\teraterm>ttpmacro.exe /v" "c:\users\Frank\Documents\Arduino\Teensy Projects\TeensyOTADemo\TeensyOTA1.ttl" "\"{vm.runtime.build.final_output_path}"" {serial.port} {build.project_name}
Unfortunately, when I try compiling my Teensy code, I get the following output:
Compiling 'TeensyOTADemo' for 'Teensy 3.5'
Using previously compiled file: duino.h.gch
Program size: 50,068 bytes (used 10% of a 524,288 byte maximum) (0.83 secs)
Minimum Memory Usage: 5348 bytes (2% of a 262136 byte maximum)
The filename, directory name, or volume label syntax is incorrect
C:\Program Files (x86)\Arduino\java\bin>"c:\Program Files (x86)\teraterm>ttpmacro.exe /v" "c:\users\Frank\Documents\Arduino\Teensy Projects\TeensyOTADemo\TeensyOTA1.ttl" "\"C:\Users\Frank\Documents\Arduino\Teensy Projects\TeensyOTADemo\Release\"" COM4 TeensyOTADemo.ino
Opening Teensy Loader
I have no idea how the '\Arduino\java\bin' part of the path got inserted, so any edification would be appreciated.
TIA,
Frank