I have 2 STM32F4 on a board. Chip 1 will debug OK with the ULINK2 set to SW. When I set the ULINK2 to JTAG a failure is reported. PCB trace lengths are 21mm to 37mm. Chip 2 will not debug. It reports at 0xFF at address 0x08000000 (i.e. un-programmed at first program address). With the ULINK2 set to JTAG, I do not get the JTAG failure report. PCB trace lengths are 35mm to 51mm. The same occurs when I use a ULINK PRO.
Has anyone any suggestions?
It's not about how long your wires are, but where you've put them.
From the detailed description of your wiring I'm going to deduce that you wired up the board for SWD, not full-on JTAG, or that you got the JTAG wiring wrong.
So examine and describe how you have daisy chained the JTAG pins here.
I have not daisy chained the JTAG, I have 2 separate JTAG connectors. I also have a separate FPGA JTAG, again separate. I am not brave enough to daisy chain them all.
On two previous boards I have connected JTAG, (TMS,TCK,TDI,TDO), a hardware reset pin and TRST connected to PB4 (TRST pin for STM32F4). I read in the Kiel ULINK manuals that the TRST pin is not required, so I have not connected it this time, and used the pin for something else. I have connected the trace pins CLK, D0,D1,D2,D3. In the ULINKs, nTRST is multiplexed with TRACE_D1 according to the Keil manual. I am using both a ULINK2 as well as the ULINK PRO, and ULINK2 does not have any trace facility, and only 10 connections I assume this has no bearing on my problem.
regards Konrad