Kinetis KL27Z "timeout while unsecuring device"

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Kinetis KL27Z "timeout while unsecuring device"

    Hello
    I'm having a lot of trouble programming a Kinetis KL27Z128 and KL26Z128 ;(
    I'm using KDS300/Eclipse with the J-LINK.
    It was all working well with development of a board using KL26Z before Aug 16th - then with a new board revsion I did an KDS300/Help/"Check for Updates" and had problems with the segger interface, which I found was this issue
    community.freescale.com/thread/363937

    I think I cured it by updating the plugins.zip as described by Erich Styger Aug7th


    However then still had problems with KDS300/JLinkGDBServerCL "timing while .." out on the new KL26Z boards I had built. ?(
    I re-installed KDS300 but still problems. I assumed the KL26Z128 was bricked, so built my last board with a KL27128 and it has had "timeout while unsecuring device" problems :cursing:
    I've upgraded the J-Link to 501kbeta, and tried this
    JLink.exe -if SWD -device MKL27Z128XXX4 -speed 1000
    as per other discussions on the forums here, and still has "timeout while.." X(

    However on trying again today, something has started working, :P
    but its unreliable, and while sometimes works at the JLINK> then has "timeout ..." when invoked from KDS/JLinkGDBServerCL
    It did actually program the KL27Z with the blinkey flasher - as the board now flashes its led. 8o
    However it can't do it reliably.
    Here is the output listing after
    JLink.exe -if SWD -device MKL27Z128XXX4 -speed 1000

    SEGGER J-Link Commander V5.01k ('?' for help)
    Compiled Aug 26 2015 19:07:42
    Info: Device "MKL27Z128XXX4" selected.
    DLL version V5.01k, compiled Aug 26 2015 19:07:05
    Firmware: J-Link V9 compiled Aug 26 2015 14:41:56
    Hardware: V9.30
    S/N: 269301016
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    Emulator has Trace capability
    VTarget = 3.172V
    Info: Found SWD-DP with ID 0x0BC11477

    ****** Error: Kinetis (connect): Timeout while unsecuring
    device. Erase never starts.



    Kinetis (connect): Failed to unsecure Kinetis device.
    Info: Found SWD-DP with ID 0x0BC11477

    ****** Error: Kinetis (connect): Timeout while unsecuring
    device. Erase never starts.

    Kinetis (connect): Failed to unsecure Kinetis device.
    Can not connect to target.
    Failed to identify target. Trying again with slow (4 kHz)
    speed.

    Info: Found SWD-DP with ID 0x0BC11477

    ****** Error: Kinetis (connect): Timeout while unsecuring
    device. Erase never starts.

    Kinetis (connect): Failed to unsecure Kinetis device.
    Info: Found SWD-DP with ID 0x0BC11477

    ****** Error: Kinetis (connect): Timeout while unsecuring
    device. Erase never starts.

    Kinetis (connect): Failed to unsecure Kinetis device.
    Info: Found Cortex-M0 r0p1, Little endian.
    Info: FPUnit: 2 code (BP) slots and 0 literal slots
    Info: CoreSight components:
    Info: ROMTbl 0 @ F0002000
    Info: ROMTbl 0 [0]: FFFFE000, CID: B105900D, PID: 001BB932
    MTB-M0+

    Info: ROMTbl 0 [1]: FFFFF000, CID: B105900D, PID: 0008E000
    MTBDWT

    Info: ROMTbl 0 [2]: F00FD000, CID: B105100D, PID: 000BB4C0
    ROM Table

    Info: ROMTbl 1 @ E00FF000
    Info: ROMTbl 1 [0]: FFF0F000, CID: B105E00D, PID: 000BB008
    SCS

    Info: ROMTbl 1 [1]: FFF02000, CID: B105E00D, PID: 000BB00A
    DWT

    Info: ROMTbl 1 [2]: FFF03000, CID: B105E00D, PID: 000BB00B
    FPB



    Can not connect to target.
    No device found at all. Selecting JTAG as default target
    interface.




    J-Link>si 1
    Selecting SWD as current target interface.
    Setting target interface speed to 1MHz. Use
    "Speed" to change.


    J-Link>device MKL27Z128XXX4
    Info: Device "MKL27Z128XXX4" selected.
    Reconnecting to target...
    Info: Found SWD-DP with ID 0x0BC11477
    Info: Found SWD-DP with ID 0x0BC11477
    Info: Found Cortex-M0 r0p1, Little endian.
    Info: FPUnit: 2 code (BP) slots and 0 literal slots
    Info: CoreSight components:
    Info: ROMTbl 0 @ F0002000
    Info: ROMTbl 0 [0]: FFFFE000, CID: B105900D, PID: 001BB932
    MTB-M0+

    Info: ROMTbl 0 [1]: FFFFF000, CID: B105900D, PID: 0008E000
    MTBDWT

    Info: ROMTbl 0 [2]: F00FD000, CID: B105100D, PID: 000BB4C0
    ROM Table

    Info: ROMTbl 1 @ E00FF000
    Info: ROMTbl 1 [0]: FFF0F000, CID: B105E00D, PID: 000BB008
    SCS

    Info: ROMTbl 1 [1]: FFF02000, CID: B105E00D, PID: 000BB00A
    DWT

    Info: ROMTbl 1 [2]: FFF03000, CID: B105E00D, PID: 000BB00B
    FPB



    J-Link>mem 400 10
    00000400 = FF FF FF FF FF FF FF FF FF FF FF FF FE FF FF FF
    J-Link>unlock Kinetis
    Unlocking device...O.K.
    J-Link>

    Now then I exit J-LINK and try KDS300/JLink and here is the output

    JLinkARM.dll V5.01k (DLL compiled Aug 26 2015 19:07:05)


    -----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: MKL27Z128xxx4
    Target interface: SWD
    Target interface speed: 1000kHz
    Target endian: little


    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link V9 compiled Aug 26 2015 14:41:56
    Hardware: V9.30
    S/N: 269301016
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    Checking target voltage...
    Target voltage: 3.20 V
    Listening on TCP/IP port 2331
    Connecting to target...ERROR: Kinetis (connect): Timeout while unsecuring device. Erase never starts.
    Kinetis (connect): Failed to unsecure Kinetis device.
    ERROR: Could not connect to target.
    Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
    Shutting down..
    .


    At some point it did program the KL27Z flash as it now blinks the leds.
    Any help appreciated on getting it working again.?(

    The post was edited 1 time, last by neilh20 ().

  • Hello,

    We are not aware of this behavior. Do you use custom hardware of an evaluation board? We will check if we can reproduce it here. Keep you posted.


    - Erik
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Yes
    I'm designing a custom board.
    The first revision using the MKL26Z128VFT4
    connected no problem with the J-LINK, so I was able to verify that they worked together.
    The 2nd revision PCB has had major "Timeout while unsecuring"
    I had 3 PCBS, and built two with the MKL26Z . Both had continuously cycling through reset pulses - indicating I guess that the J-Link can't control it, as it powers up, has no program so the watchdog kicks in and resets the board. The reset pulse is monitorable.
    The J-LInk can access basic registers - so it appears to be functional at the hardware level.

    I created a blinkey program, checked it on a FRDM-KL27Z with a Debug_PNE USB OpenSDA to the FRDM-KL27Z, then modified the LED ports for my custom board.
    I built the last PCB prototype board with the MKL27Z128 and it has also had "Timeout ..."

    The MKL27Z has a KBOOT in rom, and I've been able to establish a linkage with the USB KBOOT to Win8.1 - so the KL27Zprocessor is running
    Yesterday the J-LINK did seem able to program the MKL27Z as a small test blinkey program started running without the J-LINK attached.
    I logged the trace in the above message to see if there was any clues that I missed.
    One post suggested that JLink by trying all the combinations of JTAG/SWD/FINE could be confusing the chip - so I've tried locking in JLINK.exe and JLinkGDBServerCL to known values.
    JLink.exe -if SWD -device MKL27Z128XXX4 -speed 1000

    which seems to work for JLINK,
    but I don't seem to be able to duplicate it with JLinkGDBServerCL


    regards
  • Hi,
    I saw that V5.02 was released from an email on mcuOnEclipse.org.
    I've installed it and tried the basic connection , but still same "Timeout while..."


    "C:\Program Files (x86)\SEGGER\JLink_V502\JLINK" -if SWD -device MKL27Z128XXX4 -speed 1000
    SEGGER J-Link Commander V5.02 ('?' for help)
    Compiled Aug 28 2015 19:41:33
    Info: Device "MKL27Z128XXX4" selected.
    DLL version V5.02, compiled Aug 28 2015 19:41:08
    Firmware: J-Link V9 compiled Aug 28 2015 17:49:48
    Hardware: V9.30
    S/N: 269301016
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    Emulator has Trace capability
    VTarget = 3.209V
    Info: Found SWD-DP with ID 0x0BC11477

    ****** Error: Kinetis (connect): Timeout while unsecuring device. Erase never starts.
    Kinetis (connect): Failed to unsecure Kinetis device.
    Info: Found SWD-DP with ID 0x0BC11477

    ****** Error: Kinetis (connect): Timeout while unsecuring device. Erase never starts.
    Kinetis (connect): Failed to unsecure Kinetis device.
    Can not connect to target.
    Failed to identify target. Trying again with slow (4 kHz) speed.
    Info: Found SWD-DP with ID 0x0BC11477

    ****** Error: Kinetis (connect): Timeout while unsecuring device. Erase never starts.
    Kinetis (connect): Failed to unsecure Kinetis device.
    Info: Found SWD-DP with ID 0x0BC11477

    ****** Error: Kinetis (connect): Timeout while unsecuring device. Erase never starts.
    Kinetis (connect): Failed to unsecure Kinetis device.
    Can not connect to target.
    No device found at all. Selecting JTAG as default target interface.
    J-Link>
  • Hello,

    we have tried to reproduce the issue with an
    FRDM-KL27Z evaluation board and we have not found any wrong behavior. We have many customers using this chip without any problems, so we think there might be a hardware related problem with your custom board.
    Can you reproduce the errors with an evaluation board? If yes, please post us the corresponding output.
    If you do like to measure SWD with a scope and send us a screenshot we would be appreciated to have a look on this.

    Best regards,
    Roman