phdussud / pico-dirtyJtag

MIT License
298 stars 41 forks source link

Can Pico provide two Jtag in parallel? #7

Closed laoshaw closed 2 years ago

laoshaw commented 2 years ago

a general question, as I want to connect to two jtags. not sure if I can use one rp2040 for both, or use two rp2040s, one for each. Thanks.

jeanthom commented 2 years ago

You can daisy-chain your JTAG targets and use one RP2040.

phdussud commented 2 years ago

I think it depends on the scenario. JTAG spec makes chaining possible. If the 2 devices exposing a JTAG interface are related and your development environment knows how to model the 2 devices on a single JTAG chain, then you need only one rp2040. Otherwise if you want to have to control the 2 devices independently, use 2 rp2040. However I am not sure that the the program accessing the USB interface of the rp2040 is capable of connecting to one rp2040 when 2 are active on the USB tree of a single machine.

phdussud commented 2 years ago

Sorry @jeanthom. We replied at the same time.

laoshaw commented 2 years ago

I think it depends on the scenario. JTAG spec makes chaining possible. If the 2 devices exposing a JTAG interface are related and your development environment knows how to model the 2 devices on a single JTAG chain, then you need only one rp2040. Otherwise if you want to have to control the 2 devices independently, use 2 rp2040. However I am not sure that the the program accessing the USB interface of the rp2040 is capable of connecting to one rp2040 when 2 are active on the USB tree of a single machine.

when you mention 'the program accessing the usb interface', you mean programs like 'openocd' correct? in that case I can run two openocd processes with different USB device ID coded in pico, assuming openocd is for one-JTAG-only adapter at once.

phdussud commented 2 years ago

Yes that's what I mean. I am not certain because I haven't tried your scenario but you may have to modify openocd (dirtyjtag.c) to do what you said because right now it just cares about the VID / PID of the device. My repo is here: https://sourceforge.net/u/phdussud/openocd/ci/master/tree/

laoshaw commented 2 years ago

Thanks!

phdussud commented 2 years ago

I see that openocd can accept a serial number with the tcl command: adapter serial So in theory you can just makes sure that the 2 dirtyjtag-pico have different serial numbers and specify each one before initing each adapter in your openocd sessions