In a recent project of mine using an ESP32 and a CC1352, I noticed that on both programming headers there are 3V3 and GND pins, which are, I suppose, to power the device if you want to program it when it is not connected to anything.
In my scenario however, both MCUs are powered by the PCB they are on. I noticed that I couldn't get the flash process to reliably work if I powered the chips from the PCB and only connect the non-power pins, which for the ESP are TX-RX-IO0-EN and for the CC1352 is RX-TX-JTAG. If I disable power on the PCB and I also connect the 3V3-GND pins, on both MCUs I can reliably flash everytime.
Is this the expected behaviour?
To me it seems quite strange that if a customer has an MCU on a big board he has to turn off the whole machine just to flash that specific chip. For example often there are JTAG connectors on motherboards. Is the user supposed to turn off the PC to use the JTAG interface?
EDIT
I forgot to mention that on the other end of the programming header, for the CC1352 for example, there is a debug probe taken by the CC1352 Launchpad. I am hesitant to connect its VCC-GND to my PCB because the PCB components take VCC-GND from the voltage regulator, and on the launchpad they come from the USB. If I bridge the two I would be connecting the VCC of USB 2.0 to the VCC of a voltage regulator, same for GND, I'm not sure if that would be safe. Similar situation on the ESP32.