Skip to content

Instantly share code, notes, and snippets.

@shenghaoyang
Last active February 11, 2022 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shenghaoyang/feb327ef23b343c738d40edab34a0570 to your computer and use it in GitHub Desktop.
Save shenghaoyang/feb327ef23b343c738d40edab34a0570 to your computer and use it in GitHub Desktop.
STM32CubeIDE with upstream OpenOCD

(latest versions of?) STM32CubeIDE seems to send DAP-related monitor commands:

ReadAP, WriteAP, ReadDP, WriteDP

Upstream OpenOCD (at least the one that is packaged in Fedora) implements the functionality of those commands but they are not available under those names.

Copy mon_cmd_extension.cfg's contents from your STM32CubeIDE installation into your OpenOCD startup script (just search for a file with that name). That should define the commands.

Note:

  • If using a ST-Link, make sure to use the new st-link driver that supports DAP access.

    source [find interface/stlink-dap.cfg]

  • The number of GDB connections allowed by OpenOCD needs to be increased beyond the default of 1, e.g. with:

    $_TARGETNAME configure -gdb-max-connections -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment