JTAG on Custom PCB for P1

Lets say I have a PCB using the P1 and I have things connected to the the various D3-D7 pins which are the JTAG pins. Can the P1 be programed though JTAG while other things are connected to the JTAG Pins?

Thanks

@wesner0019, my experience is that if the peripheral that you are connecting is directly driven by the GPIO pin, there might be some issues with that.

Eg. We had a Buzzer with the + and - both hooked up to a JTAG pin and it simply did not work.

Would you consider using the SWD pin instead since that only requires one wire? :wink:

1 Like

Or he could always use solder jumpers, program the device and then bridge the jumpers so the external devices were not connected. An extra step but do-able

That’s gonna be an issue where you cannot debug with all the peripherals attached :wink:

Well yes, perhaps “far from ideal” is more accurate than “do-able”

I was thinking in terms of mass production. Is jtag necessary at that point? would just the P1 module be flashed then mounted to the pcb?

Yes, typically flash before mounting to the PCB. That’s how the photons are made.

The P1’s do come with our firmware pre-loaded so you can also have the device connect to the cloud and pull down your own firmware once the user has setup WiFi.

2 Likes

@rickkas7 @ScruffR I have a custom PCB design with a P1 module on it.

If I want to have the ability to use JTAG re-programming abilities just in case I ever needed to reflash the bootloader for any reason.

Should I make sure all the JTAG pins are accessible or would the single pin required for SWD programming be fine?

I've never needed to program over JTAG but I have had Photons get the blue led go dimly lit and the Photon stopped working where JTAG programming may have brought them back to life.

I want to be able to bring a P1 back to life if possible vs reflowing a new P1 on the board.

1 Like

I would only expose the SWD pins D6, D7, along with 3V3, and GND. The real JTAG connector is unnecessary and huge.

If you aren’t adding a USB port, and not already using TX/RX, I would expose them as well so you can debug by Serial1 instead of USB.

2 Likes

Great, that saves some pins.

I was planning on using a USB port on the PCB so I can plug in and program via DFU via the CLI which is a process I'm familiar with.

I may need the UART RX port to read the Serial UART output from another device.

What is the benefit of debugging via Serial 1 vs. the USB port? Just want to make sure I'm not missing something important between the two options.

Thanks!

USB is the preferred way - it also makes programming the device much easier using DFU mode instead of SWD/JTAG.

Just like you can Serial.print to troubleshoot your code you can use Serial1.print and the Serial1LogHandler. But USB is easier.