platformio / platform-raspberrypi

Raspberry Pi: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/raspberrypi
Apache License 2.0
72 stars 93 forks source link

Configure debug session as required for pio 5.2+ #31

Closed episource closed 2 years ago

episource commented 2 years ago

API to configure debug session/options has changed starting with pio 5.2. This PR adapts platform.py to use the new API, hence making this platform compatible with pio 5.2+ (but breaking compatibility with older versions).

Additionally, this commit replaces deprecated openocd option adapter_khz with adapter speed.

When using CMSIS-DAP/SWD protocol for debugging, this PR resolves openocd error Error: CMSIS-DAP command CMD_DAP_SWJ_CLOCK failed.. This error is caused by adapter speed beeing unspecified.

episource commented 2 years ago

There's also a branch with all my PR's merged together: https://github.com/episource/platform-raspberrypi/tree/my-platform

ivankravets commented 2 years ago

Thanks for the PR!