I’ve certainly experienced a number of issues with this, some caused by the design of OpenOCD and some I expect caused by (the ever present) bugs. I’ve managed to bypass most of these, but some are still causing real problems for me.
I have a board with three 2103s on it, one acting as a master for the other two. I use the target specifiers as outlined by Dominic to address individual targets.
Now for the issues.
First of all, flash programming. For a single target in the chain, this works fine simply adding a "target_script 0 reset oocd_update_2xxx.script
" command to the cfg file. However, with mutiple targets, the script gets run for every chip even though it specifies a target of 0 and thus shouldn’t run for the other targets.
I solved this by writing a simple TCP/IP script that issues the relevant flash programming commands to port 4444 and not using the (in my view broken) reset script mechanism.
Secondly, multiple target debugging.
This just doesn’t work. Reliably. I’ve been able to debug a target for several seconds, or in some instances, minutes, but eventually it will fail with an error that the wrong status was read from the target. This happens if either or both the other two targets are running, but not normally if they are halted.
If I start them up using the run_and_halt option on the target config line, then connect to OpenOCD and start one of the targets running it mostly works - but of course the other processors are then halted and thus cannot be tested. However, if I then connect to port 4444 and issue a command to start either of the other targets running, the first instance will either stop immediately or very soon thereafter.
It’s a bit bizarre because the JTAG chain does work just fine for programming the flash memory, but then again, the targets are all halted during this process. So it does look like a software issue somewhere in OpenOCD.
I can supply more info if anyone wants to follow this up.
I ended up putting a large connector on my board that allowed me to link the JTAG chain up to connect one or more targets together for the debug of the day! This works for me but it is hardly neat. And it costs me an extra $5 for a connector that I don’t really need…