[SOLVED] How to read iMX7's MDM-DAP registers with JLink

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

  • [SOLVED] How to read iMX7's MDM-DAP registers with JLink

    I tried reading DAP' status, control and ID registers on iMX7D module.
    The info and addresses are on p 258 of IMX7DRM manual.
    E.g. : IDR addr 0x010000FC, suppose to have fixed value of 0x0001c0000

    Trying by connecting to A7_0:
    JLinkExe -device MCIMX7D7_A7_0 -autoconnect 1 -if JTAG -speed 4000 -JTAGConf -1,-1

    mem32 0x010000FC, 1


    This silently fails, with nothing printed, and no error or any trace returned.

    Tried through M4:
    JLinkExe -device Cortex-M4 -autoconnect 1 -if JTAG -speed 4000 -JTAGConf -1,-1 -JLinkScriptFile NXP_iMX7D_Connect_CortexM4.JLinkScript
    (Or JLinkExe -device MCIMX7D5_M4 -autoconnect 1 -if JTAG -speed 4000 -JTAGConf -1,-1 )

    mem32 0x010000FC, 1


    Returns : Could not read memory.

    What may be going on, why I cannot read these ?
  • Hi,

    The MDM-AP is not supported through user interfaces with J-Link as there is usually no need to read or edit them for the user.
    This silently fails, with nothing printed, and no error or any trace returned.

    We will see if this behaviour can be improved to throw the same error it returns when trying accessing over the Cortex-M4.

    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,

    The silent fail behavior also repeats for a bunch of other (because I only tried few, possibly many more) registers when system runs.

    For the target in question, connected to A7_0 core, but before Linux has booted, you can access with JLink registers or SRC_A7RCR0 and SRS_M4RCR, for example.
    JLinkExe works and reads and writes.

    If you try access same registers after Linux has booted, (even after re-connect with JLinkExe), reading those registers silently fails.. (again no message of an sort).
    So that just for you to replicate silent failure.

    But my (another to the DAP original) question I have: Do you know or have a hint to know why would JLink be precluded from reading those registers after Linux has booted?
    Those should be in 'user' interface with JLink, shouldn't they .

    Thanks in advance
  • Hi,

    If the register is accessible through an AHB or APB AP then you should be able to access that register with J-Link.
    Any other AP might work but no guarantee here.

    But my (another to the DAP original) question I have: Do you know or have a hint to know why would JLink be precluded from reading those registers after Linux has booted?

    What can happen is that after booting Linux the OS changes the debug AP access levels, or even disables AP clocks or similar.
    So take a look if Linux is actively altering any debug related registers and if the debug GPIO stays unaffected.

    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.