Unable to Flash S32K118 Using J-Link via SWD

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

Unable to Flash S32K118 Using J-Link via SWD

2,258 Views
Panidiyan_T
Contributor I

Hi Team,

I’m currently working with the S32K118 microcontroller in a 48-LQFP package. I’m trying to flash the “hello_world” example code using S32 Design Studio for ARM v2.2 with a Segger J-Link via the SWD interface, but the flashing process is not successful.

I also created a new project in S32 Design Studio and attempted to flash it but encountered the same issue. Please find the attached screenshot showing the error that occurs during the flashing attempt.

Panidiyan_T_0-1748348610210.pngPanidiyan_T_1-1748348617716.pngPanidiyan_T_2-1748348624565.png

Connection Details:

  • PTA4 (Pin 48) – SWD_DIO with 10kΩ pull-up

  • PTC4 (Pin 46) – SWD_CLK (we tried with and without 10kΩ pull-down)

  • PTA5 (Pin 47) – RESET with 10kΩ pull-up (Also push button is connected between PTA5 and GND)

  • VDD (Pin 6) (All VDD pins (5, 6, 31) are shorted together)

  • GND (Pin 7) (All VSS pins (7, 30) are shorted together)


Then, when trying to connect using J-Link Commander (JLink.exe), the connection fails with the following output:


"  SEGGER J-Link Commander V7.98h (Compiled Sep 11 2024 14:32:20)
DLL version V7.98h, compiled Sep 11 2024 14:31:28

Connecting to J-Link via USB...O.K.
Firmware: J-Link V9 compiled Dec 13 2022 11:14:50
Hardware version: V9.70
J-Link uptime (since boot): N/A (Not supported by this model)
S/N: 69730370
License(s): RDI, GDB, FlashDL, FlashBP, JFlash
VTref=3.288V


Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: S32K118
Type '?' for selection dialog
Device>S32K118
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>1000 kHz
Device "S32K118" selected.


Connecting to target via SWD
ConfigTargetSettings() start
ConfigTargetSettings() end - Took 29us
InitTarget() start
SWD selected. Executing JTAG -> SWD switching sequence.
Connect Under Reset
SWD selected. Executing JTAG -> SWD switching sequence.
Communication error while accessing MDM-AP.
Connect Under Reset
InitTarget() end - Took 431ms
Connect failed. Resetting via Reset pin and trying again.
ConfigTargetSettings() start
ConfigTargetSettings() end - Took 23us
InitTarget() start
SWD selected. Executing JTAG -> SWD switching sequence.
Connect Under Reset
SWD selected. Executing JTAG -> SWD switching sequence.
Communication error while accessing MDM-AP.
Connect Under Reset
InitTarget() end - Took 429ms
Error occurred: Could not connect to the target device.
For troubleshooting steps visit: https://wiki.segger.com/J-Link_Troubleshooting
J-Link>  "

Could you please support me with the steps needed to resolve this issue?
Is there anything I might be missing in the connection or configuration? Please let me know if you need any additional information from my side.

Looking forward to your support.



Thanks & regards,
Pandiyan T.



0 Kudos
Reply
2 Replies

2,234 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

Please test with one of the recommended programmers for S32K1:

_Leo__1-1748388200900.png

If the issue persist, please submit a confidential ticket for schematic review.

Hope it helps you.

Have a nice day!

0 Kudos
Reply

2,207 Views
Panidiyan_T
Contributor I

Hi,

Thank you for your response.

I have now tried using the PE Micro LC and was able to establish a debugging session. However, I’m encountering a new issue during debugging. When running the example code, the debugger halts at the CLOCK_SYS_UpdateConfiguration function, and after stepping through, it ends up in the DefaultISR: interrupt handler. It then continuously loops there and does not proceed further.

Please see the attached images:

Image 1: Start of the debugging session.

Panidiyan_T_0-1748434478678.png

Image 2: After clicking "Step Over" (F6) or "Resume" (F8), it enters the DefaultISR: loop.

Panidiyan_T_1-1748434593059.png

Image 3: The debugger remains stuck in this loop and does not continue execution.

Panidiyan_T_2-1748434635431.png

Additionally, the console output during debugging shows the following message:
"""" onnection from "127.0.0.1" via 127.0.0.1. Connection from port "59344" to 6224
Connection from "127.0.0.1" via 127.0.0.1. Connection from port "59345" to 7224
Searching for FreeRTOS Kernel Symbols...
rsp_qC - qSymbol: 707843757272656E74544342
pxCurrentTCB not found. FreeRTOS analysis not enabled.
Copyright 2018 P&E Microcomputer Systems,Inc.
Command Line :C:\nxp\S32DS_ARM_v2.2\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_4.4.6.201912192052\win32\pegdbserver_console -device=NXP_S32K1xx_S32K118F256M4 -startserver -singlesession -serverport=7224 -gdbmiport=6224 -interface=USBMULTILINK -speed=54
P&E Interface detected - Flash Version 11.52

CMD>RE

Initializing.
Target has been RESET and is active.
CMD>CM C:\nxp\S32DS_ARM_v2.2\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_4.4.6.201912192052\win32\gdi\P&E\supportFiles_ARM\NXP\S32K1xx\freescale_s32k118f256m4_pflash_dflash_eeprom.arp

Initializing.
Initialized.

;version 1.01, 12/03/2019, Copyright 2019 P&E Microcomputer Systems, Inc. All rights reserved. www.pemicro.com [s32k118f256m4_x_pflash_dflash_eeprom_m0]

;device freescale, s32k118f256m4, pflash_dflash_eeprom

;begin_cs device=$00000000, length=$14000800, ram=$1FFFFC00

Loading programming algorithm ...
Done.
Programming sequency is : erase, blank check, program, and verify {default}
CMD>VC
Verifying object file CRC-16 to device ranges ...
block 00000000-000000BF ...
Calculated CRC-16 does not match block. (File = $785D, Device = $C9BC)
Current content of flash does not match application to be programmed

CMD>EM

Erasing.
Module has been erased.
Reloading programming algorithm ...
done.
CMD>PM

Programming.
Processing Object File Data ...


.
Programmed.
CMD>VC
Verifying object file CRC-16 to device ranges ...
block 00000000-000000BF ...
Ok.
block 00000400-00004813 ...
Ok.
Checksum Verification Successful. (Cumulative CRC-16=$7D03)

CMD>RE

Initializing.
Target has been RESET and is active.

Starting reset script (C:\nxp\S32DS_ARM_v2.2\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_4.4.6.201912192052\win32\gdi\P&E\supportFiles_ARM\NXP\S32K1xx\S32K118F256M4.mac) ...
Filling .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
done

Reset script (C:\nxp\S32DS_ARM_v2.2\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_4.4.6.201912192052\win32\gdi\P&E\supportFiles_ARM\NXP\S32K1xx\S32K118F256M4.mac) completed.    """""

 

Could you please help me resolve this issue? Let me know if you need any further details or logs from my side.

I’m looking forward to your support.

Thanks and regards,
Pandiyan T.

0 Kudos
Reply