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
Hot Topic (More than 8 Replies) Debugger works on one board but not the other (Read 2267 times)
Peteman
Newbies
*
Offline


Posts: 5
Joined: Aug 9th, 2021
Debugger works on one board but not the other
Aug 10th, 2021 at 12:09pm
Print Post  
Hi, after recent help from support, i managed to fix one problem (had to disable tutorial mode, to make debug work). 

Now this has brought up another problem, originally i was trying to debug an Arduino pro mini (clone) this board still fails with the error message shown below, when i try to debug it but when it change to my Arduino Mega all works fine?

I'm using exactly the same settings & code but one board fails and the other doesn't. 

Forgot to mention I'm changing the board type setting in between testes:-)

Unable to start debugging. Unexpected GDB output from command "-exe run". Don't know how to run. "Try Help Target"
« Last Edit: Aug 10th, 2021 at 12:15pm by Peteman »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Debugger works on one board but not the other
Reply #1 - Aug 10th, 2021 at 12:47pm
Print Post  
Thanks for the report.

When switching between the boards, are you also changing the COM Port the debugger is trying to connect using?

So we can see everything that is happening, can you enable the below options:
vMicro > Compiler > Verbose
vMicro > Compiler > Show Build Properties
vMicro > Uploader > Verbose

Then repeat the below for each board, saving the output from the Output > Micro Build window to a text file for each board, and attach these to the post.
Build and Upload
Debug > Attach to Process

  
Back to top
 
IP Logged
 
Peteman
Newbies
*
Offline


Posts: 5
Joined: Aug 9th, 2021
Re: Debugger works on one board but not the other
Reply #2 - Aug 11th, 2021 at 9:13pm
Print Post  
Hi,

Please see attached file dump from working and non working boards as requested.

Yes I'm changing the com port and board type when switching them over.

Regards
« Last Edit: Aug 11th, 2021 at 9:33pm by Peteman »  

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Debugger works on one board but not the other
Reply #3 - Aug 12th, 2021 at 9:36am
Print Post  
Thanks for the detail and logs.

1) If you use vMicro > Add Code > Add Local Board.txt, and add the below contents, then save, and try re-attaching the debugger does it improve on the Pro-Mini?
Code
Select All
tools.gdbstub.debug.args="{build.path}/{build.project_name}.elf" -ex "target remote \\.\{serial.debug.port}" 



2) If that doesn't help, try running the below command in the command line, and attach the output (this is what is happening behind the scenes:
Code
Select All
"c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\gtx0jdrb.pl2\Micro Platforms/visualmicro/tools/avr-gdb/7.3.0-atmel3.6.1-arduino5\avr-gdb.exe" Release/add_test.ino.elf" -ex "target remote \\.\COM5" 



3) Also ensure there are no instances of avr-gdb.exe running in Task Manager once all debugging has ended.
  
Back to top
 
IP Logged
 
Peteman
Newbies
*
Offline


Posts: 5
Joined: Aug 9th, 2021
Re: Debugger works on one board but not the other
Reply #4 - Aug 12th, 2021 at 2:21pm
Print Post  
Thanks for the info, unfortunately adding the line of code into the board.txt file didn't work. I have attached a file showing the output from the command line as requested.

Regards.
  

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Debugger works on one board but not the other
Reply #5 - Aug 12th, 2021 at 3:27pm
Print Post  
Thanks for the output.

At present this seems to be related to the GDBStub Library from what I can understand, however it may be we need to force the baud rate in GDB as well.

Can you try running the below command and post the output to see if it improves?
Code
Select All
"c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\gtx0jdrb.pl2\Micro Platforms/visualmicro/tools/avr-gdb/7.3.0-atmel3.6.1-arduino5\avr-gdb.exe" Release/add_test.ino.elf" -ex "show serial baud" -ex "set serial baud 115200" -ex "show serial baud" -ex "target remote \\.\COM5" 


  
Back to top
 
IP Logged
 
Peteman
Newbies
*
Offline


Posts: 5
Joined: Aug 9th, 2021
Re: Debugger works on one board but not the other
Reply #6 - Aug 12th, 2021 at 3:36pm
Print Post  
Hi, just tried that and it came up with a different result. See attached.

Regards
  

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Debugger works on one board but not the other
Reply #7 - Aug 12th, 2021 at 4:00pm
Print Post  
Brilliant, thanks for trying this, and it shows it has worked.

If you change the entry in your local board.txt to the below line, this should now work in Visual Micro, after exiting the command line program:
Code
Select All
tools.gdbstub.debug.args="{build.path}/{build.project_name}.elf" -ex "set serial baud 115200" -ex "target remote \\.\{serial.debug.port}"  



I hadn't realised the baud rate is determined by the GDBStub based on the CPU Speed, so we will update the instructions to show how to configure this in the software.
  
Back to top
 
IP Logged
 
Peteman
Newbies
*
Offline


Posts: 5
Joined: Aug 9th, 2021
Re: Debugger works on one board but not the other
Reply #8 - Aug 12th, 2021 at 5:26pm
Print Post  
Hi,

Great, Yes works fine now. 

Thanks for all your help.

PS - You mentioned updating your docs, as a heads up how can i make this change without having to create the local board.txt file for each new project?
« Last Edit: Aug 12th, 2021 at 6:25pm by Peteman »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Debugger works on one board but not the other
Reply #9 - Aug 13th, 2021 at 10:06am
Print Post  
Thanks for confirming. The change will be built in to the next release of Visual Micro over the coming days so the local board.txt won't be needed after the update.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint