S32K142 JLINK program failed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K142 JLINK program failed

199 Views
BianHaopeng1
Contributor I
Hello everyone,
 
I have several faulty boards which fail to be programmed normally with CPU halt timeout error.
 
I use J-Link debugger and the latest J-Flash software. I choose device S32K142 (allow security), but the connection always fails after clicking Connect. The detailed J-Flash log is shown below:

Connecting ...
- Connecting via USB to probe/ programmer device 0
- Probe/ Programmer firmware: J-Link V12 compiled Mar 26 2026 10:14:53
- Probe/ Programmer S/N: 602004248
- Device "S32K142 (ALLOW SECURITY)" selected.
- Target interface speed: 4000 kHz (Fixed)
- VTarget = 3.328V
- ConfigTargetSettings() start
- ConfigTargetSettings() end - Took 30us
- InitTarget() start
- SWD selected. Executing JTAG -> SWD switching sequence.
- Device will be unsecured now.
- Timeout while halting CPU.
- InitTarget() end - Took 1.97s
- Found SW-DP with ID 0x2BA01477
- DPIDR: 0x2BA01477
- CoreSight SoC-400 or earlier
- Scanning AP map to find all available APs
- AP[2]: Stopped AP scan as end of AP map has been reached
- AP[0]: AHB-AP (IDR: 0x24770011, ADDR: 0x00000000)
- AP[1]: JTAG-AP (IDR: 0x001C0000, ADDR: 0x01000000)
- Iterating through AP map to find AHB-AP to use
- AP[0]: Skipped. Could not read CPUID register
- AP[1]: Skipped. Not an AHB-AP
- Attach to CPU failed. Executing connect under reset.
- DPIDR: 0x2BA01477
- CoreSight SoC-400 or earlier
- Scanning AP map to find all available APs
- AP[2]: Stopped AP scan as end of AP map has been reached
- AP[0]: AHB-AP (IDR: 0x24770011, ADDR: 0x00000000)
- AP[1]: JTAG-AP (IDR: 0x001C0000, ADDR: 0x01000000)
- Iterating through AP map to find AHB-AP to use
- AP[0]: Skipped. Could not read CPUID register
- AP[1]: Skipped. Not an AHB-AP
- Could not find core in Coresight setup
- ConfigTargetSettings() start
- ConfigTargetSettings() end - Took 4us
- InitTarget() start
- SWD selected. Executing JTAG -> SWD switching sequence.
- Device will be unsecured now.
- Timeout while halting CPU.
- InitTarget() end - Took 1.30s
- Found SW-DP with ID 0x2BA01477
- DPIDR: 0x2BA01477
- CoreSight SoC-400 or earlier
- Scanning AP map to find all available APs
- AP[2]: Stopped AP scan as end of AP map has been reached
- AP[0]: AHB-AP (IDR: 0x24770011, ADDR: 0x00000000)
- AP[1]: JTAG-AP (IDR: 0x001C0000, ADDR: 0x01000000)
- Iterating through AP map to find AHB-AP to use
- AP[0]: Skipped. Could not read CPUID register
- AP[1]: Skipped. Not an AHB-AP
- Attach to CPU failed. Executing connect under reset.
- DPIDR: 0x2BA01477
- CoreSight SoC-400 or earlier
- Scanning AP map to find all available APs
- AP[2]: Stopped AP scan as end of AP map has been reached
- AP[0]: AHB-AP (IDR: 0x24770011, ADDR: 0x00000000)
- AP[1]: JTAG-AP (IDR: 0x001C0000, ADDR: 0x01000000)
- Iterating through AP map to find AHB-AP to use
- AP[0]: Skipped. Could not read CPUID register
- AP[1]: Skipped. Not an AHB-AP
- Could not find core in Coresight setup
- ERROR: Failed to connect.
Could not establish a connection to target.
General troubleshooting guide: https://kb.segger.com/J-Link_Troubleshooting
- ERROR: Connect failed

Furthermore, I captured SWD communication waveforms with a logic analyzer during mass erase process, and the operation sequence is as below:
 
  1. Read MDM-AP Status = 0x34
  2. Read MDM-AP Status = 0x36
  3. Write MDM-AP Control = 0x10
  4. Write MDM-AP Control = 0x01
  5. Write MDM-AP Control = 0x08
  6. Read MDM-AP Status = 0x35
 
Could anyone kindly help analyze the possible reasons causing this programming and connection failure? Thank you very much.
Tags (1)
0 Kudos
Reply
1 Reply

56 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@BianHaopeng1

Did you enable the CSEc module on your chip before?

If so, it cannot be directly erased using a mass eraser.

0 Kudos
Reply