Starting with 1.62 we began using the "recipe.advanced_size.pattern" feature of Arduino CLI, which has JSON format rather than simple plain text. This fixed a long-standing problem on Arduino IDE 2 where the size info always appeared in red color, even when it was not any sort of error.
My best guess is Visual Micro doesn't implement platform.txt "recipe.advanced_size.pattern"? Or maybe it does, but use of stdin vs stderr might be a problem? Or maybe it does run teensy_size and receives data, but can't handle the JSON format?
I personally can't investigate the Visual Micro side, as I don't really use Windows and I have no direct experience using Visual Micro. But I can give more detailed info about the Teensy software. Hopefully this might be helpful for anyone from Visual Micro who wants to investigate. Might be best to ask on their forum or contact Visual Micro directly and give them a link to this forum conversation.
The advanced size JSON format is part of the
Arduino Platform Specification. That page is lengthy, but a quick text search on that page for "advanced_size" will take you right to the info. This is the new line in Teensy's platform.txt file:
Code:
recipe.advanced_size.pattern="{teensytools.path}teensy_size" --json "{build.path}/{build.project_name}.elf"
You can see the teensy_size program has an optional "--json" command line parameter which causes it to give the JSON output format. If you run teensy_size without "--json", it will give output at simple plain text.
In fact, when using Arduino IDE 1.8.x, the Teensyduino installer writes a slightly different platform.txt file. It has this line:
Code:
recipe.hooks.postbuild.3.pattern="{teensytools.path}teensy_size" "{build.path}/{build.project_name}.elf"
If you look closely at Teensy's platform.txt, you'll see both are present but the command for the other software is commented out.
Another subtle detail is stdout vs stderr. The JSON output is sent to stdout. But plain text is sent to stderr, because Arduino IDE ignores stdout when File > Preferences is not set to verbose output during compile. Likewise, Arduino CLI replicated that behavior, which is the reason we've had to endure red text appearance in Arduino IDE 2.x.x. The Arduino developers added the advanced_size recipe specifically for this situation. The JSON data is always expected on stdout.
Hopefully future Visual Micro will become able to implement "recipe.advanced_size.pattern" as Arduino CLI does.
But one possible quick fix would be to edit the platform.txt file on your PC. Just delete the "recipe.advanced_size.pattern" line and uncomment the "recipe.hooks.postbuild.3.pattern" line that's meant for Arduino IDE 1.8.x.