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 [2]  Send TopicPrint
Very Hot Topic (More than 25 Replies) Comm ports disappear from Visual Studio when using GDBStub (Read 9037 times)
Tom Thibault
Junior Member
**
Offline


Posts: 18
Joined: Jan 8th, 2020
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #20 - Sep 27th, 2023 at 10:59pm
Print Post  

Ports disconnected to me meant not in the IDE menu and Win 10 Device Manager says "Currently, this hardware device is not connected to the computer. (Code 45)" for that device.

After the attached runs, the port is disconnected.  Can't tell if upload worked. 
  
Back to top
 
IP Logged
 
Tom Thibault
Junior Member
**
Offline


Posts: 18
Joined: Jan 8th, 2020
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #21 - Sep 27th, 2023 at 11:01pm
Print Post  
Couldn't attach file in last post
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #22 - Sep 27th, 2023 at 11:08pm
Print Post  
Email the file thanks.

Pressing the reset button on the boatd with the teensy load program open will show a progress bar and then a status of Reboot OK

The loader program might be minimized in the windows bar. It loads every time you build. That's how Teensy (pjrc) designed things.
« Last Edit: Sep 27th, 2023 at 11:12pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tom Thibault
Junior Member
**
Offline


Posts: 18
Joined: Jan 8th, 2020
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #23 - Sep 28th, 2023 at 2:44am
Print Post  
The forum wouldn't let me upload before.  I'll try again now.

Yes, I watch the loader, but you can never see the outcome since the port stays disconnected.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tom Thibault
Junior Member
**
Offline


Posts: 18
Joined: Jan 8th, 2020
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #24 - Sep 28th, 2023 at 3:39am
Print Post  
I did one further experiment.  A simple program that blinks the LED.

Installed by the normal Arduino process, the LED blinks once a second. No serial port is needed.  So unplug from the desktop computer and plug the Teensy into a wall wart USB charger, the LED blinks as expected.

Plug Teensy back into the desktop.  Go over to the VM and program the same code (the programming port is selected properly).  Press start and it compiles and seems to load.  Looks like it finishes (according to the output window but the port disconnects and the LED does not blink.  Unplug Teensy from the desktop computer and plug into the same wall wart USB charger, the LED does not blink.

I don't think it programmed Teensy or it can't startup.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #25 - Sep 28th, 2023 at 11:14am
Print Post  
Thanks for the update.

From your log you have the Teensy Board Option > "Optimize: Smallest Code" set, which testing here does prevent the LED from blinking as expected.  This is the same in the Arduino IDE and Visual Micro.

Can you confirm you have this option set differently in the Arduino IDE?



  
Back to top
IP Logged
 
Tom Thibault
Junior Member
**
Offline


Posts: 18
Joined: Jan 8th, 2020
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #26 - Sep 28th, 2023 at 12:10pm
Print Post  
You are correct.

I had the Arduino set at fast.  When it was set at smallest, if behaved the same as VM.  Then ran all the optimize settings on the Arduino IDE.  Only smallest did not work.

Then repeated on VM.  Behaved the same.  Now VM can recover if optimization is not set to smallest.

Presumably, this means that smallest and no optimization are not to be used?

Is this a bug, that can be fixed?

Why is there an optimize debug choice on a release build?

The following is from the log, during today's test, does the "smallest" option show the problem?

menu.opt.o2std=Faster
menu.opt.o2std.build.flags.optimize=-O2
menu.opt.o2std.build.flags.ldspecs=
menu.opt.o1std=Fast
menu.opt.o1std.build.flags.optimize=-O1
menu.opt.o1std.build.flags.ldspecs=
menu.opt.o3std=Fastest
menu.opt.o3std.build.flags.optimize=-O3
menu.opt.o3std.build.flags.ldspecs=
menu.opt.ogstd=Debug
menu.opt.ogstd.build.flags.optimize=-Og
menu.opt.ogstd.build.flags.ldspecs=
menu.opt.osstd=Smallest Code
menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #27 - Sep 28th, 2023 at 1:32pm
Print Post  
It is best to avoid changing Optimization settings generally without a specific need to do so, as there can be undesired side effects as seen here.

The smallest optimization offered by Teensy is there for when the code exceeds the flash memory size.

No Optimization should only be used when you need to debug the core files for a board, however it does not always produce functional code.  In this case the TeensyDebug Library seems to crash if it has all Optimization disabled.  The Default Optimization should be used with Debugging unless there is some reason not to, and when using the GDBStub debugger this is the same as the Teensy board Option Debug (flag -Og), which includes the additional debugging information required.

The smallest option in the board options logging simply shows the flag passed to GCC which means "smallest", but it is up to the specific compiler version to manage this, which is provided as part of the board package from PJRC in this case.

The Teensy Board Package has no knowledge of Release or Debug builds, as Build Configurations are a feature of VS/VSCode, but not the Arduino IDE.  There is nothing to prevent using all debug options and debugging selections in Release Configuration, but it is often best to use these in Debug, and leave them off in Release so you can quickly switch from debugging your code to a Release build once the issue is solved under normal practice.

The issue regarding the Smallest Code not working with Blink is best reported directly to PJRC as the board package owners, via their forum:
https://forum.pjrc.com/
  
Back to top
IP Logged
 
Tom Thibault
Junior Member
**
Offline


Posts: 18
Joined: Jan 8th, 2020
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #28 - Sep 28th, 2023 at 5:32pm
Print Post  
Thx for all the help on this.

Now, do I have the courage to attempt GDBStub debugging again!!! Hmmm.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Comm ports disappear from Visual Studio when using GDBStub
Reply #29 - Sep 28th, 2023 at 7:02pm
Print Post  
Thanks, it was a simple issue in the end. We have logged it with PJRC on this post.

As long as you leave the Teensy optimization at default, you won't have any issues using debug with the visual micro optimization disabled for project and libraries. It currently appears only to be an issue with the Teensy core.
« Last Edit: Sep 29th, 2023 at 2:43pm by Simon@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint