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

Can't debug without preinstalled tool-openocd package #213

Closed
maxgerhardt opened this issue Aug 21, 2023 · 0 comments
Closed

Can't debug without preinstalled tool-openocd package #213

maxgerhardt opened this issue Aug 21, 2023 · 0 comments

Comments

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Aug 21, 2023

Apparently when a user has not yet triggered PlatformIO to download the tool-openocd package but attempts to start a debug session anyways, PlatformIO crashes.

Community topic.

[env:mkrzero]
platform = atmelsam
board = mkrzero
framework = arduino
build_type = debug
debug_tool = atmel-ice
PS C:\Users\wolf\Documents\PlatformIO\Projects\Blimk_Debug> pio pkg update -g -p atmelsam
Platform Manager: atmelsam@8.2.0 is already up-to-date
Tool Manager: framework-arduino-samd@1.8.13 is already up-to-date
Tool Manager: framework-cmsis@1.40500.0 is already up-to-date
Tool Manager: framework-cmsis-atmel@1.2.2 is already up-to-date
Tool Manager: tool-bossac@1.10700.190624 is already up-to-date
Tool Manager: toolchain-gccarmnoneeabi@1.70201.0 is already up-to-date
PS C:\Users\wolf\Documents\PlatformIO\Projects\Blimk_Debug> pio debug --interface=gdb -- -x .pioinit
KeyError: Traceback (most recent call last):
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\__main__.py", line 103, in main
    cli()  # pylint: disable=no-value-for-parameter
    ^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\cli.py", line 85, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\click\decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\debug\cli.py", line 104, in cli
    debug_config = _configure(*configure_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\debug\cli.py", line 113, in _configure
    debug_config = DebugConfigFactory.new(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\debug\config\factory.py", line 48, in new
    return config_cls(platform, project_config, env_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\debug\config\generic.py", line 38, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\debug\config\base.py", line 52, in __init__
    self.server = self._configure_server()
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\debug\config\base.py", line 182, in _configure_server
    self.platform.get_package_dir(server_package)
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\platform\_packages.py", line 32, in get_package_dir
    pkg = self.get_package(name)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\platform\_packages.py", line 29, in get_package
    return self.pm.get_package(spec or self.get_package_spec(name))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wolf\.platformio\penv\Lib\site-packages\platformio\platform\_packages.py", line 21, in get_package_spec
    owner=self.packages[name].get("owner"),
          ~~~~~~~~~~~~~^^^^^^
KeyError: 'tool-openocd'

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `python -m pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq/index.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant