S32K358 Eval Board Flash via JTAG Not Working

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

S32K358 Eval Board Flash via JTAG Not Working

Jump to solution
1,063 Views
AnteoJ
Contributor III

When I try to flash an example project for the S32K358 Eval Board using JTAG, the console always stops and gets stuck on "Starting target CPU...". Bellow is my full console output when running the Siul2_Dio_Ip_Example_S32K358 on S32DS for S32 Platform 3.5. 

SEGGER J-Link GDB Server V8.12a Command Line Version

JLinkARM.dll V8.12a (DLL compiled Jan 9 2025 14:38:21)

Command line: -if swd -device S32K358_M7_0 -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui -speed 100
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: localhost only
Generate logfile: off
Verify download: on
Init regs on start: on
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: S32K358_M7_0
Target device parameters: none
Target interface: SWD
Target interface speed: 100kHz
Target endian: little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V12 compiled Dec 4 2024 17:53:50
Hardware: V12.00
S/N: 52010335
Feature(s): GDB
Checking target voltage...
Target voltage: 4.92 V
Listening on TCP/IP port 2331
Connecting to target...
Initializing CPU registers...Connected to target
Waiting for GDB connection...Connected to 0000:0000:0000:0000:0000:0000:0000:0001
GDB client (conn. 876) requested target.xml from GDB Server
Reading common registers: Read register 'r0' (4 bytes) from hardware: 0x00000000
Read register 'r1' (4 bytes) from hardware: 0x00000000
Read register 'r2' (4 bytes) from hardware: 0x00000000
Read register 'r3' (4 bytes) from hardware: 0x00000000
Read register 'r4' (4 bytes) from hardware: 0x00000000
Read register 'r5' (4 bytes) from hardware: 0x00000000
Read register 'r6' (4 bytes) from hardware: 0x00000000
Read register 'r7' (4 bytes) from hardware: 0x00000000
Read register 'r8' (4 bytes) from hardware: 0x00000000
Read register 'r9' (4 bytes) from hardware: 0x00000000
Read register 'r10' (4 bytes) from hardware: 0x00000000
Read register 'r11' (4 bytes) from hardware: 0x00000000
Read register 'r12' (4 bytes) from hardware: 0x00000000
Read register 'sp' (4 bytes) from hardware: 0x00000000
Read register 'lr' (4 bytes) from hardware: 0x00000000
Read register 'pc' (4 bytes) from hardware: 0x00000000
Read register 'xpsr' (4 bytes) from hardware: 0x00000001
Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
Read 2 bytes @ address 0x00000000 (Data = 0x0000)
Received monitor command: speed 1000
Target interface speed set to 1000 kHz
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x00400C20)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20020000, MSP= 20020000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 00400C20
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

Security extension regs:
MSP_S = 00000000, MSPLIM_S = 00000000
PSP_S = 00000000, PSPLIM_S = 00000000
MSP_NS = 20020000, MSPLIM_NS = 00000000
PSP_NS = 00000000, PSPLIM_NS = 00000000
CONTROL_S 00, FAULTMASK_S 00, BASEPRI_S 00, PRIMASK_S 00
CONTROL_NS 00, FAULTMASK_NS 00, BASEPRI_NS 00, PRIMASK_NS 00

Reading common registers: Read register 'r0' (4 bytes) from hardware: 0x00000000
Read register 'r1' (4 bytes) from hardware: 0x00000000
Read register 'r2' (4 bytes) from hardware: 0x00000000
Read register 'r3' (4 bytes) from hardware: 0x00000000
Read register 'r4' (4 bytes) from hardware: 0x00000000
Read register 'r5' (4 bytes) from hardware: 0x00000000
Read register 'r6' (4 bytes) from hardware: 0x00000000
Read register 'r7' (4 bytes) from hardware: 0x00000000
Read register 'r8' (4 bytes) from hardware: 0x00000000
Read register 'r9' (4 bytes) from hardware: 0x00000000
Read register 'r10' (4 bytes) from hardware: 0x00000000
Read register 'r11' (4 bytes) from hardware: 0x00000000
Read register 'r12' (4 bytes) from hardware: 0x00000000
Read register 'sp' (4 bytes) from hardware: 0x00000220
Read register 'lr' (4 bytes) from hardware: 0xFFFFFFFF
Read register 'pc' (4 bytes) from hardware: 0x200C4000
Read register 'xpsr' (4 bytes) from hardware: 0x00000001
Received monitor command: speed auto
Select auto target interface speed (2000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (Handle on breakpoint instruction hit)
Received monitor command: semihosting IOClient 1
Semihosting I/O set to TELNET Client
Received monitor command: SWO DisableTarget 0xFFFFFFFF
SWO disabled successfully.
Received monitor command: SWO EnableTarget 0 0 0x1 0
SWO enabled successfully.
Downloading 16208 bytes @ address 0x00400000 - Verified OK
Downloading 9036 bytes @ address 0x00403F50 - Verified OK
Downloading 152 bytes @ address 0x0040629C - Verified OK
Downloading 4 bytes @ address 0x00406334 - Verified OK
Read 4 bytes @ address 0x00400C20 (Data = 0xF04FB672)
Read 2 bytes @ address 0x00400C20 (Data = 0xB672)
Read 2 bytes @ address 0x00400DFC (Data = 0xB5F8)
Received monitor command: clrbp
Received monitor command: reset
Comparing flash [....................] Done.
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x00400C20)
Read 2 bytes @ address 0x00400DFC (Data = 0xB5F8)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20020000, MSP= 20020000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 00400C20
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

Security extension regs:
MSP_S = 00000000, MSPLIM_S = 00000000
PSP_S = 00000000, PSPLIM_S = 00000000
MSP_NS = 20020000, MSPLIM_NS = 00000000
PSP_NS = 00000000, PSPLIM_NS = 00000000
CONTROL_S 00, FAULTMASK_S 00, BASEPRI_S 00, PRIMASK_S 00
CONTROL_NS 00, FAULTMASK_NS 00, BASEPRI_NS 00, PRIMASK_NS 00

Reading common registers: Read register 'r0' (4 bytes) from hardware: 0x00000000
Read register 'r1' (4 bytes) from hardware: 0x00000000
Read register 'r2' (4 bytes) from hardware: 0x00000000
Read register 'r3' (4 bytes) from hardware: 0x00000000
Read register 'r4' (4 bytes) from hardware: 0x00000000
Read register 'r5' (4 bytes) from hardware: 0x00000000
Read register 'r6' (4 bytes) from hardware: 0x00000000
Read register 'r7' (4 bytes) from hardware: 0x00000000
Read register 'r8' (4 bytes) from hardware: 0x00000000
Read register 'r9' (4 bytes) from hardware: 0x00000000
Read register 'r10' (4 bytes) from hardware: 0x00000000
Read register 'r11' (4 bytes) from hardware: 0x00000000
Read register 'r12' (4 bytes) from hardware: 0x00000000
Read register 'sp' (4 bytes) from hardware: 0x00000220
Read register 'lr' (4 bytes) from hardware: 0xFFFFFFFF
Read register 'pc' (4 bytes) from hardware: 0x200C4000
Read register 'xpsr' (4 bytes) from hardware: 0x00000001
Setting breakpoint @ address 0x00400DFC, Kind = 2, Type = THUMB, BPHandle = 0x0001
Starting target CPU...
...Breakpoint (set by 'GDB') reached @ address 0x00400DFC
Reading common registers: Read register 'r0' (4 bytes) from hardware: 0x03000000
Read register 'r1' (4 bytes) from hardware: 0xFFFFFFFF
Read register 'r2' (4 bytes) from hardware: 0x00020700
Read register 'r3' (4 bytes) from hardware: 0x00E000E0
Read register 'r4' (4 bytes) from hardware: 0x00000000
Read register 'r5' (4 bytes) from hardware: 0x00000000
Read register 'r6' (4 bytes) from hardware: 0x00000000
Read register 'r7' (4 bytes) from hardware: 0x00000000
Read register 'r8' (4 bytes) from hardware: 0x00000000
Read register 'r9' (4 bytes) from hardware: 0x00000000
Read register 'r10' (4 bytes) from hardware: 0x00000000
Read register 'r11' (4 bytes) from hardware: 0x00000000
Read register 'r12' (4 bytes) from hardware: 0x00000000
Read register 'sp' (4 bytes) from hardware: 0x00000220
Read register 'lr' (4 bytes) from hardware: 0x8D0D4000
Read register 'pc' (4 bytes) from hardware: 0xFC0D4000
Read register 'xpsr' (4 bytes) from hardware: 0x00000061
Removing breakpoint @ address 0x00400DFC, Size = 2
Read 4 bytes @ address 0x00400DFC (Data = 0x4817B5F8)
Read 4 bytes @ address 0x00400DFC (Data = 0x4817B5F8)
Read 4 bytes @ address 0x00400DFC (Data = 0x4817B5F8)
Read 4 bytes @ address 0x00400DFC (Data = 0x4817B5F8)
Starting target CPU...

0 Kudos
Reply
1 Solution
835 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Which example did you test?
I can use Segger J-Link Plus to debug Siul2_Port_Ip_Example_S32K358 in S32DS v3.5 + S32K3 RTD 5.0.0 and S32DS v3.6 + S32K3 RTD 6.0.0.
Sorry, I am not familiar with Segger J-Link. Although I also see Starting target CPU..., the program can run normally.
It is recommended to download the latest JLink_Windows_V850_x86_64.exe and specify C:\Program Files\SEGGER\JLink_V850\JLinkGDBServerCL.exe in Executable. Can it be debugged without errors?

View solution in original post

0 Kudos
Reply
11 Replies
988 Views
AnteoJ
Contributor III

Hi Robin. I am using this setup. The problem does not seem to be the JLink setup. My jlink has been connecting. The problem I am running into is that when I attempt to run the program, it gets stuck on "Starting target CPU..." and does not seem to end/complete running. As seen in my original post, the device connects to the jlink, although once I resume or continue the debug/run, the console gets stuck on "Starting target cpu...". This does not happen when I run using the onboard debugger. 

0 Kudos
Reply
904 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Have you updated the Segger software? I also suggest you contact Segger's technical support.

0 Kudos
Reply
860 Views
AnteoJ
Contributor III
I believe I have found a solution using Jlink Commander and the loadfile command.
0 Kudos
Reply
848 Views
AnteoJ
Contributor III
I have found that the program is flashing, but the default example program hangs and a hard fault occurs.
0 Kudos
Reply
836 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Which example did you test?
I can use Segger J-Link Plus to debug Siul2_Port_Ip_Example_S32K358 in S32DS v3.5 + S32K3 RTD 5.0.0 and S32DS v3.6 + S32K3 RTD 6.0.0.
Sorry, I am not familiar with Segger J-Link. Although I also see Starting target CPU..., the program can run normally.
It is recommended to download the latest JLink_Windows_V850_x86_64.exe and specify C:\Program Files\SEGGER\JLink_V850\JLinkGDBServerCL.exe in Executable. Can it be debugged without errors?

0 Kudos
Reply
829 Views
AnteoJ
Contributor III

Hi robin, its now working after restarting with a new project. Not sure what changed as I used the same config as before, but the program is now successfully running while showing "starting target cpu" in the debug console. Thank you for all of your help!

0 Kudos
Reply
969 Views
AnteoJ
Contributor III

Hi - thank you for the help. I am also able to get to this exact point successfully, except I am using S32DS 3.5, the 20 Pin ARM connector, and the S32K358_M7_0 as my device name. When I try to run the program, or if debugging, resume the debugger, the program reads "Starting target CPU..." and does not seem to end/complete running. 

I am unable to see any LED toggle on the eval board. I made no changes to the default example program.

0 Kudos
Reply
963 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Sorry for the wrong Device Name in my last reply.(https://www.segger.com/supported-devices/nxp/s32k3)

This time I tried to use J365 (20-pin ARM standard JTAG connector), please refer to the configuration in S32DS v3.5 below:

Segger J-Link Debugger S32K3X8EVB-Q289 S32DS v3.5.png

0 Kudos
Reply
996 Views
AnteoJ
Contributor III

Hi. Thank you for the reply. I am using the S32K3X8EVB-Q289. The white sticker codes are SCH-54870 REV C, 700-54870 REV A, and AX242875958. I did briefly look at the guidelines and I was able to upload and debug the example code via the onboard PE Debugger. I am now trying to figure out how to get JTAG to do the same, as long term I hope to program via JTAG on our custom S32K358 boards. 

0 Kudos
Reply
976 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

I am able to debug SCH-54870 REV B2 through J50 (20-Pin Cortex Debug + ETM Connector).

Segger J-Link S32K3X8EVB-Q289.png

Segger J-Link Debugger S32K3X8EVB-Q289.png

 

0 Kudos
Reply
1,001 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Are you using the S32K3X8EVB-Q289 board?
Please tell me the SCH version of the white sticker.
I don't have a Segger J-Link to test with today.
Did you follow the 3.2 Plug In the Power Supply step in Getting Started with the S32K3X8EVB-Q289 Evaluation Board for General Purpose to power on the board?(Note: This power-up procedure manages that FS23 SBC starts with a disabled watchdog.)
Have you downloaded a program using the onboard debugger?


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply