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) Re: Unable to start debugging. Olimex AMT-USB-TINY + Esp32 (Read 10275 times)
trevorH
Newbies
*
Offline


Posts: 7
Joined: Oct 11th, 2017
Re: Unable to start debugging. Olimex AMT-USB-TINY + Esp32
Reply #20 - Jan 16th, 2023 at 12:33am
Print Post  
I am having a similar issue where I cannot use the olimex ARM-USB-TINY-H to debug using the default settings in visual micro.  In order to debug I had to utilize the attached custom debug files.  Still having an issue where I need to reset the debugger and the MCU in order to start a new session, but this appears to be a temporary solution at least.  

Based on my testing in the cmd line it looks like the current revision of openocd included in visual micro for the ESP32 is not accepting the olimex-arm-usb-ocd-h.cfg file and one of the function/module is throwing an error relating to not finding the file in the "share folder".  I also had to remove the reset halt command in order for the debugger to work.  I plan to try utilizing a newer revision of openocd and see if that works without this hack.  I am running windows 11 so I'm not sure if this could be the culprit as well (powershell???).

If the visual micro team has some time to look into this, I would appreciate it.  If I can find a better solution, I'll post it.
  

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


Posts: 2370
Joined: Feb 13th, 2019
Re: Unable to start debugging. Olimex AMT-USB-TINY + Esp32
Reply #21 - Jan 19th, 2023 at 3:40pm
Print Post  
Thanks for this report and the brilliant level of detail!!

Configuration File Issue
We have the wrong *.cfg configured for this setup currently ("ftdi/olimex-jtag-tiny-h.cfg" instead of "ftdi/olimex-arm-usb-tiny-h.cfg"), and we will amend this as there is already an existing *.cfg with the correct settings as described in your launch_JSON (thanks for this!).

To work around this currently you can:
1) Select the vMicro > Debugger > Hardware Debugger: Olimex ARM-USB-TINY-H
2) Use vMicro > Add Code > Add Local Board.txt, and add the lines in the attached file in, then save the file.
3) Try attaching the debugger again and this should now work as expected.

We will update this thread when the fix is released (which affects Board Packages ESP32, Mbed_Nano, Mbed_RP2040).

Reset Before Re-Attach Debugger
This should be improved in the very latest version of Visual Micro, which has a minor change as to how it kills the debugging session when pressing the Stop Debugging button (now it leaves the board code running, instead of totally killing the application which often causes the need to reset the board again before re-attaching).
« Last Edit: Jan 19th, 2023 at 3:43pm by Simon@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
trevorH
Newbies
*
Offline


Posts: 7
Joined: Oct 11th, 2017
Re: Unable to start debugging. Olimex AMT-USB-TINY + Esp32
Reply #22 - Jan 22nd, 2023 at 2:54am
Print Post  
Thanks Simon.  The files you included only work for me when I use the Debug->Attach to Process.  This is still quite helpful, and I will utilize it for my current debugging needs.
  
Back to top
 
IP Logged
 
trevorH
Newbies
*
Offline


Posts: 7
Joined: Oct 11th, 2017
Re: Unable to start debugging. Olimex AMT-USB-TINY + Esp32
Reply #23 - Feb 12th, 2023 at 8:01am
Print Post  
Simon, 

After updating to version 2022.1128.2225 of visual micro I believe that the olimex debugger is no longer working.  Is there a way to roll back visual micro so I can check if this is the case?  I tried debugging on another project and was unable to do so.  When I went back to the original (simpler project) and attempted to debug using the files you provided this also failed.

I am getting the error, "unable to start debugging. Unexpected GDB outptut from command "-target-select remote localhost:3333". localhost:3333:(undocumented errno 138).
  
Back to top
 
IP Logged
 
trevorH
Newbies
*
Offline


Posts: 7
Joined: Oct 11th, 2017
Re: Unable to start debugging. Olimex AMT-USB-TINY + Esp32
Reply #24 - Feb 12th, 2023 at 6:30pm
Print Post  
This is not an issue with 2022.1128.2225.  I downgraded to 2022.1128.2224 and was still having issues with debugging.  I then tried restarting my computer and was able to debug.  I'm not sure exactly what was wrong.  I then updated to the latest version of vmicro (2022.1128.2225) and was able to debug in that version as well.  Is it possible that the GDB server can hang somehow in a bad configuration that persists over multiple (dozens) of reset cycles of the olimex debugger and target MCU?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2370
Joined: Feb 13th, 2019
Re: Unable to start debugging. Olimex AMT-USB-TINY + Esp32
Reply #25 - Feb 13th, 2023 at 9:29am
Print Post  
Thanks for the update.

If the debugging session ends unexpectedly or it fails to attach, sometimes there can be orphaned processes left running for xtensa-esp32-elf-gdb.exe which can prevent the debugger from attaching.  If you kill these via task manager this should resolve the problem if it is that.

There was also a minor change in the latest (*.25) version of Visual Micro which should now leave the code on the ESP32 running after stopping the debugging session. Previous to this it killed the code on the target which could leave it in an unusable state, but from your description I don't believe this is the issue, but worth noting.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint