I've recently had a design made that requires a programming port to be located quite far from the device I'm trying to program. This has meant that my cJTAG traces are around 13cm long. I think as a result of this the programming is a bit temperamental regardless of the programming clock frequency.
I had a similar problem in another design, and resolved it by using 22 ohm series resistors on the TMS and TCK lines near the microcontroller, but that doesn't seem to have worked so reliably with this design. That could be because the distance is greater, or because the lines switch layer a few times on their way from the programming port. There is also a UART Tx/Rx that runs along to the port beside the JTAG traces.
At the bottom left you can see the series resistors, and an additional 10k pullup resistor on the TCK line which I was the datasheet advised to allow hot-plugging a programming connector.
Right now I'm hoping to find a way to make programming of the devices more reliable, so I'd really appreciate any insight or advice on running jtag over this distance.