OpenOCD Upgrade?

Hello,

OpenOCD had a recent release to 0.11. xPack has already incorporated this: 0.11.0-1.1 · xpack-dev-tools/openocd-xpack@519a77e · GitHub

But it appears the latest version of openocd in platformio (2.1000.200630) points to openocd 0.10.0+dev-00378-ge5be992df

Can someone bump the package in the platformio repo to the latest?

the nulink interface was added in this latest version, and I’d like to make a platform/board utilizing it :slight_smile:

Thanks!

  • Travis

If you need a custom OpenOCD version, point to it using platform_packages (that is, grab the release package for the OpenOCD package you want, add a package.json to akin to <home folder>/.platformio/packages/tool-openocd/package.json with updated version info, and refer to the folder using file://<path> or a repository link).

Requests for updates go to specific platform you’re working on (e.g., Issues · platformio/platform-ststm32 · GitHub)

digin up this topic since I have some issue debugging some c++ template on stm32, when steping into it just display the called template function, but further step into go over the whole template…
I suspect the openocd to be outdated
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:15)

when I go to https://openocd.org/ the latest version is 0.12.0 from Fri 03 March 2023

I’m new to platformio, and contributing to a project, so I don’t know where the package is specified…

+1 for updating OpenOCD. It’s long overdue IMO.

I have to patch platformio here locally with the latest OpenOCD to be able to debug STM32 with FreeRTOS. This complicates replicating the development environment and handling Mac vs Linux vs Windows.

See https://github.com/platformio/platform-ststm32/blob/develop/platform.json#L309

Do you use the latest ST STM32 dev-platform? Try pio pkg update in the project folder.

Thanks Ivan. I updated pio and am now getting an openocd version that does work with FreeRTOS. (xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)

The only platformio file that I need to manually patch now is tool-openocd/openocd/scripts/target/stm32h7x.cfg, appending -rtos auto to the end of the line.

Will it be possible to address this as well? E.g. having the --rtos auto out of the box or alowing to configure it in platformio.ini. This will make it easier to other people to reproduce the project dev environment.

$_CHIPNAME.cpu0 configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 -rtos auto

Is it possible to enable RTOS without patching the original configs? Can we do this from the OpenOCD CLI or pass monitor commands to the active GDB session?

I don’t know of a way but am not an OpenOCD expert by any mean.

Looking for example at esp32, they seem to have a modified file which makes it to work out of the box.

.platformio/packages/tool-openocd-esp32/openocd/scripts/target/esp32c2.cfg

if { $_RTOS == "none" } {
    target create $_TARGETNAME esp32c2 -chain-position $_TAPNAME
} else {
    target create $_TARGETNAME esp32c2 -chain-position $_TAPNAME -rtos $_RTOS
}