AnsweredAssumed Answered

Unable to flash Kinetis S9KEAZN8 using Segger J-Link

Question asked by Egon Carusi on Mar 14, 2016
Latest reply on Mar 17, 2016 by Egon Carusi

Hello,

I'm moving the firmware from the evalboard (TRK-KEA8) to the prototype. Since I already own a Segger J-Link and it' s stated as compatible with the device I setup everything needed to use it.

KDS version is: 3.0.0

 

After choosing the proper KDS debug profile and clicking the debug button I see the connection is properly esablished. The flashing fails with the log attached below.

 

Manually accessing the flash shows no sign of the firmware. Manually accessing the RAM shows data and manual changes are properly reflected (no connection problem IMHO).

 

I tried several clock speed combinations with the same result.

 

Thanks for any help provided.

 

 

 

SEGGER J-Link GDB Server V5.10s Command Line Version

 

JLinkARM.dll V5.10s (DLL compiled Mar  9 2016 18:51:10)

 

-----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:                 SKEAZN8xxx4

Target interface:              SWD

Target interface speed:        1000kHz

Target endian:                 little

 

 

Connecting to J-Link...

J-Link is connected.

Firmware: J-Link V9 compiled Mar  8 2016 11:12:56

Hardware: V9.30

S/N: 269307704

OEM: SEGGER-EDU

Feature(s): FlashBP, GDB

Checking target voltage...

Target voltage: 4.74 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 = 0xFFFFFFFF)

Target interface speed set to 1000 kHz

Resetting target

Halting target CPU...

...Target halted (PC = 0xFFFFFFFE)

R0 = 0400C803, R1 = 8880513C, R2 = 42042008, R3 = 00408071

R4 = A0E16000, R5 = 04070941, R6 = 60280A02, R7 = 05881800

R8 = 17001433, R9 = 88411605, R10= 10D66100, R11= 88A02589

R12= C884E0A0, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 20090048

R14(LR) = FFFFFFF9, R15(PC) = FFFFFFFE

XPSR 81000000, APSR 80000000, EPSR 01000000, IPSR 00000000

CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

Reading all registers

Select auto target interface speed (2000 kHz)

Flash breakpoints enabled

Semi-hosting enabled (Handle on BKPT)

Semihosting I/O set to TELNET Client

SWO disabled succesfully.

WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.

SWO enabled succesfully.

Downloading 192 bytes @ address 0x00000000 - Verified OK

Downloading 16 bytes @ address 0x00000400 - Verified OK

Downloading 4652 bytes @ address 0x00000410 - Verified OK

Downloading 8 bytes @ address 0x0000163C - Verified OK

Downloading 4 bytes @ address 0x00001644 - Verified OK

Downloading 4 bytes @ address 0x00001648 - Verified OK

Downloading 104 bytes @ address 0x0000164C - Verified OK

ERROR: Failed to measure CPU clock frequency

Failed to measure CPU clock frequency: second loop count is less than first one! (67160067<=67160067)

 

 

Writing register (PC = 0x000004e8)

Read 4 bytes @ address 0x000004E8 (Data = 0xFFFFFFFF)

Read 2 bytes @ address 0x000006EC (Data = 0xFFFF)

Read 2 bytes @ address 0x000006EC (Data = 0xFFFF)

Resetting target

Halting target CPU...

...Target halted (PC = 0xFFFFFFFE)

Read 2 bytes @ address 0x000006EC (Data = 0xFFFF)

Read 2 bytes @ address 0x000006EC (Data = 0xFFFF)

Read 2 bytes @ address 0x000006EC (Data = 0xFFFF)

R0 = 0400C803, R1 = 8880513C, R2 = 42042008, R3 = 00408071

R4 = A0E16000, R5 = 04070941, R6 = 60280A02, R7 = 05881800

R8 = 17001433, R9 = 88411605, R10= 10D66100, R11= 88A02589

R12= C884E0A0, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 20090048

R14(LR) = FFFFFFF9, R15(PC) = FFFFFFFE

XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000

CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

Reading all registers

WARNING: Failed to read memory @ address 0xFFFFFFFE

Setting breakpoint @ address 0x000006EC, Size = 2, BPHandle = 0x0001

Starting target CPU...

...Target halted (DBGRQ, PC = 0xFFFFFFFE)

Reading all registers

Removing breakpoint @ address 0x000006EC, Size = 2

WARNING: Failed to read memory @ address 0xFFFFFFFE

WARNING: Failed to read memory @ address 0xFFFFFFF4

Reading 64 bytes @ address 0xFFFFFFC0

WARNING: Failed to read memory @ address 0xFFFFFFC0

Reading 64 bytes @ address 0xFFFFFFC0

WARNING: Failed to read memory @ address 0xFFFFFFC0

Outcomes