Which device flag to use and how to connect to iMX7 Dual and Solo (using GDBServer) 's M4 core

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

  • Which device flag to use and how to connect to iMX7 Dual and Solo (using GDBServer) 's M4 core

    Hello,

    First question which of the -device flags to use for my device? Here are flags I got from Segger's list :

    MCIMX7D3_M4

    MCIMX7D5_M4

    MCIMX7D7_M4



    MCIMX7U3_M4

    MCIMX7U5_M4


    The xDx's must be for iMX7 Dual? But whats the difference between D3 , D5, D7? I have tried all these flags on my iMX7Dual SoM, and Segger's GDBServer fails to connect with same error for all 3 of D flags.


    opt/SEGGER/JLink/JLinkGDBServer -device MCIMX7D3_M4
    SEGGER J-Link GDB Server V6.18 Command Line Version

    JLinkARM.dll V6.18 (DLL compiled Aug 3 2017 16:21:09)

    Command line: -device MCIMX7D3_M4
    -----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: yes
    Generate logfile: off
    Verify download: off
    Init regs on start: off
    Silent mode: off
    Single run mode: off
    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: MCIMX7D3_M4
    Target interface: JTAG
    Target interface speed: 1000kHz
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link V10 compiled Jul 28 2017 08:59:01
    Hardware: V10.00
    S/N: 600000226
    Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    Checking target voltage...
    Target voltage: 3.33 V
    Listening on TCP/IP port 2331
    Connecting to target...
    J-Link found 1 JTAG device, Total IRLen = 4
    JTAG ID: 0x5BA00477 (Cortex-M4)
    WARNING: CPU could not be halted
    Halting target device failed. Trying again with reset
    WARNING: CPU could not be halted
    Failed to halt target device on connect
    ERROR: Could not connect to target.
    Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
    Shutting down...
    Could not connect to target.
    Please check power, connection and settings.

    And similarly for D5, D7, only difference is the target device flag , otherwise

    The error seems always same:-->
    ...

    JTAG ID: 0x5BA00477 (Cortex-M4)
    WARNING: CPU could not be halted
    Halting target device failed. Trying again with reset
    WARNING: CPU could not be halted
    Failed to halt target device on connect
    ERROR: Could not connect to target.
    .....

    Same with my Solo SOM, tried all flags, fails to connect similarly.


    Please help
  • Hi,

    for an overview of the IMX device series supported by J-Link, please refer to this wiki article: wiki.segger.com/IMX_Series_Devices

    The xDx's must be for iMX7 Dual? But whats the difference between D3 , D5, D7?

    Well, what device / eval board are you using currently?
    We use the names defined by NXP.
    You can find them on NXPs website: nxp.com/products/microcontroll…-7-processors:IMX7-SERIES
    Just click one of the device series, e.g. "i.MX 7Dual" (link: nxp.com/products/microcontroll…D?tab=Package_Quality_Tab)
    and then switch to the tab Package/Quality in order to see the device names, e.g. the first one listed is "MCIMX7D2DVK12SC"

    Beset regards,
    Niklas
    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 Niklas,

    Well, what device / eval board are you using currently?
    I'm using Toradex's Colibri iMX7D and/or iMX7S (Dual or Solo),
    https://www.toradex.com/computer-on-modules/colibri-arm-family/nxp-freescale-imx7, ( it's the 512MB Dual and 256MB Solo versions )
    Eval board:
    https://www.toradex.com/products/carrier-board/colibri-evaluation-carrier-board



    ( Vybrid VF61x version works fine with Segger )
  • Hi,


    it is not possible to connect to the Cortex-M4 of a i.MX7 without enabling it beforehand.
    For further information, please refer to wiki.segger.com/IMX7D, section M4 Debug Application (Example).

    Does this work for you?

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

    That seems to work as far as I tested (connection to M4 ), but a few things:

    Per that wiki you referred to (JLink commander on Linux JLinkExe)
    /opt/SEGGER/JLink/JLinkExe -JLinkScriptFile /opt/SEGGER/JLink/Devices/NXP/iMX7D/NXP_iMX7D_Connect_CortexM4.JLinkScript


    does not seems to work, the script file is ignored, as far I see because no connection is established, and not even correct target core is selected. For me it was still on A7 from previous steps.

    Substituting this with
    /opt/SEGGER/JLink/JLinkGDBServer -jlinkscriptfile /opt/SEGGER/JLink/Devices/NXP/iMX7D/NXP_iMX7D_Connect_CortexM4.JLinkScript


    Seems to connect to M4 and ready for session, except for this warning I get:
    WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.


    Is that an issue?

    For the Solo version, as I see it is not listed as a supported device for Segger JLink, (no MCIMX7Sxxx anywhere), but it works similar to the Dual version?
    I repeated the steps as per your wiki, and managed seems to connect using JLinkGDBServer command as above using same script.

    Also I did not get any warnings as above, on T-bit.

    However, for Solo version first time I tried to connect to A7, I got this error:
    ****** Error: Cortex-A/R (connect): Core internal signal DBGEN is not asserted. Debugging is not possible.


    After plugging / unplugging (actually swapping with Duo version, then back) the module error went away, but I would want to know how to fix it if it comes back.

    I saw someone else had this Segger problem on a different platform: [SOLVED] AM3352 DBGEN is not asserted error
    Could you share the solution to that ?
  • Hi,

    /opt/SEGGER/JLink/JLinkExe -JLinkScriptFile /opt/SEGGER/JLink/Devices/NXP/iMX7D/NXP_iMX7D_Connect_CortexM4.JLinkScript
    does not seems to work, the script file is ignored, as far I see because no connection is established, and not even correct target core is selected. For me it was still on A7 from previous steps.

    The core is specified in the JLinkScript, and the script itself works fine, as you noticed when using J-Link GDB Server.
    However, you need to execute the >connect< command in J-Link Commander, the connection to the target device is not established automatically.
    You can specify >-autoconnect 1< as a command line parameter in order to connect automatically.

    However, specifying the JLinkScript is not necessary at all with current versions of the J-Link software in order to connect to an i.MX7D device series target.
    Specifying the correct device name is sufficient for the A7s, but enabling the M4 core before connecting to the M4 core of a i.MX7D series device is still mandatory.

    Regarding the iMX7S:
    Does the connect work when specifying Cortex-A7 as the target device and not using any script file at all?


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

    However, specifying the JLinkScript is not necessary at all with current versions of the J-Link software in order to connect to an i.MX7D device series target
    Yes but I'm connecting to and using script for the M4 core. Per your wiki you need this to connect to M4 core. And yes I need to script to connect to A7 core.

    Does the connect work when specifying Cortex-A7 as the target device and not using any script file at all?
    I've repeated your steps for iMX7D on iMX7S, so yea first step is to connect to A7 core. And that seems to work.
  • Hi,

    Also, why is it required to halt A7 core when loading M4? Isn't this odd this will interfere with whatever A7 is doing each time you want to start debugging with new image on M4?


    That is the way which is recommended and documented by NXP in the linked the app note.

    Best regards,
    Niklas
    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.
  • SEGGER - Niklas wrote:

    .... That the way which is recommended and documented by NXP in the linked the app note. ...

    Hi Niklas,

    I have modified that that script the wiki refers to / the default M4 connect script for iMX7 Segger provides, to have customized resets, and now it does not
    (in my tests) require preliminary or initial A7 connection. It works straight to M4.

    I have sent you personal message with script information, if you could review it please.
    Files
  • Hi,

    Thank you for providing the script.
    Great to hear that you are up and running with it.
    Unfortunately we are not able to put this in the official shipment as we are obliged to follow official NXP documentation due to legal reasons.
    We will however keep it in this thread if that is fine for you so users will find it when googling for it or using the forum search.
    For future archiving this thread will be locked 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.