S32K142 JLINK program failed

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

S32K142 JLINK program failed

476 Views
BianHaopeng1
Contributor II
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

333 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
%3CLINGO-SUB%20id%3D%22lingo-sub-2365858%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K142%20JLINK%20program%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2365858%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3EHello%20everyone%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EI%20have%20several%20faulty%20boards%20which%20fail%20to%20be%20programmed%20normally%20with%20CPU%20halt%20timeout%20error.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EI%20use%20J-Link%20debugger%20and%20the%20latest%20J-Flash%20software.%20I%20choose%20device%20%3CSTRONG%3ES32K142%20(allow%20security)%3C%2FSTRONG%3E%2C%20but%20the%20connection%20always%20fails%20after%20clicking%20Connect.%20The%20detailed%20J-Flash%20log%20is%20shown%20below%3A%3CBR%20%2F%3E%3CBR%20%2F%3EConnecting%20...%3CBR%20%2F%3E-%20Connecting%20via%20USB%20to%20probe%2F%20programmer%20device%200%3CBR%20%2F%3E-%20Probe%2F%20Programmer%20firmware%3A%20J-Link%20V12%20compiled%20Mar%2026%202026%2010%3A14%3A53%3CBR%20%2F%3E-%20Probe%2F%20Programmer%20S%2FN%3A%20602004248%3CBR%20%2F%3E-%20Device%20%22S32K142%20(ALLOW%20SECURITY)%22%20selected.%3CBR%20%2F%3E-%20Target%20interface%20speed%3A%204000%20kHz%20(Fixed)%3CBR%20%2F%3E-%20VTarget%20%3D%203.328V%3CBR%20%2F%3E-%20ConfigTargetSettings()%20start%3CBR%20%2F%3E-%20ConfigTargetSettings()%20end%20-%20Took%2030us%3CBR%20%2F%3E-%20InitTarget()%20start%3CBR%20%2F%3E-%20SWD%20selected.%20Executing%20JTAG%20-%26gt%3B%20SWD%20switching%20sequence.%3CBR%20%2F%3E-%20Device%20will%20be%20unsecured%20now.%3CBR%20%2F%3E-%20Timeout%20while%20halting%20CPU.%3CBR%20%2F%3E-%20InitTarget()%20end%20-%20Took%201.97s%3CBR%20%2F%3E-%20Found%20SW-DP%20with%20ID%200x2BA01477%3CBR%20%2F%3E-%20DPIDR%3A%200x2BA01477%3CBR%20%2F%3E-%20CoreSight%20SoC-400%20or%20earlier%3CBR%20%2F%3E-%20Scanning%20AP%20map%20to%20find%20all%20available%20APs%3CBR%20%2F%3E-%20AP%5B2%5D%3A%20Stopped%20AP%20scan%20as%20end%20of%20AP%20map%20has%20been%20reached%3CBR%20%2F%3E-%20AP%5B0%5D%3A%20AHB-AP%20(IDR%3A%200x24770011%2C%20ADDR%3A%200x00000000)%3CBR%20%2F%3E-%20AP%5B1%5D%3A%20JTAG-AP%20(IDR%3A%200x001C0000%2C%20ADDR%3A%200x01000000)%3CBR%20%2F%3E-%20Iterating%20through%20AP%20map%20to%20find%20AHB-AP%20to%20use%3CBR%20%2F%3E-%20AP%5B0%5D%3A%20Skipped.%20Could%20not%20read%20CPUID%20register%3CBR%20%2F%3E-%20AP%5B1%5D%3A%20Skipped.%20Not%20an%20AHB-AP%3CBR%20%2F%3E-%20Attach%20to%20CPU%20failed.%20Executing%20connect%20under%20reset.%3CBR%20%2F%3E-%20DPIDR%3A%200x2BA01477%3CBR%20%2F%3E-%20CoreSight%20SoC-400%20or%20earlier%3CBR%20%2F%3E-%20Scanning%20AP%20map%20to%20find%20all%20available%20APs%3CBR%20%2F%3E-%20AP%5B2%5D%3A%20Stopped%20AP%20scan%20as%20end%20of%20AP%20map%20has%20been%20reached%3CBR%20%2F%3E-%20AP%5B0%5D%3A%20AHB-AP%20(IDR%3A%200x24770011%2C%20ADDR%3A%200x00000000)%3CBR%20%2F%3E-%20AP%5B1%5D%3A%20JTAG-AP%20(IDR%3A%200x001C0000%2C%20ADDR%3A%200x01000000)%3CBR%20%2F%3E-%20Iterating%20through%20AP%20map%20to%20find%20AHB-AP%20to%20use%3CBR%20%2F%3E-%20AP%5B0%5D%3A%20Skipped.%20Could%20not%20read%20CPUID%20register%3CBR%20%2F%3E-%20AP%5B1%5D%3A%20Skipped.%20Not%20an%20AHB-AP%3CBR%20%2F%3E-%20Could%20not%20find%20core%20in%20Coresight%20setup%3CBR%20%2F%3E-%20ConfigTargetSettings()%20start%3CBR%20%2F%3E-%20ConfigTargetSettings()%20end%20-%20Took%204us%3CBR%20%2F%3E-%20InitTarget()%20start%3CBR%20%2F%3E-%20SWD%20selected.%20Executing%20JTAG%20-%26gt%3B%20SWD%20switching%20sequence.%3CBR%20%2F%3E-%20Device%20will%20be%20unsecured%20now.%3CBR%20%2F%3E-%20Timeout%20while%20halting%20CPU.%3CBR%20%2F%3E-%20InitTarget()%20end%20-%20Took%201.30s%3CBR%20%2F%3E-%20Found%20SW-DP%20with%20ID%200x2BA01477%3CBR%20%2F%3E-%20DPIDR%3A%200x2BA01477%3CBR%20%2F%3E-%20CoreSight%20SoC-400%20or%20earlier%3CBR%20%2F%3E-%20Scanning%20AP%20map%20to%20find%20all%20available%20APs%3CBR%20%2F%3E-%20AP%5B2%5D%3A%20Stopped%20AP%20scan%20as%20end%20of%20AP%20map%20has%20been%20reached%3CBR%20%2F%3E-%20AP%5B0%5D%3A%20AHB-AP%20(IDR%3A%200x24770011%2C%20ADDR%3A%200x00000000)%3CBR%20%2F%3E-%20AP%5B1%5D%3A%20JTAG-AP%20(IDR%3A%200x001C0000%2C%20ADDR%3A%200x01000000)%3CBR%20%2F%3E-%20Iterating%20through%20AP%20map%20to%20find%20AHB-AP%20to%20use%3CBR%20%2F%3E-%20AP%5B0%5D%3A%20Skipped.%20Could%20not%20read%20CPUID%20register%3CBR%20%2F%3E-%20AP%5B1%5D%3A%20Skipped.%20Not%20an%20AHB-AP%3CBR%20%2F%3E-%20Attach%20to%20CPU%20failed.%20Executing%20connect%20under%20reset.%3CBR%20%2F%3E-%20DPIDR%3A%200x2BA01477%3CBR%20%2F%3E-%20CoreSight%20SoC-400%20or%20earlier%3CBR%20%2F%3E-%20Scanning%20AP%20map%20to%20find%20all%20available%20APs%3CBR%20%2F%3E-%20AP%5B2%5D%3A%20Stopped%20AP%20scan%20as%20end%20of%20AP%20map%20has%20been%20reached%3CBR%20%2F%3E-%20AP%5B0%5D%3A%20AHB-AP%20(IDR%3A%200x24770011%2C%20ADDR%3A%200x00000000)%3CBR%20%2F%3E-%20AP%5B1%5D%3A%20JTAG-AP%20(IDR%3A%200x001C0000%2C%20ADDR%3A%200x01000000)%3CBR%20%2F%3E-%20Iterating%20through%20AP%20map%20to%20find%20AHB-AP%20to%20use%3CBR%20%2F%3E-%20AP%5B0%5D%3A%20Skipped.%20Could%20not%20read%20CPUID%20register%3CBR%20%2F%3E-%20AP%5B1%5D%3A%20Skipped.%20Not%20an%20AHB-AP%3CBR%20%2F%3E-%20Could%20not%20find%20core%20in%20Coresight%20setup%3CBR%20%2F%3E-%20ERROR%3A%20Failed%20to%20connect.%3CBR%20%2F%3ECould%20not%20establish%20a%20connection%20to%20target.%3CBR%20%2F%3EGeneral%20troubleshooting%20guide%3A%20%3CA%20href%3D%22https%3A%2F%2Fkb.segger.com%2FJ-Link_Troubleshooting%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fkb.segger.com%2FJ-Link_Troubleshooting%3C%2FA%3E%3CBR%20%2F%3E-%20ERROR%3A%20Connect%20failed%3CBR%20%2F%3E%3CBR%20%2F%3E%3CDIV%3EFurthermore%2C%20I%20captured%20SWD%20communication%20waveforms%20with%20a%20logic%20analyzer%20during%20mass%20erase%20process%2C%20and%20the%20operation%20sequence%20is%20as%20below%3A%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3COL%3E%3CLI%3ERead%20MDM-AP%20Status%20%3D%200x34%3C%2FLI%3E%3CLI%3ERead%20MDM-AP%20Status%20%3D%200x36%3C%2FLI%3E%3CLI%3EWrite%20MDM-AP%20Control%20%3D%200x10%3C%2FLI%3E%3CLI%3EWrite%20MDM-AP%20Control%20%3D%200x01%3C%2FLI%3E%3CLI%3EWrite%20MDM-AP%20Control%20%3D%200x08%3C%2FLI%3E%3CLI%3ERead%20MDM-AP%20Status%20%3D%200x35%3C%2FLI%3E%3C%2FOL%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3ECould%20anyone%20kindly%20help%20analyze%20the%20possible%20reasons%20causing%20this%20programming%20and%20connection%20failure%3F%20Thank%20you%20very%20much.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2366641%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K142%20JLINK%20program%20failed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2366641%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EBianHaopeng1%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EDid%20you%20enable%20the%20CSEc%20module%20on%20your%20chip%20before%3F%3C%2FP%3E%0A%3CP%3EIf%20so%2C%20it%20cannot%20be%20directly%20erased%20using%20a%20mass%20eraser.%3C%2FP%3E%3C%2FLINGO-BODY%3E