[SOLVED] Problems with J-Link & LPC2387 when a valid firmware is present

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

  • [SOLVED] Problems with J-Link & LPC2387 when a valid firmware is present

    I am not able to connect to my board unless there's no firmware in it.

    My project
    • My module is a SEGGER J-Link EDU V9.30, SN 269302119. Firmware is 2015 May 22 17:20.
    • The board features an LPC2387.
    • I've connected JTAG lines nTRST, TDI, TMS, TCK and TDO to the J-Link module, plus RESET.
    • My supply is 3.4V and I've connected it to VTref.
    • I've added a 100K pull-down on the TCK line.
    • All other JTAG lines have internal pull-ups on the MCU as per documentation.
    • My board's reset circuit has a 22nF capacitor to GND and a 47K pull-up.

    What does work

    I can connect to my MCU using this setting if and only if no valid firmware signature is written on the flash. Then the connection from the J‑Flash program succeeds. JTAG chain is scanned and detected:

    From J-Flash:
    Connecting ...
    - Connecting via USB to J-Link device 0
    - Target interface speed: 1334 kHz (Auto)
    - VTarget = 3.427V
    - Initializing CPU core (Init sequence) ...
    - Initialized successfully
    - Target interface speed: 400 kHz (Auto)
    - CPU clock frequency: 4024 kHz (Auto detected)
    - J-Link found 1 JTAG device. Core ID: 0x4F1F0F0F (ARM7)
    - Connected successfully
    From J-Link Commander:
    SEGGER J-Link Commander V5.00d ('?' for help)
    Compiled Jun 17 2015 22:33:52
    DLL version V5.00d, compiled Jun 17 2015 22:33:29
    Firmware: J-Link V9 compiled May 22 2015 17:20:50
    Hardware: V9.30
    S/N: 269302119
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    VTarget = 3.432V
    Info: TotalIRLen = 4, IRPrint = 0x01
    Found 1 JTAG device, Total IRLen = 4:
    #0 Id: 0x4F1F0F0F, IRLen: 04, IRPrint: 0x1, ARM7TDMI-S Core
    Found ARM with core Id 0x4F1F0F0F (ARM7)
    ETM V1.2: 1 pairs addr.comp, 0 data comp, 4 MM decs, 1 counters
    Target interface speed: 100 kHz
    J-Link>
    What does not work

    None of this works with valid firmware loaded on the board.

    From J-Link Commander:
    SEGGER J-Link Commander V5.00d ('?' for help)
    Compiled Jun 17 2015 22:33:52
    DLL version V5.00d, compiled Jun 17 2015 22:33:29
    Firmware: J-Link V9 compiled May 22 2015 17:20:50
    Hardware: V9.30
    S/N: 269302119
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    VTarget = 3.438V
    Info: TotalIRLen = 4, IRPrint = 0x01
    Info: TotalIRLen = 4, IRPrint = 0x01
    No devices found on JTAG chain. Trying to find device on SWD.
    No device found on SWD.
    Trying to find device on FINE interface.
    No device found on FINE interface.
    Did not find any core.
    Failed to identify target. Trying again with slow (4 kHz) speed.
    No devices found on JTAG chain. Trying to find device on SWD.
    No device found on SWD.
    Trying to find device on FINE interface.
    No device found on FINE interface.
    Did not find any core.
    No device found at all. Selecting JTAG as default target interface.

    Checks I've made and what I've found

    I've checked I've not disabled the JTAG interface unintentionally by reading back the flash Code Read Protection (CRP) address (0x000001FC) and making sure it doesn't contain any of the defined values (I make it so it has 0xa5a5a5a5, but also tested with 0xffffffff). So, JTAG should be available on the MCU in all cases.

    Strangely, I do not see either RESET or TRST lines go low when I attempt to connect using JTAG (although reset does go low when other connections are attempted by J-Link Commander; SWD or FINE, it happens a little too fast to tell which one). I also can set any value I like in the RESET and nTRST lines using the appropriate J-Link Commander commands.

    Any help would be appreciated.

    Sincerely,

    Guillermo Prandi
  • Hi,

    From your description, it seems to us that the firmware causes the issue (e.g. by disabling / reconfiguring the debug pins). Did you gave it a try using a firmware which does not contain any functionality (simple while(1) loop in main)? We expect after programming the while (1) "application", you will still be able to connect to the target MCU.

    - 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.
  • For anyone interested, the problem was that my software periodically set the processor to idle state (as part of the idle hook of the FreeRTOS operating system, i.e., when there was nothing to be done). Bypassing the code and making the LPC2387 processor to stay in full power mode made the J-Link JTAG to connect correctly.