-
Notifications
You must be signed in to change notification settings - Fork 8.1k
boards: OpenOCD deprecation of ST-Link HLA interface #97643
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
base: main
Are you sure you want to change the base?
boards: OpenOCD deprecation of ST-Link HLA interface #97643
Conversation
This change aims to address a compatibility issue with recent OpenOCD pre-release and what is planned in OpenOCD v1.0.0 planned end of 2025. OpenOCD commit 34ec5536c0ba ("stlink: deprecate HLA support") [1] was merged in December 2024 after release tag 0.12.0 and before coming release v1.0.0. It deprecates the legacy HLA driver interface (also called transport) in favor to the generic DAP interface that is supported by ST-Link firmware v2.1 and later. Since the referred commit, OpenOCD config script must source a new config file (interface/stlink-hla.cfg) in order to select hla_swd transport. This change breaks many ST-Link based OpenOCD config files of Zephyr. Alternatively, already existing interface/stlink-dap.cfg can be used with dapdirect_swd interface to use direct DAP/SWD interface. To overcome the issue and support older and newer OpenOCD releases, change the OpenCOD configuration files for non-ST boards that use ST-Link to interface target debug and/or flash programming support. Use the already existing are still maintained interface/stlink-dap.cfg config script file together with dapdirect_swd transport interface. One may potentially face connection issues if using both a recent OpenOCD firmware and using a ST-Link adapter that embeds a ST-Link firmware v1.x. This may happen with old ST-Link adapter devices. ST-Link firmware v1.0 do not support DAP direct SWD interface. In such a case, either upgrade the ST-Link firmware (refer to STM32CubeProgrammer guide), or revert the change made here to explicitly use hla_swd transport based on stlink-hla.cfg. Link: https://sourceforge.net/p/openocd/code/ci/34ec5536c0ba3315bc5a841244bbf70141ccfbb4/ [1] Signed-off-by: Etienne Carriere <[email protected]>
|
I created this unique P-R to address various board vendors. If someone prefers I split these change per vendor, either through board vendor specific commits or even through board vendor specific P-Rs, please tell me. May I ask feedback of board maintainers regarding this change. Especially regarding whether or not there are some obligation of being backward compatible with ST-Link firmware v1.0 (that mandate the ST-Link HLA interface. |
# it is recommended to replace the 2 lines above with: | ||
# | ||
# source [find interface/stlink-hla.cfg] | ||
# transport select hla_swd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The board doesn't have an embedded debugger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this openocd config applies when one uses the ST-Link adapter between the host and the target.
In such case, the inline comments above apply to the firmware in the ST-Link adapter. Maybe should I rephrase the description.
Or more simply: do you assume one using an ST-Link adapter to debug fk723m1_zgt6 would use a recent ST-Link adapter product so that this inline comment can be simply removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was a bit confused when I wrote this.
The new config works on my side and I doubt that a lot of people will use legacy ST-Links.
Maybe you want to extend the documentation page for debug probes instead of adding the same notice a bunch of times.
This change aims to address a compatibility issue with recent OpenOCD pre-release and what is planned in OpenOCD v1.0.0 planned end of 2025. OpenOCD commit 34ec5536c0ba ("stlink: deprecate HLA support") [1] was merged in December 2024 after release tag 0.12.0 and before coming release v1.0.0. It deprecates the legacy HLA driver interface (also called transport) in favor to the generic DAP interface that is supported by ST-Link firmware v2.1 and later.
Since the referred commit, OpenOCD config script must source a new config file (interface/stlink-hla.cfg) in order to select hla_swd transport. This change breaks many ST-Link based OpenOCD config files of Zephyr. Alternatively, already existing interface/stlink-dap.cfg can be used with dapdirect_swd interface to use direct DAP/SWD interface.
To overcome the issue and support older and newer OpenOCD releases, change the OpenCOD configuration files for non-ST boards that use ST-Link to interface target debug and/or flash programming support. Use the already existing are still maintained interface/stlink-dap.cfg config script file together with dapdirect_swd transport interface.
One may potentially face connection issues if using both a recent OpenOCD firmware and using a ST-Link adapter that embeds a ST-Link firmware v1.x. This may happen with old ST-Link adapter devices. ST-Link firmware v1.0 do not support DAP direct SWD interface. In such a case, either upgrade the ST-Link firmware (refer to STM32CubeProgrammer guide), or revert the change made here to explicitly use hla_swd transport based on stlink-hla.cfg.
Link: https://sourceforge.net/p/openocd/code/ci/34ec5536c0ba3315bc5a841244bbf70141ccfbb4/ [1]
Note: This P-R addresses board from other vendors than ST. ST boards are addressed through #97638 that also adds an entry in the migration guide.