J-Link Plus does not find devices on JTAG chain (J-Trace does)

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

  • J-Link Plus does not find devices on JTAG chain (J-Trace does)

    Hi,

    today we got our new J-Link Plus device. It works just find with single MCUs.
    With our boards which have 2 MCUs (Kinetis K22) on a JTAG-chain, it refuses to find any of the MCUs. We used the same settings as for out J-Trace for ARM, which works as expected.
    Are there any special settings? We already tries to reduce the JTAG-Speed down to 5kHz.

    The "detect" button does not find anything. We just get the Message "ERROR: InitTarget(): PCode returned with error code -1". This also happens if we try the "Simple configuration". Then we get this:
    Connecting ...
    - Target interface speed: 4000 kHz (Fixed)
    - VTarget = 3.341V
    - ERROR: InitTarget(): PCode returned with error code -1
    - ERROR: Failed to connect.
    Could not establish a connection to target.

    Any ideas, why the J-Link Plus does not work?

    Br,
    Wolfgang
  • Hello Wolfgang,

    Thank you for your inquiry.

    Such an issue is not known to us.
    Are there any special settings? We already tries to reduce the JTAG-Speed down to 5kHz.

    With what software are you trying to connect to the target devices?
    Are you using the exact same debug interface for J-Link as you did with J-Trace?
    Has anything changed between your setups or are they 100% the same except the used debug probe??

    The "detect" button does not find anything.

    What detect button do you mean specifically?
    Could you post a screenshot of the error you are seeing?

    Best regards,
    Nino
    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 Nino,

    we use the J-Flash v6.20h software. I talked about the "detect" button in the "Project settings" :)

    The setup is exactly the same, I only exchanged the J-Trace with a J-Link.
    This is how it looks with the J-Trace after pressing the "detect" button:


    With J-Link Plus it looks like this:


    I changed the configuration to directly select the target:


    Then I tried to connect:


    Br,
    Wolfgang
  • Hello Wolfgang,

    Thank you for providing the additional information.

    We are wondering how it is working with the J-Trace at all. The problem with Kinetis devices is that we need to use a special connect sequence which per default assumes only a 1 device chain.
    When using the J-Trace are you able to connect and program both targets or does only "detect" work but everything else not?

    Could you try and use the J-Link Commander and try to connect to the devices with J-Trace and J-Link and post screenshots of the complete Commander output?

    Would it generally be possible to send us your custom hardware to investigate this behaviour in house?

    When setting up the chain did you consider the following? wiki.segger.com/Kinetis_Series_Devices

    Best regards,
    Nino
    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.
  • Cortex-M4 identified as Cortex-M0

    Hi again,

    now I had some time to play around with this problem again.
    I used the JLink Commander for my tests and I created a small JLinkScript:

    C Source Code

    1. int InitTarget(void) {
    2. JLINK_SYS_Report("Kinetis K22 JTAG chain - InitTarget");
    3. JLINK_JTAG_Reset();
    4. if (JTAG_TotalIRLen != 8) {
    5. MessageBox("Can not find both CPUs");
    6. return 1;
    7. }
    8. JTAG_AllowTAPReset = 1;
    9. CPU = CORTEX_M4;
    10. }


    With this code, both CPUs are found if there is any firmware available in the controllers:


    If I now do an erase on the controller and perform a reset, I get the following (Cortex-M0 detected instead of Cortex-M4):


    Sometimes the controller gets locked and I get the following:


    If the controller is locked, I am not able to unlock it with JLink Commander (unlock kinetis). I have to use another Toolchain to unlock the controller.

    Any idea, how to connect to the device again after erasing it? Right now I had a third behaviour after erase:


    I'm a little bit confused right now...

    Br,
    Wolfgang
  • Hello Wolfgang,

    That behaviour matches the issue described in the wiki article: wiki.segger.com/Kinetis_Series_Devices

    Make sure that the Reset pins on *each* target device have a Diode positioned as described to make sure that the target devices don't reset each other if no application is running in them.
    Did you implement this on your hardware?

    Best regards,
    Nino
    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 Nino,

    thanks for your answer.
    We implemented something like this. It is an external watchdog system which separates the interrupt pins of the target devices (the watchdog functionality can be disabled by jumpers).
    We use the same hardware via JTAG chain with a debugger from one of your competitors and it works. We are able to flash both target devices, regardless if they are empty or not. It is also possible to unlock both target devices.
    So I think it is a problem with the initializazion.
    Nevertheless, I will check our hardware again in respect of the reset pins.

    Br,
    Wolfgang
  • Hi Nino,

    SEGGER - Nino wrote:

    Hello Wolfgang,

    That behaviour matches the issue described in the wiki article: wiki.segger.com/Kinetis_Series_Devices

    Make sure that the Reset pins on *each* target device have a Diode positioned as described to make sure that the target devices don't reset each other if no application is running in them.
    Did you implement this on your hardware?

    Best regards,
    Nino
    we changed one of our boards and replaced our watchdog with just the diodes. It still does not work :(
    I have one controller with firmware (device 1) and one without (device 0). I can connect to device 1 without any problem, but not to device 0 using the JLink Software (v6.30b).

    Best reagrds,
    Wolfgang
  • Hello,

    This thread will be handled further per e-mail so it will be closed now.

    Best regards,
    Nino
    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.