VSCODE ESP-IDF Plugin Debug Problem

su-Koch
Posts: 11
Joined: Sat Jan 25, 2020 1:43 pm

VSCODE ESP-IDF Plugin Debug Problem

Postby su-Koch » Mon Sep 14, 2020 8:06 pm

hei Guys,
I'm facing some issues with the Debugger of the VisualStudioCode ESP-IDF Estension.

I installed my Debugger Shield and the according Driver. OpenOCD Server can be started using the user interface.

Hitting F5 (to launch the default esp-idf debugger configuration)

I receive the following error code:

Code: Select all

Traceback (most recent call last):
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\command_processor.py", line 50, in __call__
    on_request(protocol_message)
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\command_processor.py", line 87, in on_initialize_request
    self.da.adapter_init()
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\debug_adapter.py", line 290, in adapter_init
    self.start_gdb()
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\debug_adapter.py", line 511, in start_gdb
    raise e
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\debug_adapter.py", line 506, in start_gdb
    remote_target=(not self.state.openocd_skip_connection)
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\debug_backend\debug_backend\hw_spec_tools.py", line 97, in get_gdb
    remote_port=remote_port, **kwargs)
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\debug_backend\debug_backend\hw_specific\Esp32.py", line 35, in __init__
    top_defaults=self.config, **kwargs)
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\debug_backend\debug_backend\hw_specific\Esp.py", line 36, in __init__
    top_defaults=self.config, **kwargs)
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\debug_backend\debug_backend\hw_specific\Xtensa.py", line 80, in __init__
    top_defaults=self.config, **kwargs)
  File "c:\Users\dev\.vscode\extensions\espressif.esp-idf-extension-0.4.0\esp_debug_adapter\debug_adapter\debug_backend\debug_backend\gdb.py", line 54, in __init__
    self._gdbmi = GdbController(gdb_path=gdb_path)
TypeError: __init__() got an unexpected keyword argument 'gdb_path'
Can you tell me whats the error?

Using the C/C++ Extension OpenOCD Debugger I do not receive errors but it seems like the debugging session is not connected and also no breakpoints are not hit.

ESP IDF Extension v4.0 was installed via the VisualStudioCode Extension Setuo Guide in the Userinterface of VSCode. Alos the espressif tools where installed this way.

Hope someone can help me.
Manuel

User avatar
ESP_Soumesh
Posts: 19
Joined: Tue Jul 09, 2019 2:21 pm

Re: VSCODE ESP-IDF Plugin Debug Problem

Postby ESP_Soumesh » Tue Sep 15, 2020 1:33 am

For debugging using our ESP-IDF debug adapter please follow this guide

https://github.com/espressif/vscode-esp ... ug-adapter

User avatar
AndreiGramakov
Posts: 5
Joined: Fri Apr 03, 2020 8:03 am
Location: Brno, CZ
Contact:

Re: VSCODE ESP-IDF Plugin Debug Problem

Postby AndreiGramakov » Tue Sep 15, 2020 10:37 am

Hi!

It seems, it is because of breaking changes in pygdbmi package that used by our debugging system. You can check it running from PowerShell at you IDF folder (it is C:\Users\YOUR_USER_NAME\esp-idf if you installed it with the extension's defaults):

Code: Select all

. ./export.ps1
pip list -l
I expect to see there pygdbmi 0.10.x.x

If so, we will prepare fix for this, now you can fix it manually for your machine. Open your IDF folder in PowerShell and then:

Code: Select all

. ./export.ps1
pip install 'pygdbmi==0.9.0.2'
Please drop here several words if it helped
Embedded Sofware Engineer @ Espressif Systems

su-Koch
Posts: 11
Joined: Sat Jan 25, 2020 1:43 pm

Re: VSCODE ESP-IDF Plugin Debug Problem

Postby su-Koch » Tue Sep 15, 2020 1:55 pm

This is so awesome. Switching to 0.9.0.2. helped.
As a note: I wasn't able to solve that via powershell but solved it in the command line running the python commands

Thank you very much.
Manuel

su-Koch
Posts: 11
Joined: Sat Jan 25, 2020 1:43 pm

Re: VSCODE ESP-IDF Plugin Debug Problem

Postby su-Koch » Tue Sep 15, 2020 2:25 pm

Debugging works now but the behaviour is strange.

The Debugger Stopps execution on lines where no breakpoints are and doesn't stop on breakpoints.
What the debugger does and what i was expecting is to stop on the beginning of main.

Any Suggestions to solve this issu?

Manuel

User avatar
AndreiGramakov
Posts: 5
Joined: Fri Apr 03, 2020 8:03 am
Location: Brno, CZ
Contact:

Re: VSCODE ESP-IDF Plugin Debug Problem

Postby AndreiGramakov » Wed Sep 23, 2020 1:15 pm

su-Koch, could it be that you forgot to flash the rom after the modification? If it is not the case, please provide some extra info: in which situation it is happening and with which setup (idf version, esp32 board, used debugger, etc.). I will try to reproduce it.

Thank you
Embedded Sofware Engineer @ Espressif Systems

Who is online

Users browsing this forum: No registered users and 22 guests