Electronics-Related.com
Forums

using a pi 400 to debug a pico

Started by john larkin January 15, 2024
The Raspberry Pi pico has its 3-pin SWD debug port. I'd like to
connect it to the 40-pin header on the back of the Pi400, to use the
400 as the dev/debug platform for some RP2040-based boxes.

Has anyone done this? What Pi400 pins connect to the SWD port?

Googling doesn't help. I have the RP400 Beginners Guide book and it
doesn't mention doing this.

Anybody have links about doing this?


mandag den 15. januar 2024 kl. 22.05.18 UTC+1 skrev john larkin:
> The Raspberry Pi pico has its 3-pin SWD debug port. I'd like to > connect it to the 40-pin header on the back of the Pi400, to use the > 400 as the dev/debug platform for some RP2040-based boxes. > > Has anyone done this? What Pi400 pins connect to the SWD port? > > Googling doesn't help. I have the RP400 Beginners Guide book and it > doesn't mention doing this. > > Anybody have links about doing this?
https://www.electronicshub.org/programming-raspberry-pi-pico-with-swd/
On Mon, 15 Jan 2024 13:21:14 -0800 (PST), Lasse Langwadt Christensen
<langwadt@fonz.dk> wrote:

>mandag den 15. januar 2024 kl. 22.05.18 UTC+1 skrev john larkin: >> The Raspberry Pi pico has its 3-pin SWD debug port. I'd like to >> connect it to the 40-pin header on the back of the Pi400, to use the >> 400 as the dev/debug platform for some RP2040-based boxes. >> >> Has anyone done this? What Pi400 pins connect to the SWD port? >> >> Googling doesn't help. I have the RP400 Beginners Guide book and it >> doesn't mention doing this. >> >> Anybody have links about doing this? > >https://www.electronicshub.org/programming-raspberry-pi-pico-with-swd/
It doesn't say so, but when he says "raspberry pi" I think he means a Pi3. I'll be using a Pi4, inside the Pi400 unit, but I expect the pins are the same on its 40-pin header. Oh, I found a reference in the book "Programming the Raspberry Pi Pico/w in C". Looks like the same pins, GPIO24(18) and GPIO25(22). Thanks I'm designing a PCB that will have a 40 pin ribbon cable connector to the Pi400 and a 20-pin ribbon to the various RP2040 target boards. It will do the debug connection and have a bunch of scope mux's and DVM mux's and stuff, to make it easy to time code execution and check the power supplies and such. Looks like I can power my board from the 40 pin header too.
tirsdag den 16. januar 2024 kl. 00.13.38 UTC+1 skrev john larkin:
> On Mon, 15 Jan 2024 13:21:14 -0800 (PST), Lasse Langwadt Christensen > <lang...@fonz.dk> wrote: > > >mandag den 15. januar 2024 kl. 22.05.18 UTC+1 skrev john larkin: > >> The Raspberry Pi pico has its 3-pin SWD debug port. I'd like to > >> connect it to the 40-pin header on the back of the Pi400, to use the > >> 400 as the dev/debug platform for some RP2040-based boxes. > >> > >> Has anyone done this? What Pi400 pins connect to the SWD port? > >> > >> Googling doesn't help. I have the RP400 Beginners Guide book and it > >> doesn't mention doing this. > >> > >> Anybody have links about doing this? > > > >https://www.electronicshub.org/programming-raspberry-pi-pico-with-swd/ > It doesn't say so, but when he says "raspberry pi" I think he means a > Pi3. I'll be using a Pi4, inside the Pi400 unit, but I expect the pins > are the same on its 40-pin header.
afaik the 40 pin header on all Pi's are compatible, except for maybe some of the alternate functions and on the Pi5 the GPIOs are one the new RP1 chip via pci-e so probably adds a us of latency
On Mon, 15 Jan 2024 16:34:31 -0800 (PST), Lasse Langwadt Christensen
<langwadt@fonz.dk> wrote:

>tirsdag den 16. januar 2024 kl. 00.13.38 UTC+1 skrev john larkin: >> On Mon, 15 Jan 2024 13:21:14 -0800 (PST), Lasse Langwadt Christensen >> <lang...@fonz.dk> wrote: >> >> >mandag den 15. januar 2024 kl. 22.05.18 UTC+1 skrev john larkin: >> >> The Raspberry Pi pico has its 3-pin SWD debug port. I'd like to >> >> connect it to the 40-pin header on the back of the Pi400, to use the >> >> 400 as the dev/debug platform for some RP2040-based boxes. >> >> >> >> Has anyone done this? What Pi400 pins connect to the SWD port? >> >> >> >> Googling doesn't help. I have the RP400 Beginners Guide book and it >> >> doesn't mention doing this. >> >> >> >> Anybody have links about doing this? >> > >> >https://www.electronicshub.org/programming-raspberry-pi-pico-with-swd/ >> It doesn't say so, but when he says "raspberry pi" I think he means a >> Pi3. I'll be using a Pi4, inside the Pi400 unit, but I expect the pins >> are the same on its 40-pin header. > >afaik the 40 pin header on all Pi's are compatible, except for maybe some of the alternate functions >and on the Pi5 the GPIOs are one the new RP1 chip via pci-e so probably adds a us of latency
I probably don't care about the latency of the port pins from the 40 pin header, from the Pi400. It will be controlling multiplexers and such. We'll use port pins from the RP2040 chip on the DUT to time software, but those are real port pins.
On 2024-01-15, john larkin <jl@650pot.com> wrote:
> The Raspberry Pi pico has its 3-pin SWD debug port. I'd like to > connect it to the 40-pin header on the back of the Pi400, to use the > 400 as the dev/debug platform for some RP2040-based boxes.
What debug software are you planning to use? OpenOCD? The pinout seems to be quite flexible - look at interface/raspberrypi-gpio-connector.cfg in the OpenOCD sources / distribution. If you want something nice with level translation that handles power sequencing between Pi and Target board, the JTAG Hat should do what you want: https://github.com/mschwingen/hardware/tree/master/JTAG_hat I think this should also work an a pi400. cu Michael -- Some people have no respect of age unless it is bottled.
On 16 Jan 2024 13:58:13 GMT, Michael Schwingen
<news-1513678000@discworld.dascon.de> wrote:

>On 2024-01-15, john larkin <jl@650pot.com> wrote: >> The Raspberry Pi pico has its 3-pin SWD debug port. I'd like to >> connect it to the 40-pin header on the back of the Pi400, to use the >> 400 as the dev/debug platform for some RP2040-based boxes. > >What debug software are you planning to use? OpenOCD?
Whatever the pi400 uses. I'll let a programmer deal with that.
> >The pinout seems to be quite flexible - look at >interface/raspberrypi-gpio-connector.cfg in the OpenOCD sources / >distribution. > >If you want something nice with level translation that handles power >sequencing between Pi and Target board, the JTAG Hat should do what you >want: > >https://github.com/mschwingen/hardware/tree/master/JTAG_hat > >I think this should also work an a pi400.
Is there a schematic somewhere? I plan to make my own board, as described. I'm especially interested in scoping realtime performance.
> >cu >Michael
On 2024-01-16, John Larkin <jl@997PotHill.com> wrote:
>>If you want something nice with level translation that handles power >>sequencing between Pi and Target board, the JTAG Hat should do what you >>want: >> >>https://github.com/mschwingen/hardware/tree/master/JTAG_hat >> >>I think this should also work an a pi400. > > Is there a schematic somewhere?
It is linked in the description: https://github.com/mschwingen/hardware/tree/master/JTAG_hat/pcb_ms_v3/Doc It's basically a bunch of 74LVC2T45 (which handle the "one side powered down" as well as the level-shifting), plus open-drain drivers for the reset signals. Note that you need to switch direction for the SWDIO signal, the rest is unidirectional. cu Michael -- Some people have no respect of age unless it is bottled.
On 16 Jan 2024 15:57:32 GMT, Michael Schwingen
<news-1513678000@discworld.dascon.de> wrote:

>On 2024-01-16, John Larkin <jl@997PotHill.com> wrote: >>>If you want something nice with level translation that handles power >>>sequencing between Pi and Target board, the JTAG Hat should do what you >>>want: >>> >>>https://github.com/mschwingen/hardware/tree/master/JTAG_hat >>> >>>I think this should also work an a pi400. >> >> Is there a schematic somewhere? > >It is linked in the description: > >https://github.com/mschwingen/hardware/tree/master/JTAG_hat/pcb_ms_v3/Doc > >It's basically a bunch of 74LVC2T45 (which handle the "one side powered >down" as well as the level-shifting), plus open-drain drivers for the reset >signals. Note that you need to switch direction for the SWDIO signal, the >rest is unidirectional. > >cu >Michael
Do you think it's worth buffering the SW Debug pins? I was thinking I might buffer the clock, since it's unidirectional and maybe edge/impedance sensitive. I have no idea what the timing from the Pi400 will be like, but people seem to use breadboards and dangling wires and get away with it. If the rate is reasonably low, the SWDIO data line won't matter much.
On 16 Jan 2024 15:57:32 GMT, Michael Schwingen
<news-1513678000@discworld.dascon.de> wrote:

>On 2024-01-16, John Larkin <jl@997PotHill.com> wrote: >>>If you want something nice with level translation that handles power >>>sequencing between Pi and Target board, the JTAG Hat should do what you >>>want: >>> >>>https://github.com/mschwingen/hardware/tree/master/JTAG_hat >>> >>>I think this should also work an a pi400. >> >> Is there a schematic somewhere? > >It is linked in the description: > >https://github.com/mschwingen/hardware/tree/master/JTAG_hat/pcb_ms_v3/Doc > >It's basically a bunch of 74LVC2T45 (which handle the "one side powered >down" as well as the level-shifting), plus open-drain drivers for the reset >signals. Note that you need to switch direction for the SWDIO signal, the >rest is unidirectional. > >cu >Michael
This is a first pass at the dev board. https://www.dropbox.com/scl/fi/709v4pqjhe91jnwqh4wvg/Z566_Sch_2.jpg?rlkey=fjq3a9re53cv5l0zn9ya00akk&raw=1 It would be used in development and production test. Every RP2040-based board would have the small-pitch 20 pin ribbon cable header. The pushbuttons look primitive but will probably work.