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 Project Build Properties Appear and Disappear (Read 1116 times)
FrankP
Full Member
***
Offline


Posts: 240
Joined: Oct 19th, 2011
Project Build Properties Appear and Disappear
Sep 27th, 2021 at 12:49am
Print Post  
I'm using VM's 'board.txt' feature to create a post-build process for a Teensy sketch that involves launching a Windows Console App and passing it some build property parameters.  As suggested by Tim, I compiled my Teensy sketch with 'show build properties' enabled which produces a list of build properties that can be utilized as labels in the post-build statement.  When the post-build statement(s) is executed, the labels are expanded to their values at that time, and it is the actual values that get passed to my console application as string entries in the args[] string array.

For my application I need to know what serial port is being used, so I chose the 'serial.port.num' parameter which expands to just the numeric part of the port label, i.e. '6' for COM6.  This works great, but today I discovered that this parameter was no longer part of the build properties, and instead of being expanded as part of the post-build command processing, the literal string '{serial.port.num}' was passed to my console app instead.  Needless to say, this did not end well for my application.

So, I looked a little closer at the 'build properties' displayed when the Teensy app is compiled, and I see quite a bit of variation in what serial port related build properties are available.  When I select COM5 (available in the list but AFAIK not connected to anything) I get:

Code (C++)
Select All
serial.port.file=COM5
serial.port=COM5
serial.port.num=5
 



When I select COM6 - connected to a Pololu Wixel (the local end of a wireless serial link), I get:
Code (C++)
Select All
serial.port.caption=COM6   - Wixel
serial.Caption=Wixel (COM6)
serial.ClassGuid={4d36e978-e325-11ce-bfc1-08002be10318}
serial.CompatibleID.value0=USB\Class_02
serial.ConfigManagerErrorCode=0
serial.ConfigManagerUserConfig=False
serial.CreationClassName=Win32_PnPEntity
serial.Description=Wixel
serial.DeviceID=USB\VID_1FFB&PID_2200\D4-AD-C5-07
serial.HardwareID.value0=USB\VID_1FFB&PID_2200
serial.Manufacturer=Pololu Corporation
serial.Name=Wixel (COM6)
serial.PNPClass=Ports
serial.PNPDeviceID=USB\VID_1FFB&PID_2200\D4-AD-C5-07
serial.Present=True
serial.Service=usbser
serial.Status=OK
serial.SystemCreationClassName=Win32_ComputerSystem
serial.SystemName=FRANKNEWXPS15
serial.vid=0x1FFB
serial.pid=0x2200
serial.vidpid=1FFB2200
serial.vid_pid=0x1FFB_0x2200
serial.iserial=D4-AD-C5-07
serial.port.iserial=D4-AD-C5-07 



And when I select COM11 which shows as a Teensy 3.5 but without the actual hardware connected, I get

Code (C++)
Select All
serial.serial.port.port=usb:10000/0/0/2/4/9
serial.serial.port.label=COM11 (Teensy 3.5) Serial
serial.serial.port.protocol=Teensy
 



And when I select the same port (COM11) but now with an actual Teensy 3.5 connected, I get

Code (C++)
Select All
serial.port.caption=COM11 - USB Serial Device
serial.Caption=USB Serial Device (COM11)
serial.ClassGuid={4d36e978-e325-11ce-bfc1-08002be10318}
serial.CompatibleID.value0=USB\Class_02
serial.ConfigManagerErrorCode=0
serial.ConfigManagerUserConfig=False
serial.CreationClassName=Win32_PnPEntity
serial.Description=USB Serial Device
serial.DeviceID=USB\VID_16C0&PID_0483\3016580
serial.HardwareID.value0=USB\VID_16C0&PID_0483
serial.Manufacturer=Microsoft
serial.Name=USB Serial Device (COM11)
serial.PNPClass=Ports
serial.PNPDeviceID=USB\VID_16C0&PID_0483\3016580
serial.Present=True
serial.Service=usbser
serial.Status=OK
serial.SystemCreationClassName=Win32_ComputerSystem
serial.SystemName=FRANKNEWXPS15
serial.vid=0x16C0
serial.pid=0x0483
serial.vidpid=16C00483
serial.vid_pid=0x16C0_0x0483
serial.iserial=3016580
serial.port.iserial=3016580
 




So, I'm not quite sure how to proceed.  It looks like build properties associated with a serial port depend to some degree on what is (or was) connected.  In the case of the Teensy 3.5, it appears that if I want to know the serial port number, I have to use {serial.serial.port.label} in my post-build argument list if the actual Teensy isn't connected, but {serial.port.caption} or {serial.Caption} or {serial.Name} if it is connected.

So it appears that I'll either need some if/then logic in board.txt to determine which parameter set to use, or put multiple {serial.xxx} parameters in the board.txt argument list and then some smarts in my console app to not choke on literal parameter strings instead of build property value expansions.

I have a headache! Wink
« Last Edit: Sep 27th, 2021 at 1:07am by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Project Build Properties Appear and Disappear
Reply #1 - Sep 27th, 2021 at 1:07am
Print Post  
If I recall serial.port is the only valid one, other can change based on driver.
  
Back to top
WWW  
IP Logged
 
FrankP
Full Member
***
Offline


Posts: 240
Joined: Oct 19th, 2011
Re: Project Build Properties Appear and Disappear
Reply #2 - Oct 6th, 2021 at 12:53am
Print Post  
Tim@Visual Micro wrote on Sep 27th, 2021 at 1:07am:
If I recall serial.port is the only valid one, other can change based on driver.


So, what do I do?  I have tried using {serial.port.caption}, but it's not always available, and although {serial.port.number} would be ideal, it isan't always available either.  In fact, I now think there is no single build property that is always available that contains the serial port number in any form.   

If this is something over which you have some control, I would love to have a build property that exposes whatever string is selected in the COM port selection drop-down box.

Is this a possibility?

TIA,

Frank
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: Project Build Properties Appear and Disappear
Reply #3 - Oct 6th, 2021 at 8:48am
Print Post  
The "serial.port" property should always be present, and can vary in its content depending on what is selected in the Serial port list box.

e.g. 
Code
Select All
serial.port=usb:0/140000/0/3/1
serial.port=COM18 



If this is not visible in the output please attach the full build log with the Show build properties and verbose options enabled.

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


Posts: 240
Joined: Oct 19th, 2011
Re: Project Build Properties Appear and Disappear
Reply #4 - Oct 6th, 2021 at 2:30pm
Print Post  
Tim,

Interesting - the 'serial.port' parameter does seem to be available, but I missed it because it isn't grouped with the other 'serial.xxx' parameters.  I've attached a txt file containing a typical 'output build properties' run:


Frank
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint