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.
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
============================================================
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.