Hello,
I know a similar question has been asked and I have gone through the solution will no luck.
I cannot get the device to be detected on the SWD interface. I'm using s Segger JLink EDU. The board didn't have the XTAL32M_P or XTAL32K_P pins ties to ground so I wired them in as with the pull up on PIO0_5. The attached schematic shows the current arrangement.
I am seeing 1.052V on C39 as expected.
Could be a power issue, any help is appreciated.
Thanks
Christian
Solved! Go to Solution.
I got it to work by getting a newer debugger. If you are using a Segger Jlink it needs to be later then V8.0 hardware
I got it to work by getting a newer debugger. If you are using a Segger Jlink it needs to be later then V8.0 hardware
I took a capture of the a SWD transaction, I don't know the protocol but it looks like the ACK works and it responds.
If I try it from the command line this is the output
Type "connect" to establish a target connection, '?' for help
J-Link>connect LPC5502
Please specify device / core. <Default>: LPC5502
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>s
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "LPC5502" selected.
Connecting to target via SWD
ConfigTargetSettings() start
Disabling flash programming optimizations: Compare, SkipBlankDataOnProg
ConfigTargetSettings() end
InitTarget() start
ERROR: Wrong DM-AP IDCODE detected: 0x00000000
InitTarget() end
ConfigTargetSettings() start
Disabling flash programming optimizations: Compare, SkipBlankDataOnProg
ConfigTargetSettings() end
InitTarget() start
ERROR: Wrong DM-AP IDCODE detected: 0x00000000
InitTarget() end
ConfigTargetSettings() start
Disabling flash programming optimizations: Compare, SkipBlankDataOnProg
ConfigTargetSettings() end
InitTarget() start
ERROR: Wrong DM-AP IDCODE detected: 0x00000000
InitTarget() end
ConfigTargetSettings() start
Disabling flash programming optimizations: Compare, SkipBlankDataOnProg
ConfigTargetSettings() end
InitTarget() start
ERROR: Wrong DM-AP IDCODE detected: 0x00000000
InitTarget() end
Cannot connect to target.
J-Link>
I've done some reading and it looks like the IDCODE for a Cortex-M33 should be 0xBA04 yet mine is returning 0xBA02, this is clear in the previous captured screen shot. I have both tested from the IDE as well as the JLink console program.
J-Link>readdp 0
Reading DP register 0 = 0x6BA02477 (0 read repetitions needed)
Could this be the issue? Could it be a damaged MCU?
I had already put a pull up on SWD and a pull down on SCK on my programming breakout board. Putting on the PCB containing the LPC5502 will be difficult. Is the SWO pin actually required? It hasn't been on any of my other boards where I have used the same programming break out board.
If you don't need SWO trace. SWO pin is not needed.
HI christianlees
I suggest you referring this article to check your SWD debug interface design.
https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Design-Considerations-for-Debug/m-p/469565
Hope this helps,
Jun Zhang
I've changed the MCU, could only get LPC5506 quickly. Same issue.
Interestingly if I try to debug the incorrect project, one based on an LPC802 then it manages to read the IDCODE and flag it as the incorrect MCU but when I debug the correct project it returns zeros even though the logic analyser says differently.
Sounds like a software issue to me?
Is it a lack of support for the J-Link EDU?
It sounds like you have a problem with your debug circuit. Almost certainly not a software problem.