Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Running Tera Term macro as VS2019/VM 'post-build' step (Read 1072 times)
FrankP
Full Member
***
Offline


Posts: 240
Joined: Oct 19th, 2011
Running Tera Term macro as VS2019/VM 'post-build' step
Oct 15th, 2021 at 10:35pm
Print Post  
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:

Code
Select All
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.

Code
Select All
# 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:

Code
Select All
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
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Running Tera Term macro as VS2019/VM 'post-build' step
Reply #1 - Oct 16th, 2021 at 12:38am
Print Post  
At a guess I would say the long path name needs the quotes without the /v switch inside

"c:\Program Files (x86)\teraterm>ttpmacro.exe /v"

Code
Select All
"c:\Program Files (x86)\teraterm>ttpmacro.exe" /v 

  
Back to top
WWW  
IP Logged
 
FrankP
Full Member
***
Offline


Posts: 240
Joined: Oct 19th, 2011
Re: Running Tera Term macro as VS2019/VM 'post-build' step
Reply #2 - Oct 16th, 2021 at 3:08pm
Print Post  
Tim,

Yep - that was it.  Here's the correct line in board.txt

recipe.hooks.postbuild.1.pattern=cmd.exe /c "c:\Program Files (x86)\teraterm\ttpmacro.exe" /v "c:\users\Frank\Documents\Arduino\Teensy Projects\TeensyOTADemo\Test2.ttl" "{vm.runtime.build.final_output_path}" {serial.port} {build.project_name}

When passed to the Tera Term script file, it comes out as:

C:\Users\Frank\Arduino\Teensy Projects\TeensyOTADemo\Release\
COM4
TeensyOTADemo.ino


Thanks again,

Frank
« Last Edit: Oct 27th, 2021 at 2:46pm by FrankP »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint