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) Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a) (Read 11761 times)
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Apr 3rd, 2021 at 6:37am
Print Post  
Hi! I'm try to start with a new board (Teensy4.1) I have problem to lunch the debugger. I'm looking for around the forum but I can find nothy about this error. Can you help me?

This is the error output
Type "apropos word" to search for commands related to "word". =cmd-param-changed,param="pagination",value="off"
The program '' has exited with code 42 (0x2a). Smiley Grin Grin
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2177
Joined: Feb 13th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #1 - Apr 3rd, 2021 at 8:50am
Print Post  
Thanks for the report, and this error often means the connection could not be established with the board, but as there is no manual wiring there must be another issue.

Please enable the below options:
  • vMicro > Compiler > Show Build Properties
  • vMicro > Compiler > Verbose
  • vMicro > Uploader > Verbose


Then Run: Build > Clean

Then run: Debug > Start, and attach the full output from the Output Window > Micro Build.

We should be able to assist further from there.
  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #2 - Apr 3rd, 2021 at 9:20am
Print Post  
Hi, here the microbuild output file .txt
  

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


Posts: 2177
Joined: Feb 13th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #3 - Apr 6th, 2021 at 9:20am
Print Post  
Thanks for the detail.

Can you confirm that after upload there are two COM ports shown for the Teensy Board in Visual Micro (assume COM8, and COM9)?
There should be the additional line of code in Setup() e.g. debug.begin(SerialUSB1);

On the vMicro > Debug > Debugger Menu there should be an additional option to "Override COM Port", which in the above scenario would be set to e.g. COM9 with the upload port left as COM8.  Once this is set as well it should allow attach to process to work as expected.
  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #4 - Apr 6th, 2021 at 9:46am
Print Post  
Hi Simon
I can confirmo the following configuration:

setup ()
SerialUSB1.begin(115200);
debug.begin(SerialUSB1);


yes, theĀ  COM ports shown for the Teensy Board in Visual Micro (assume COM9, and COM10)

this last update micro build report (no verbose)

=thread-group-added,id="i1"
GNU gdb (GNU Tools for ARM Embedded Processors) 7.10.1.20160923-cvs
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
The program '' has exited with code 42 (0x2a).

« Last Edit: Apr 6th, 2021 at 9:49am by Marco (Italy) »  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #5 - Apr 6th, 2021 at 10:07am
Print Post  
and for last in debug menu the option is set to over ride COM10. I have tryd with COM11 but noting the debug do not start again.

Shocked

Any idea?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2177
Joined: Feb 13th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #6 - Apr 6th, 2021 at 10:20am
Print Post  
Thanks for the detail.

From the code I believe your code, and the debugger are trying to use SerialUSB1.

Try changing it to:
Code
Select All
setup () {
Serial.begin(115200);       // First Serial Port in Dual Serial Mode for our code [COM8]
debug.begin(SerialUSB1); // Second Serial Port in Dual Serial Mode for Debugging Transport [COM9]
}
 

  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #7 - Apr 6th, 2021 at 10:37am
Print Post  
I have tryed with code provide but nothing doesn't go again.

Now I can upload the code without error, but when I try to lunch the debugger I have an Sad error, reported below...
The program '' has exited with code 42 (0x2a).

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


Posts: 2177
Joined: Feb 13th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #8 - Apr 6th, 2021 at 1:29pm
Print Post  
Thanks, can you please attach the full Output again so we can investigate further?
  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #9 - Apr 6th, 2021 at 1:35pm
Print Post  
Hi, in attach the micro build file output.
Wink
  

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


Posts: 2177
Joined: Feb 13th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #10 - Apr 6th, 2021 at 2:03pm
Print Post  
Thanks for the detail.

If you Upload the Sketch, both Serial Port Selections should allow the COMxx port to be selected (instead of the Teensy designated \\usb:0/140000/0/4/3\)

At present it looks like the option on the vMicro > Debugger > Override Debug Port is set to \\\\.\\usb:0/140000/0/4/3\, instead of the native COMxx port.

If you reselect the port after uploading, and try again this should work as expected (attach new log if issues occur).
  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #11 - Apr 6th, 2021 at 2:22pm
Print Post  
Hi,
in attach last report
I managed to get debugging working by adding  COM11, but when it's start the debug stay in indefinite state, is not possible to set a breakpoint, or watch a variable, nothing is possible to setup. The only command accepted is the stop debug command.

Shocked
  

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


Posts: 2177
Joined: Feb 13th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #12 - Apr 6th, 2021 at 2:47pm
Print Post  
If you set the vMicro > Debug > Optimization to "No Project + Libraries", and set a breakpoint at the top of loop in your sketch, then Debug > Start, does it land on the breakpoint?
  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #13 - Apr 6th, 2021 at 3:12pm
Print Post  
Hi, doesn't work! Same problem. Again the Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
The program '' has exited with code 42 (0x2a).
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2177
Joined: Feb 13th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #14 - Apr 6th, 2021 at 3:41pm
Print Post  
Please attach the log...

The error simply means that GDB cannot connect to the software stub via the COM port on the board.

Does using Debug > Attach after uploading the code improve the situation?
  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #15 - Apr 6th, 2021 at 4:14pm
Print Post  
Hi!
I can see this.
1. if I try to compile and then upload all works very well without problem, the board start and run.

2. after this if I try to START with debug the debug doesn't start and send an error.

I  also tried pressing the reset button on the board, but nothing, same error.
Shocked
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2177
Joined: Feb 13th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #16 - Apr 6th, 2021 at 4:19pm
Print Post  
Marco (Italy) wrote on Apr 6th, 2021 at 4:14pm:

2. after this if I try to START with debug the debug doesn't start and send an error.


If you use the Debug > Attach to Process, this will just attach the debugger, without doing the build/upload again.

It may be the Debug > Start Debugging, is trying to start the debugging process too quickly.
  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #17 - Apr 6th, 2021 at 4:26pm
Print Post  
if i try to start debugging using <attach to process> from the debug menu, visual studio displays a window saying <initializing debug> and after about 30 sec. the usual error appears. 
is It looks like it can't find the debugger?

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


Posts: 2177
Joined: Feb 13th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #18 - Apr 6th, 2021 at 4:37pm
Print Post  
Can you ZIP and send the entire solution to us via email, and an up to date copy of the full build output?
  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Teensy4.1 GDB error -> The program '' has exited with code 42 (0x2a)
Reply #19 - Apr 6th, 2021 at 4:42pm
Print Post  
Hi
in attach the entire solution in zip format

Grin
  

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