I know it's a very specific question, so I don't have many hopes to find a solution here, but I already tried everything and I don't know how to solve the issue I have that is very annoying.
I have three PCBs: PCB1 that mounts LPC54101 (M4), PCB2 that mounts LPC54606 (M4), PCB3 that mounts LPC54618 (M4). All these MCUs are from NXP.
After I receive the first prototype for each board, I was able to make a connection through SWD, by using a J-Link probe. I use MCUXpresso as the IDE for debug launch.
Well, after some tests (write some code, download new images, debug some and so on), I received an error from the probe: no SWD target found (Could not connect to the target).
The MCU appears working well with the last downloaded image, but the SWD access seems disabled. Moreover the MCU is able to enter UART ISP Boot (by pulling down a specific ISP pin) and I can erase and rewrite the internal Flash by UART. I tried to connect by SWD even when the MCU has booted in ISP Boot ROM, without any success.
Ok, something went wrong with this MCU, it could happen on prototypes during development. But the big issue I am worried about and that is incredible for me, is that this exactly sequence of events happened for one prototype of PCB1, one of PCB2 and one of PCB3!!!
After some program&debug cycle (for a few days all is ok), the probe isn't able to connect to the target anymore.
The probe and cables seem ok, because if I replace bricked PCBs with a working PCB, all is ok.
I tried to contact NXP support, but they couldn't solve this problem and don't know what happened to bricked MCUs.
LPC546xx MCUs have a complex mechanism (some values at specific address in the Flash and OTP memory) that allows to restrict access via ISP and/or SWD, but LPC5410x is much more simple. The protection is enabled by writing some magic words at specific address in the internal Flash. However I'm able to erase the internal Flash (by UART ISP) so this can't be the reason of SWD issue. For what I have read, there's now way to lock SWD access after an erase of internal Flash memory.
I used J-Link with LPC17xx for many years in the past without any issue. What's the problem with LPC54?
Do you have some suggestions?