Hi Lutz,
I have similar scenario:
text data bss dec hex filename
113128 8192 15592 136912 MTRDEVKSPNK144_S32DS.elf
Full segger debug console output:
SEGGER J-Link GDB Server V6.22e Command Line Version
JLinkARM.dll V6.22e (DLL compiled Jan 8 2018 11:44:25)
Command line: -if swd -device S32K144 -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
-----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: S32K144
Target interface: SWD
Target interface speed: 1000kHz
Target endian: little
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link Lite-Cortex-M V8 compiled Sep 15 2016 12:05:01
Hardware: V8.00
S/N: 398000830
OEM: IAR
Checking target voltage...
Target voltage: 4.98 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x20007000)
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 = 0x00000410)
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= 20007000, MSP= 20007000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 00000410
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x00000410 (Data = 0x490BB672)
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 BKPT)
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
ERROR: Failed to measure CPU clock frequency: second loop count is less than first one! (176<=10618)
Failed to enable SWO. Could not measure target CPU frequency.
Read 4 bytes @ address 0x00000410 (Data = 0x490BB672)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x00000410)
Downloading 1024 bytes @ address 0x00000000 - Verified OK
Downloading 16 bytes @ address 0x00000400 - Verified OK
Downloading 4096 bytes @ address 0x00000410 - Verified OK
Downloading 4096 bytes @ address 0x00001410 - Verified OK
Downloading 4096 bytes @ address 0x00002410 - Verified OK
Downloading 4096 bytes @ address 0x00003410 - Verified OK
Downloading 4096 bytes @ address 0x00004410 - Verified OK
Downloading 4096 bytes @ address 0x00005410 - Verified OK
Downloading 4096 bytes @ address 0x00006410 - Verified OK
Downloading 4096 bytes @ address 0x00007410 - Verified OK
Downloading 4096 bytes @ address 0x00008410 - Verified OK
Downloading 4096 bytes @ address 0x00009410 - Verified OK
Downloading 4096 bytes @ address 0x0000A410 - Verified OK
Downloading 4096 bytes @ address 0x0000B410 - Verified OK
Downloading 4096 bytes @ address 0x0000C410 - Verified OK
Downloading 4096 bytes @ address 0x0000D410 - Verified OK
Downloading 4096 bytes @ address 0x0000E410 - Verified OK
Downloading 4096 bytes @ address 0x0000F410 - Verified OK
Downloading 4096 bytes @ address 0x00010410 - Verified OK
Downloading 4096 bytes @ address 0x00011410 - Verified OK
Downloading 4096 bytes @ address 0x00012410 - Verified OK
Downloading 4096 bytes @ address 0x00013410 - Verified OK
Downloading 4096 bytes @ address 0x00014410 - Verified OK
Downloading 4096 bytes @ address 0x00015410 - Verified OK
Downloading 4096 bytes @ address 0x00016410 - Verified OK
Downloading 4096 bytes @ address 0x00017410 - Verified OK
Downloading 4096 bytes @ address 0x00018410 - Verified OK
Downloading 4096 bytes @ address 0x00019410 - Verified OK
Downloading 4096 bytes @ address 0x0001A410 - Verified OK
Downloading 1488 bytes @ address 0x0001B410 - Verified OK
Downloading 8 bytes @ address 0x0001B9E0 - Verified OK
Downloading 4096 bytes @ address 0x0001B9E8 - Verified OK
Downloading 4096 bytes @ address 0x0001C9E8 - Verified OK
Read 4 bytes @ address 0x00000410 (Data = 0x490BB672)
Read 2 bytes @ address 0x00004486 (Data = 0xF001)
Read 2 bytes @ address 0x00004486 (Data = 0xF001)
Read 2 bytes @ address 0x00004486 (Data = 0xF001)
Received monitor command: regs
Comparing flash [....................] Done.
Erasing flash [....................] Done.
Programming flash [....................] Done.
Verifying flash [....................] Done.
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= 20007000, MSP= 20007000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 00000410
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x00000410 (Data = 0x490BB672)
Setting breakpoint @ address 0x00004486, Size = 2, BPHandle = 0x0001
Starting target CPU...
...Breakpoint reached @ address 0x00004486
Reading all registers
Read 4 bytes @ address 0x00004486 (Data = 0xFFF9F001)
Removing breakpoint @ address 0x00004486, Size = 2
Reading 64 bytes @ address 0x00004480
Reading 64 bytes @ address 0x000044C0
Read 4 bytes @ address 0x20006FFC (Data = 0x0000043D)
Read 4 bytes @ address 0x20006FFC (Data = 0x0000043D)
Read 4 bytes @ address 0x0000043C (Data = 0x0000E7FE)
Read 4 bytes @ address 0x20006FFC (Data = 0x0000043D)
Read 2 bytes @ address 0x00000410 (Data = 0xB672)
Read 2 bytes @ address 0x00000412 (Data = 0x490B)
Read 4 bytes @ address 0x00000442 (Data = 0x70000000)
Read 2 bytes @ address 0x00000414 (Data = 0x4A0A)
Read 4 bytes @ address 0x00000440 (Data = 0x00000000)
Read 2 bytes @ address 0x00000416 (Data = 0x4B0A)
Read 4 bytes @ address 0x00000442 (Data = 0x70000000)
Read 2 bytes @ address 0x00000418 (Data = 0x4C09)
Read 4 bytes @ address 0x00000440 (Data = 0x00000000)
Read 2 bytes @ address 0x0000041A (Data = 0x4D09)
Read 4 bytes @ address 0x00000442 (Data = 0x70000000)
Read 2 bytes @ address 0x0000041C (Data = 0x4E08)
Read 4 bytes @ address 0x00000440 (Data = 0x00000000)
Read 2 bytes @ address 0x0000041E (Data = 0x4F08)
Read 4 bytes @ address 0x00000442 (Data = 0x70000000)
Read 2 bytes @ address 0x00000420 (Data = 0x46B8)
Read 2 bytes @ address 0x00000422 (Data = 0x46B9)
Read 2 bytes @ address 0x00000424 (Data = 0x46BA)
Read 2 bytes @ address 0x00000426 (Data = 0x46BB)
Read 2 bytes @ address 0x00000428 (Data = 0x46BC)
Read 2 bytes @ address 0x0000042A (Data = 0x4806)
Read 4 bytes @ address 0x00000446 (Data = 0x2A212000)
Read 2 bytes @ address 0x0000042C (Data = 0x4685)
Read 2 bytes @ address 0x0000042E (Data = 0x4806)
Read 4 bytes @ address 0x0000044A (Data = 0x29110001)
Read 2 bytes @ address 0x00000430 (Data = 0x4780)
Read 4 bytes @ address 0x20006FF4 (Data = 0x00000100)
Read 1 bytes @ address 0x20006FF2 (Data = 0xFF)
Read 1 bytes @ address 0x20006FF3 (Data = 0x1F)
Read 4 bytes @ address 0x20006FF4 (Data = 0x00000100)
Read 1 bytes @ address 0x20006FF2 (Data = 0xFF)
Read 1 bytes @ address 0x20006FF3 (Data = 0x1F)
So, I can't reproduce your issue.
actually - the issue looks related to segger plugin/firmware/connection. I found this thread - [SOLVED] Remote failure reply ... - J-Link/Flasher related - SEGGER - Forum
segger team recommends update firmware to version 6.32b. But mine is old one - 6.22e and works okay.
Jiri