Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger not working in pair with OpenAPI (Swagger) Editor extension #2324

Closed
Gurkengewuerz opened this issue Jan 22, 2021 · 8 comments
Closed
Labels
debug PIO Unified Debugger known issue
Milestone

Comments

@Gurkengewuerz
Copy link

As already tried to solve in the forum with @maxgerhardt, here is the matching issue.

As Max has already described:

A custom Atmel SAMD21E17 chip is supposed to be debugged in VSCode. The platformio.ini and board JSON definition are below.

When using the latest core and PIO VSCode extension version, the error “Could not find specified task” appears for the “PIO > Debug” target and a GDB “EPIPE” error for “PIO Debug (skip pre-debug)”. See https://imgur.com/a/0PCzeUx.

The behavior on my computer is that OpenOCD is started (but an error is thrown due to me not having an adapter plugged in), without GDB errors or launch errors.

No antivirus is used, but instead of the powershell in VSCode, a custom MinGW shell / bash is used.

The error goes away when downgrading PIO extension to 2.1.0, that’s the interesting part.

I tested all PIO extension up to 2.1.0 and none of them worked, only 2.1.0. I also tested another PC with the newest core and newest tools/platforms with exact the same behavior (“Could not find specified task” appears for the “PIO > Debug” target and a GDB “EPIPE” error for “PIO Debug (skip pre-debug)”). No matter if Linux or Windows (dual boot). My MinGW shell was also switched to powershell.
Everything is tested using the SAM Framework.

My platformio.ini

[platformio]
default_envs = control

[common]
monitor_speed = 9600
extra_scripts = pio/name-firmware.py
build_flags = -D MON_SPEED=${common.monitor_speed}

[env:control]
platform = atmelsam
board_build.variants_dir = customBoards
board = control_board
framework = arduino
monitor_speed = ${common.monitor_speed}
build_flags = ${common.build_flags}
extra_scripts = ${common.extra_scripts}
src_filter = +<*> -<counter.cpp> -<function_gen.cpp>
upload_protocol = atmel-ice
debug_tool = atmel-ice

My control_board.json

{
    "build": {
      "arduino": {
          "ldscript": "flash_without_bootloader.ld"
      },
      "core": "arduino",
      "cpu": "cortex-m0plus",
      "extra_flags": [
        "-DARDUINO_QWIIC_MICRO",
        "-DCRYSTALLESS",
        "-D__SAMD21E17A__",
        "-DARM_MATH_CM0PLUS"
      ],
      "f_cpu": "48000000L",
      "hwids": [
        [
          "0x1B4F",
          "0x0019"
        ],
        [
          "0x1B4F",
          "0xF019"
        ]
      ],
      "mcu": "samd21e17a",
      "usb_product": "Custom ATSAMD21E17A Board",
      "variant": "control_board"
    },
    "debug": {
      "jlink_device": "ATSAMD21E17",
      "openocd_chipname": "at91samd21e17",
      "openocd_target": "at91samdXX",
      "svd_path": "ATSAMD21E174.svd"
    },
    "frameworks": [
      "arduino"
    ],
    "name": "Custom ATSAMD21E17A Board",
    "upload": {
      "disable_flushing": true,
      "maximum_ram_size": 16384,
      "maximum_size": 131072,
      "native_usb": true,
      "offset_address": "0x0000",
      "protocol": "atmel-ice",
      "protocols": [
        "sam-ba",
        "blackmagic",
        "jlink",
        "atmel-ice"
      ],
      "require_upload_port": true,
      "use_1200bps_touch": true,
      "wait_for_upload_port": true
    },
    "url": "https://mc8051.de/",
    "vendor": "mc8051"
  }

If you need more information or the whole custom board, please let me know. I'm pleased to help.

@Gurkengewuerz Gurkengewuerz changed the title Debugger no working since v2.1.1 Debugger not working since v2.1.1 Jan 22, 2021
@ivankravets ivankravets added this to the 2.2.2 milestone Jan 23, 2021
@ivankravets
Copy link
Member

Could you comment these lines?

[platformio]
default_envs = control

Does it work now?

@ivankravets ivankravets added the debug PIO Unified Debugger label Jan 23, 2021
@Gurkengewuerz
Copy link
Author

@ivankravets i'm not at home today. Will let you know later!

@Gurkengewuerz
Copy link
Author

@ivankravets i've commented the two lines out, deleted my .vscode folder, restarted VSCode, Rebuild IntelliSense Index and started PIO Debug. PIO Debug gave me no error in first place. After running it and building the debug version it stopped with GDB: Error: write “EPIPE” again. PIO Debug (skip pre-debug) give me instant GDB: Error: write “EPIPE”.
I've recorded it here.

@julianobst
Copy link

Hi,
I was struggling with exactly the same problem.
While watching the video of @Gurkengewuerz, I mentioned that we both have installed the "OpenAPI (Swagger) Editor" plugin.
After disabling the OpenAPI plugin and reloading VS Code, debugging works like a charm.
@Gurkengewuerz could you give it a try and may confirm that the problem is related to the OpenAPI plugin?

@Gurkengewuerz
Copy link
Author

oh wow. i disabled the "OpenAPI (Swagger) Editor" extension and reloaded everything and now everything works like a charm! So i can confirm the behaviour from @julianobst.

@maxgerhardt
Copy link

o_o. Magic how that extension can interfere with stuff. I'll definitely add this to my internal notes and maybe @ivankravets can add this to the FAQ.

@ivankravets ivankravets changed the title Debugger not working since v2.1.1 Debugger not working in pair with OpenAPI (Swagger) Editor extension Feb 28, 2021
@ivankravets
Copy link
Member

It looks like a bug of that extension. It overwrites system environment variables. I added it to the conflicted list.

@alsaibie
Copy link

I can confirm that another VSCode extension was causing this issue with the Debugger. So, definitely worth disabling other extensions in the Workspace to troubleshoot this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug PIO Unified Debugger known issue
Projects
None yet
Development

No branches or pull requests

5 participants