I have tried to debug my nordic5340 with VS code and it fails to load the code, although I'm able to flash the code using vs code.
when trying to track the problem using the Jlink commander I get a message the jlink fails to connect as my device is secured.
It offers to unsecure the board but that doesn't work.
see below logs:
SEGGER J-Link Commander V8.12d (Compiled Jan 29 2025 13:07:00)
DLL version V8.12d, compiled Jan 29 2025 13:06:04
Connecting to J-Link via USB...O.K.
Firmware: J-Link V12 compiled Dec 4 2024 17:53:50
Hardware version: V12.00
J-Link uptime (since boot): 0d 00h 01m 55s
S/N: 52003290
License(s): GDB
USB speed mode: High speed (480 MBit/s)
VTref=1.812V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: CORTEX-M33
Type '?' for selection dialog
Device>?
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>JTAG
Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
JTAGConf>
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>4000
Device "NRF5340_XXAA_APP" selected.
Connecting to target via JTAG
ConfigTargetSettings() start
ConfigTargetSettings() end - Took 23us
InitTarget() start
Device will be unsecured now.
InitTarget() end - Took 11.2s
Connect failed. Resetting via Reset pin and trying again.
ConfigTargetSettings() start
ConfigTargetSettings() end - Took 8us
InitTarget() start
Device will be unsecured now.
InitTarget() end - Took 2.31s
Error occurred: Could not connect to the target device.
For troubleshooting steps visit: wiki.segger.com/J-Link_Troubleshooting
J-Link>