JLinkGDBServer cann't halt cpu sometimes

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

  • JLinkGDBServer cann't halt cpu sometimes

    Hi,
    I'm using GDB+JLinkGDBServer in scripts for automatically downloading and running programs on Freescale's MK60N512 target board.
    normally we want to download and run dozens of programs, and I noticed after every FOUR successfully download/running, JLinkGDBServer failed to halt target cpu for three times.
    for example, the following command:

    for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
    ./run_scripts.sh ...
    done

    the run_scripts.sh will start GDB and JLinkGDBServer to do the download/run work then quit GDB and kill JlinkGDBServer and repeat over and over again. as I said it will succeed at 0/1/2/3 and 7/8/9/10 and 14/15, and it will fail at 4/5/6 and 11/12/13 times, as far as experiments I have done.

    I am a little confused about this issue, Any suggestions? Thanks very much.

    BTW, I am using Windows7+Cygwin and The failed JLink's log is like following:

    ------------------------------------------------
    SEGGER J-Link GDB Server V4.28c LogFile
    Logging started @ 2011-07-25 18:28
    03-00-00000015-001D: Listening on TCP/IP port 2331
    02-00-00000018-0035: Firmware: J-Link ARM V8 compiled Jul 1 2011 12:02:49
    02-00-00000018-000F: Hardware: V8.00
    02-00-00000018-000D: S/N: 68000222
    02-00-00000133-0033: OEM: J-Link-CE returns O.K. (0131ms, 0000ms total)
    02-00-00000133-0068: T1448 000:134 JLINK_ExecCommand("SetFlashRewriteBehavior = 1", ...) returns 0x00 (0000ms, 0131ms total)
    02-00-00000133-004D: T1448 000:134 JLINK_ExecCommand("", ...) returns 0x00 (0000ms, 0131ms total)
    02-00-00000134-004C: T1448 000:135 JLINK_SelectUSB(Port = 0) returns 0x00 (0000ms, 0132ms total)
    02-00-00000134-0056: T1448 000:135 JLINK_TIF_Select(JLINKARM_TIF_JTAG) returns 0x00 (0000ms, 0132ms total)
    02-00-00000134-004A: T1448 000:135 JLINK_EMU_IsConnected() returns TRUE (0000ms, 0132ms total)
    02-00-00000134-004B: T1448 000:135 JLINK_ConfigJTAG(IRPre = 0, DRPre = 0) (0000ms, 0132ms total)
    02-00-00000134-0055: T1448 000:135 JLINK_SetEndian(ARM_ENDIAN_LITTLE) returns 0x00 (0000ms, 0132ms total)
    02-00-00000134-003C: T1448 000:135 JLINK_EnableSoftBPs(ON) (0000ms, 0132ms total)
    03-00-00000134-0010: J-Link connected
    02-00-00000134-0041: T1448 000:135 JLINK_GetFirmwareString(...) (0000ms, 0132ms total)
    03-00-00000134-0035: Firmware: J-Link ARM V8 compiled Jul 1 2011 12:02:49
    02-00-00000134-0050: T1448 000:135 JLINK_GetHardwareVersion() returns 0x13880 (0000ms, 0132ms total)
    03-00-00000134-000F: Hardware: V8.00
    03-00-00000134-000D: S/N: 68000222
    03-00-00000134-000E: OEM: J-Link-CE
    02-00-00000136-0049: T1448 000:136 JLINK_GetHWStatus(...) returns 0x00 (0001ms, 0132ms total)
    02-00-00000336-0049: T1448 000:337 JLINK_GetHWStatus(...) returns 0x00 (0000ms, 0133ms total)
    02-00-00000336-0037: T1448 000:337 JLINK_SetSpeed(10) (0000ms, 0133ms total)
    02-00-00000336-0043: T1448 000:337 JLINK_GetSpeed() returns 0x0A (0000ms, 0133ms total)
    02-00-00000844-01F2: T1448 000:337 JLINK_GetIdData(...) >0x2F8 JTAG>TotalIRLen = 4, IRPrint = 0x01 >0x30 JTAG> >0x210 JTAG> >0x78 JTAG> >0x40 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x78 JTAG> >0x40 JTAG> >0x30 JTAG> >0x30 JTAG> >0x48 JTAG> >0x40 JTAG> >0x78 JTAG> >0x40 JTAG> >0x30 JTAG> >0x30 JTAG> >0x48 JTAG> >0x40 JTAG> >0x78 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x30 JTAG>
    02-00-00001159-01F8: >0x78 JTAG> >0x40 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x78 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x78 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x48 JTAG> >0x48 JTAG>
    02-00-00001451-01F8: >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x30 JTAG> >0x48 JTAG> >0x40 JTAG> >0x78 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG>
    02-00-00001698-01F4: >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> >0x40 JTAG> >0x40 JTAG> >0x30 JTAG> >0x40 JTAG> >0x48 JTAG> >0x40 JTAG> ScanLen=4 NumDevices=1 aId[0]=0x4BA00477 aIrRead[0]=0 aScanLen[0]=0
    02-00-00001698-0026: aScanRead[0]=0 (1362ms, 0133ms total)
    02-00-00001698-0048: T1448 001:699 JLINK_GetDeviceFamily() returns 14 (0000ms, 1495ms total)
    03-00-00001698-002B: J-Link found 1 JTAG device, Total IRLen = 4
    03-00-00001698-001F: JTAG ID: 0x4BA00477 (Cortex-M4)
    02-00-00001699-003D: T1448 001:699 JLINK_GetConfigData(...) (0001ms, 1495ms total)
    02-00-00001700-001A: T1448 001:700 JLINK_Halt()
    03-00-00001700-0020: WARNING: CPU could not be halted
    02-00-00001700-0089: ***** Error: Communication timed out: Requested 4 bytes, received 0 bytes !CPU could not be halted returns 0x01 (0001ms, 1496ms total)
    03-00-00001700-0045: ERROR: Communication timed out: Requested 4 bytes, received 0 bytes !
    03-00-00001723-0023: ERROR: Could not connect to target.
  • Seems the problem is gone if there are long enough interval between two running of run_scripts.sh, just like:
    for i in ......; do
    ./run_scripts.sh ...
    sleep 20
    done

    But still not sure how the JLink driver is affected by two successive launch and the interval.

    Thanks