-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Description
As discovered in #21775 (comment), the latest OpenOCD upstream code is required to flash the STM32C071 because the last OpenOCD Release (0.12.0, which is two years old at the time of writing) does not support is.
Also, the latest OpenOCD version wants the flash method to be swd instead of hla_swd, which apparently is not supported anymore.
swd is not a supported method for older OpenOCD versions though (0.11.0 that is standard on Ubuntu 22.04 LTS for example).
The make script that configures the OpenOCD settings for the ST-Link is not a great help at the moment because it changes swd to hla_swd by default:
RIOT/makefiles/tools/openocd-adapters/stlink.inc.mk
Lines 10 to 16 in 355e5f4
| # If swd / jtag is selected by the board, prefix it with hla_ | |
| ifneq (,$(filter swd jtag,$(OPENOCD_TRANSPORT))) | |
| OPENOCD_TRANSPORT := hla_$(OPENOCD_TRANSPORT) | |
| endif | |
| # All ST-Link adapters support hla_swd, so use that for simplicity | |
| OPENOCD_TRANSPORT ?= hla_swd |
One temporary fix would be to set the OPENOCD_TRANSPORT variable to dapdirect_swd, which is also deprecated though...
The better solution would be to add a version check.
@maribu said that Zephyr maintains it's own OpenOCD fork that supports all boards supported by Zephyr, so that might be an option to look at. Perhaps it also supports the RP2040 and RP2350, so we don't need to point to the Raspberry Pi fork of OpenOCD?
It would be nice not to have to have three or four different OpenOCD forks on the computer 🫠