I’m working on an application that uses two STM32 boards (Nucleo and/or Discovery F072) and was wondering if it is possible to create debug configurations that would configure OpenOCD to target a specific board.
I have had some success simultaneously debugging multiple (two) targets at the same time if one of the targets uses a STLink/V2 and the other uses a STLink/V2-1, such as the case when II’m using a -F072 Discovery board (STLink/V2) as one target, and a Nucleo-F072RB (STLink/V2-1) as another target. All I have to do is create seperate debug configurations and use the “manual spec” configuration script option in the Debugger tab in the create/manage/run configurations dialog and select “ST-LinkV2” or “ST-LinkV2-1” as the debug device as appropriate.
Unfortunately, if both targets use the same debug device, such as would be the case if I were using two Discovery or two Nucleo boards, I do not know how to configure the debug configuration and/or OpenOCD script(s) to select a specific board. This is more of an issue with OpenOCD than SW4STM32, but I was hoping that someone with more experience with OpenOCD might be able to offer a suggestion.
I took a look at the OpenOCD documentation, which is unfortunately not up-to-date with the latest version, and I did note that there were some options to select a specific debugger/probe by serial number for some types of devices, such as those that are FTDI-based. Since the OpenOCD documentation was last updated for OpenOCD v0.6 (where ST-Link support was first introduced) it did not cover commands/usage for the ST-Link in much detail. There was no mention of a command/option to select a ST-Link probe by (USB/ennumerated) serial number or any other means - at least, I did not see any such option available.
On a (somewhat) related topic, is it possible to connect/debug a target without re-flashing it? I realize, of course, that the code running on the target would have to match the current state of the project for this to work. What I’m looking for here is the equivalent of the “Debug without downloading” option that is offered in other IDEs, such as IAR’s EWARM.