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) ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run". (Read 11947 times)
discman
Junior Member
**
Offline


Posts: 27
Joined: Apr 13th, 2023
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #20 - Aug 15th, 2023 at 6:14am
Print Post  
Thanks very much for the extension.  Using the suggested board.txt I was able to test the S3 operation and gotten further than before.  With a stripped-down LED blinker test sketch, I was able to upload (flash), break at breakpoint, and examine variables!

But when I clicked either the “Break All” or the “Stop Debugging” button while the sketch is running, Visual Studio immediately became completely non-responsive to any key or mouse input.  No further output appeared in the Output window.  Could not close Visual Studio.  The only way out was via “End task” from Windows’ Task Manager.

Attached is the Output windows prior to me clicking “Break All”.  Then everything froze, no further output.
Please see if you can pick up any clue to overcome the hang.  Thanks again.
  

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


Posts: 27
Joined: Apr 13th, 2023
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #21 - Aug 15th, 2023 at 6:30pm
Print Post  
And when I attempted to run my regular-size ESP32-S3 app, it could not get far.  It appears that as the sketch started execution, it always broke (exception) at main_app(), as shown in the attached logs.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #22 - Aug 15th, 2023 at 6:48pm
Print Post  
We need the info requested in yellow above. 

This type of error can be related to optimisation settings. Each microconroller tends to have slightly different requirements. The requested output will allow us to see your config.
  
Back to top
IP Logged
 
discman
Junior Member
**
Offline


Posts: 27
Joined: Apr 13th, 2023
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #23 - Aug 15th, 2023 at 7:08pm
Print Post  
Tim,
You’re correct.  I have not followed the requirement of building with “No Optimization”.  It’s because the build would failed unless I build with “No Project Optimization”.  It appears to be related to my app is including/using the LittleFS library?  The error message is attached.  So I must get passed this linker error first.
  ld.exe: FS\\vfs_api.cpp.o:(.literal._ZN2fs8FileImplD5Ev[_ZN2fs8FileImplD5Ev]+0x0): undefined reference to vtable for fs::FileImpl
If you have any idea on how to resolve the linker error, please let me know. 
Thank you much.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #24 - Aug 15th, 2023 at 7:30pm
Print Post  
Thanks for the info. 

This relates to how to use you microcontroller and is not related specifically to Visual Micro. One suggestion might be avoid debug of code that fails, set breakpoints in areas that can be debugged. 

Alternatively there are #pragma statements that the esp32 code supports. They to control optimization for specific chunks of code. Something like the following. You can either disable or enable opimization. This code diables but you might think about editing the littleFS lib and forcing optimization to that used by a Release build.


#pragma GCC push_options
#pragma GCC optimize ("O0")

int non_optimized_function() {
    // This function is compiled without optimizations.
    int x = 5;
    for (int i = 0; i < 10; ++i) {
        x += i;
    }
    return x;
}

#pragma GCC pop_options


-- NOTE --

pragma can also be used in conjuntion with the #defines visual micro provides when compiling for debug. That will allow #pragma settings to be ignored when building in release mode.
« Last Edit: Aug 15th, 2023 at 7:32pm by Tim@Visual Micro »  
Back to top
IP Logged
 
discman
Junior Member
**
Offline


Posts: 27
Joined: Apr 13th, 2023
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #25 - Aug 16th, 2023 at 6:11am
Print Post  
After seeing another thread mentioning the same linker error, I tried backing the esp32 Board Mgr from 2.0.9 to 2.0.5.  The code is able to build under “No optimization”.  So now, we can return get back to the hang problem a day earlier before getting diverted.  To recap:

Thanks very much for the extension.  Using the suggested board.txt I was able to test the S3 operation and gotten further than before.  With a stripped-down LED blinker test sketch, I was able to upload (flash), break at breakpoint, and examine variables!

But when I clicked either the “Break All” or the “Stop Debugging” button while the sketch is running, Visual Studio immediately became completely non-responsive to any key or mouse input.  No further output appeared in the Output window.  Could not close Visual Studio.  The only way out was via “End task” from Windows’ Task Manager.

Attached is the Output windows prior to me clicking “Break All”.  Then everything froze, no further output.
Please see if you can pick up any clue to overcome the hang.  Thanks again.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #26 - Aug 16th, 2023 at 7:09am
Print Post  
Got some success in USB JTAG internal debug.
Test setup: VS2017/19 VM 2023_0507_1914.
Board: LILYGO T-Display-S3 
ESP32 pack 2.0.9. New board.txt.
Test programm:
Code
Select All
long t1;
void setup()
{
	pinMode(LCD_BL, OUTPUT);
	Serial.begin(115200);
}

void loop()
{
	t1 = millis();
	digitalWrite(LCD_BL, HIGH);
	Serial.println(digitalRead(LCD_BL));
	delay(100);
	digitalWrite(LCD_BL, LOW);
	Serial.println(digitalRead(LCD_BL));
	delay(100);
	Serial.println(millis() - t1);
}
 



1. First strange thing. Regardless Release/Debug mode after downloading/reset, code works as expected about 4s. I.e. LED blinks at 5 Hz 4S, then changed to 2Hz. If serial terminal connected it blinks 5Hz endlessly while connected. 
2. Attach to process works only if any breakpoints are set. Working controls: "Continue", "StepIn/Out/Over", "Stop". (see AttachLog.txt)
3. Attaching to process without breakpoints starts, but no breakpoints are available.("The breakpoint will not currently be hit"). Any manipulation with debug controls("Pause/Stop") lead to irreversible hangup of VS.
See Attach_No_BP.txt.
« Last Edit: Aug 16th, 2023 at 7:12am by Kabron »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #27 - Aug 16th, 2023 at 7:10am
Print Post  
It's a little surprising:
# Ensure the Flash Size is set to 0 to prevent issues

Are there any other settings to test?
« Last Edit: Aug 16th, 2023 at 7:15am by Kabron »  

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


Posts: 27
Joined: Apr 13th, 2023
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #28 - Aug 17th, 2023 at 7:14pm
Print Post  
I share your pain, Kabron.  You’ve described my exact predicament.  After weeks of struggles, I can finally connect the debugger to the S3 and execute code.  But, as you’ve said… 1) Fail to set breakpoint after “Attaching”, 2) Pause and Stop controls cause complete hang in Visual Studio.  It’s like working with one hand tied behind my back. Sad

It seems to be some “communication issue” between the GDB, VS, vMicro?

Can vMicro investigate the above two problems please?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #29 - Aug 17th, 2023 at 7:42pm
Print Post  
Thanks for the info. We are looking into it. Unfortunately, Visual Micro doesn't play a part in it. We provide the json settings/script to VS and ask it to launch. We might have to raise it with Microsoft but will continue to experiment.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2710
Joined: Feb 13th, 2019
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #30 - Oct 19th, 2023 at 3:01pm
Print Post  
Can you install the latest version (23.1006.01) from the top of the board below, and then try debugging again?
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

This should resolve the issues where the break all / stop / add breakpoint when the target is running.
  
Back to top
IP Logged
 
discman
Junior Member
**
Offline


Posts: 27
Joined: Apr 13th, 2023
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #31 - Oct 30th, 2023 at 5:38am
Print Post  
Simon,
Thank you for following up.  I’d love to test the solution, however, my subscription has since expired.
If you could grant me a 5-day license to try it out, I’ll report the result.
     Joe
  
Back to top
 
IP Logged
 
discman
Junior Member
**
Offline


Posts: 27
Joined: Apr 13th, 2023
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #32 - Nov 1st, 2023 at 1:13am
Print Post  
Simon,

The start/stop/breakpoint are now working smoothly!  Thanks very much for fixing it (23.1006.02).

There’s one other thing that your team may want to investigate: In order to build the S3 code with No Optimization, I have to use ESP32 “Board Manager” ver 2.0.5.  Building with newer versions will result in link failure.  This was communicated earlier in this same thread.  I know vMicro may not be in control with this link error.  But as Espressif updates keep coming (now at 2.0.14), having to remain with 2.0.5 will eventually become a problem.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2710
Joined: Feb 13th, 2019
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #33 - Nov 1st, 2023 at 9:19am
Print Post  
Thanks for the update and confirming the fix is working as expected.

The Optimization issue should be avoidable by using the "No Project + Libraries" option which will still allow the ESP32 core code to be optimised.  This issue would be something the Arduino ESP32 core team need to investigate if they feel it is relevant.
  
Back to top
IP Logged
 
discman
Junior Member
**
Offline


Posts: 27
Joined: Apr 13th, 2023
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #34 - Nov 4th, 2023 at 12:30am
Print Post  
That’s not what I am experiencing.  Using ESP32 board version 2.0.14 (most current), under “No Project + Libraries Opt”, the build failed:

ld.exe: FS\\vfs_api.cpp.o:(.literal._ZN2fs8FileImplD5Ev[_ZN2fs8FileImplD5Ev]+0x0): undefined reference to vtable for fs::FileImpl

Error linking for board ESP32S3 Dev Module (esp32_esp32s3)

While it’s something that the Arduino ESP core team needs to resolve, it’d be good for vMicro to notify them of this.

Thanks.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #35 - Nov 4th, 2023 at 1:00am
Print Post  
It's possible a library you are using does not support no optimization. What happens if you set project only?
  
Back to top
IP Logged
 
discman
Junior Member
**
Offline


Posts: 27
Joined: Apr 13th, 2023
Re: ESP32-S3: Unable to start debugging. Unexpected GDB output from command "-exec-run".
Reply #36 - Nov 4th, 2023 at 1:36am
Print Post  
Tim,
Thanks for pointing that out.  I switched to “No Project opt” and it built okay.  The Breakpoint and Single-Stepping also appear to function fine.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint