Trouble with J-Link: "Failed to read CPUID for Cortex device"

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

  • Trouble with J-Link: "Failed to read CPUID for Cortex device"

    Hello Segger-Support,

    I have trouble with J-Link used from "IAR Workbench IDE". If i download my
    program, so i get "J_link Dialog" with "Failed to get CPU status after 4
    retries. Retry?" after this i can only abort the current session (see appended log output).
    The same failure is occured with "Debug iFlash" configuration is in use.

    When i put the board into "boot mode" via J3P1 (MODE0), J3P2(MODE1) only the download to
    RAM is successful (Debug iRAM configuration), download to flash is therefore failed.

    I use TMPM350-SK (IAR KickStart Kit) evaluation board.


    * Here is the Debug Log from IAR Workbench IDE:
    Tue Jan 17, 2012 09:44:46: Loaded macro file: D:\IAR_Systems\Embedded_Workbench_6.0_Kickstart\arm\config\flashloader\Toshiba\FlashTMPM350FDTFG.mac
    Tue Jan 17, 2012 09:44:46: Logging to file: E:\System\Documents\__TMPM350\Blinking_LED\cspycomm.log
    Tue Jan 17, 2012 09:44:46: JLINK command: ProjectFile = E:\System\Documents\__TMPM350\Blinking_LED\settings\Blinking_LED_Debug iFlash.jlink, return = 0
    Tue Jan 17, 2012 09:44:46: JLINK command: device = TMPM350FDTFG, return = 0
    Tue Jan 17, 2012 09:44:46: DLL version: V4.40b, compiled Dec 22 2011 10:54:45
    Tue Jan 17, 2012 09:44:46: Firmware: J-Link ARM V8 compiled Dec 6 2011 18:57:44
    Tue Jan 17, 2012 09:44:46: Selecting SWD as current target interface.
    Tue Jan 17, 2012 09:44:46: JTAG speed is initially set to: 32 kHz
    Tue Jan 17, 2012 09:44:46: Hardware reset with strategy 1 was performed
    Tue Jan 17, 2012 09:44:46: Initial reset was performed
    Tue Jan 17, 2012 09:45:11: Fatal error: Failed to read CPUID for Cortex device Session aborted!
    Tue Jan 17, 2012 09:45:11: Failed to load flash loader: D:\IAR_Systems\Embedded_Workbench_6.0_Kickstart\arm\config\flashloader\Toshiba\FlashTMPM350FDTFG.out
    Tue Jan 17, 2012 09:45:11: Failed to load flash loader: D:\IAR_Systems\Embedded_Workbench_6.0_Kickstart\arm\config\flashloader\Toshiba\FlashTMPM350FDTFG.flash

    ... and from J-Link control panel / Log
    J-Link V4.40b DLL Log
    DLL Compiled: Dec 22 2011 10:54:45
    Logging started @ 2012-01-17 09:44

    T10F4 000:230 JLINK_Reset() -- Type: 1
    T10F4 000:284 JLINK_Halt()
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Have you any hints?

    Thanks in advance for your support.

    Eduard
  • Hi Eduard,

    As a first try, you should check if basic communication with the device using J-Link is still working.
    The simplest way would be to download the latest version of the J-Link software and documentation package (V4.40b, segger.com/jlink-software.html)
    and start the J-Link Commander.

    Is J-Link still able to connect to the device?
    Is J-Link able to halt the CPU using the "h" command?
    Could you please post the output of J-Link Commander?


    Best regards
    Alex
    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.
  • Hi Alex,

    > As a first try, you should check if basic communication with the device using J-Link is still working.
    > The simplest way would be to download the latest version of the J-Link software and documentation package (V4.40b, segger.com/jlink-software.html)
    > and start the J-Link Commander.

    > Is J-Link still able to connect to the device?
    Yes

    > Is J-Link able to halt the CPU using the "h" command?
    It seems so.

    > Could you please post the output of J-Link Commander?
    Sure.
    --------------------------------------------------------------------------------------------------------------------------------------------
    SEGGER J-Link Commander V4.40b ('?' for help)
    Compiled Dec 22 2011 10:55:05
    DLL version V4.40b, compiled Dec 22 2011 10:54:45
    Firmware: J-Link ARM V8 compiled Dec 6 2011 18:57:44
    Hardware: V8.00
    S/N: 198001036
    OEM: IAR
    VTarget = 4.814V
    Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFFF1
    No devices found on JTAG chain. Trying to find device on SWD.
    Info: Found SWD-DP with ID 0x2BA01477
    Info: TPIU fitted.
    Info: ETM fitted.
    Info: FPUnit: 6 code (BP) slots and 2 literal slots
    Info: Found Cortex-M3 r2p0, Little endian.
    Cortex-M3 identified.
    JTAG speed: 100 kHz
    J-Link>h
    R0 = 40023808, R1 = 00432380, R2 = 20000054, R3 = 00000000
    R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    R12= 00000000, R13= 20000258, MSP= 20000258, PSP= 00000000
    R14(LR) = 0000067B, R15(PC) = 0000024C
    XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    J-Link>
    --------------------------------------------------------------------------------------------------------------------------------------------

    Info: TotalIRLen = ? looks suspect.

    Greetings Eduard
  • Hi Eduard,

    Info: TotalIRLen = ? looks suspect.

    I assume that the device you are using is connected via SWD only, so this message is okay.
    J-Link Commander tries to connect via JTAG first, if this fails and the connected J-Link supports SWD, it tries to connect on SWD, which succeeded here.

    So, basically J-Link seems to be able to connect to the device.
    Could you please enable the J-Link logfile in EWARM (see attached screenshot) and send us the logfile in case the debug session could not be started?


    Best regards
    Alex
    Images
    • Logfile.gif

      13.22 kB, 586×482, viewed 3,425 times
    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.
  • Hi Alex,

    i send you the log file from last fail.
    It seems, that mcu could not been halted.

    > T0940 002:296 JLINK_IsHalted() returns ERROR (0011ms, 2291ms total)

    Thanks,

    Eduard
    Files
    • cspycomm.txt

      (25.58 kB, downloaded 1,548 times, last: )
  • Hi Alex,

    i played a "little bit" with Reset Option (J-Link/J-Trace; Setup Tab).
    After switching Reset to "Connect during reset" the failure is gone.
    See following log:

    --------------------------------------------------------------------------------
    Wed Jan 18, 2012 19:01:18: Loaded macro file: D:\IAR_Systems\Embedded_Workbench_6.0_Kickstart\arm\config\flashloader\Toshiba\
    FlashTMPM350FDTFG.mac
    Wed Jan 18, 2012 19:01:19: Logging to file: E:\Projects\TSMs\TMPM350\Blinking_LED\cspycomm.log
    Wed Jan 18, 2012 19:01:19: JLINK command: ProjectFile = E:\Projects\TSMs\TMPM350\Blinking_LED\settings\Blinking_LED_Debug iFlash.jlink,
    return = 0
    Wed Jan 18, 2012 19:01:19: JLINK command: device = TMPM350FDTFG, return = 0
    Wed Jan 18, 2012 19:01:19: DLL version: V4.28c, compiled Jul 1 2011 14:23:12
    Wed Jan 18, 2012 19:01:19: Firmware: J-Link ARM V8 compiled Dec 6 2011 18:57:44
    Wed Jan 18, 2012 19:01:19: Selecting SWD as current target interface.
    Wed Jan 18, 2012 19:01:19: JTAG speed is initially set to: 32 kHz
    Wed Jan 18, 2012 19:01:19: Found SWD-DP with ID 0x2BA01477
    Wed Jan 18, 2012 19:01:19: TPIU fitted.
    Wed Jan 18, 2012 19:01:19: ETM fitted.
    Wed Jan 18, 2012 19:01:19: FPUnit: 6 code (BP) slots and 2 literal slots
    Wed Jan 18, 2012 19:01:19: Found Cortex-M3 r2p0, Little endian.
    Wed Jan 18, 2012 19:01:20: Core did not halt after reset, trying to disable WDT.
    Wed Jan 18, 2012 19:01:22: SYSRESETREQ has confused core. Trying to reconnect and use VECTRESET.
    Wed Jan 18, 2012 19:01:22: Found SWD-DP with ID 0x2BA01477
    Wed Jan 18, 2012 19:01:22: Hardware reset with strategy 3 was performed
    Wed Jan 18, 2012 19:01:22: Initial reset was performed
    Wed Jan 18, 2012 19:01:22: Executing execUserFlashInit() function
    Wed Jan 18, 2012 19:01:22: -I- Watchdog disabled
    Wed Jan 18, 2012 19:01:22: 1480 bytes downloaded and verified (11.56 Kbytes/sec)
    Wed Jan 18, 2012 19:01:22: Loaded debugee: D:\IAR_Systems\Embedded_Workbench_6.0_Kickstart\arm\config\flashloader\Toshiba\
    FlashTMPM350FDTFG.out
    Wed Jan 18, 2012 19:01:22: Target reset
    Wed Jan 18, 2012 19:01:22: Downloaded E:\Projects\TSMs\TMPM350\Blinking_LED\Debug iFlash\Exe\Blinking_LED.out to flash memory.
    Wed Jan 18, 2012 19:01:22: Found SWD-DP with ID 0x2BA01477
    Wed Jan 18, 2012 19:01:23: TPIU fitted.
    Wed Jan 18, 2012 19:01:23: ETM fitted.
    Wed Jan 18, 2012 19:01:23: FPUnit: 6 code (BP) slots and 2 literal slots
    Wed Jan 18, 2012 19:01:23: Found Cortex-M3 r2p0, Little endian.
    Wed Jan 18, 2012 19:01:23: Core did not halt after reset, trying to disable WDT.
    Wed Jan 18, 2012 19:01:24: SYSRESETREQ has confused core. Trying to reconnect and use VECTRESET.
    Wed Jan 18, 2012 19:01:24: Found SWD-DP with ID 0x2BA01477
    Wed Jan 18, 2012 19:01:24: Hardware reset with strategy 3 was performed
    Wed Jan 18, 2012 19:01:24: 1532 bytes downloaded into FLASH and verified (0.81 Kbytes/sec)
    Wed Jan 18, 2012 19:01:24: Loaded debugee: E:\Projects\TSMs\TMPM350\Blinking_LED\Debug iFlash\Exe\Blinking_LED.out
    Wed Jan 18, 2012 19:01:24: Found SWD-DP with ID 0x2BA01477
    Wed Jan 18, 2012 19:01:24: TPIU fitted.
    Wed Jan 18, 2012 19:01:24: ETM fitted.
    Wed Jan 18, 2012 19:01:24: FPUnit: 6 code (BP) slots and 2 literal slots
    Wed Jan 18, 2012 19:01:24: Found Cortex-M3 r2p0, Little endian.
    Wed Jan 18, 2012 19:01:24: Software reset was performed
    Wed Jan 18, 2012 19:01:24: Target reset
    ----------------------------------------------------------------------

    But, when i switch to my development project and configure J-Link as above,
    I get following new error message:

    --------------------------------------------------------------------------------
    Wed Jan 18, 2012 19:05:48: JLINK command: ProjectFile = E:\System\Documents\__TMPM350\FlashLoader\settings\FlashLoader_Debug iRAM.jlink, return = 0
    Wed Jan 18, 2012 19:05:48: JLINK command: device = TMPM350FDTFG, return = 0
    Wed Jan 18, 2012 19:05:48: DLL version: V4.28c, compiled Jul 1 2011 14:23:12
    Wed Jan 18, 2012 19:05:48: Firmware: J-Link ARM V8 compiled Dec 6 2011 18:57:44
    Wed Jan 18, 2012 19:05:48: JTAG speed is initially set to: 32 kHz
    Wed Jan 18, 2012 19:05:48: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFFF1
    Wed Jan 18, 2012 19:05:48: Hardware reset with strategy 3 was performed
    Wed Jan 18, 2012 19:05:48: Initial reset was performed
    Wed Jan 18, 2012 19:05:48: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFFF1
    ...
    Wed Jan 18, 2012 19:06:21: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFFF1
    Wed Jan 18, 2012 19:06:34: Fatal error: Wrong AHB ID (15:3). Expected 0x04770001 (Mask 0x0FFFFF0F), Found 0x00000007 Session aborted!
    Wed Jan 18, 2012 19:06:34: Failed to load debugee: E:\System\Documents\__TMPM350\FlashLoader\Debug iRAM\Exe\FlashLoader.out
    --------------------------------------------------------------------------------

    The complete log is attached.

    Greetings, Eduard
    Files
    • cspycomm.txt

      (94.91 kB, downloaded 1,287 times, last: )
  • Hi Eduard,

    But, when i switch to my development project and configure J-Link as above,
    I get following new error message:


    Is it possible that your development project is configured to use JTAG
    while the working project is configured to use SWD and your device is only connected via SWD?
    From the log files it looks like this...


    Best regards
    Alex
    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.
  • Hi Alex,

    > Is it possible that your development project is configured to use JTAG
    > while the working project is configured to use SWD and your device is only connected via SWD?

    No, it doesn't.

    > From the log files it looks like this...

    Hm..