[ABANDONED] Problems debugging M4 core of NXP RT1170 with Ozone (V3.28d) and J-Link Ultra+ debugger

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

  • [ABANDONED] Problems debugging M4 core of NXP RT1170 with Ozone (V3.28d) and J-Link Ultra+ debugger

    Hi there, I'm trying to use Ozone (v3.28d) with J-Link Ultra+ and debug M4 core on NXP RT1170, using the official EVB.

    To do so, I created the m7.jdebug (M7!) project where I downloaded the M7 and M4 fw into external flash. M4 fw is downloaded by M7 using this method:
    void AfterTargetDownload (void) {
    Target.LoadMemory("C:/WORK/Git-Repo/m4core/emulator/executable-rom-relocate.srec", 0x30100000);
    }
    where executable-rom-relocate.srec is a srec file which has been relocated to be stored into flash memory (starting address 0x30100000), but originally, M4 project is configured to be run into RAM memory, Code TCM (LMEM RAM_L).

    After starting M7 core, it copies the M4 FW from flash to RAM memory, copy M4 VTOR address and then reset it.
    This procedure seems working fine because I can see a led blink which is driven by M4.

    Basically, right now, I have M7 and M4 cores running and I would like to attach Ozone debugger with M4, but I'm not able.

    Here is the .jdebug file:
    void OnProjectLoad (void)
    {
    //
    // Dialog-generated settings
    //
    Project.SetDevice ("MIMXRT1176xxxA_M4");
    Project.SetHostIF ("USB", "");
    Project.SetTargetIF ("SWD");
    Project.SetTIFSpeed ("50 MHz");
    Project.AddSvdFile("$(InstallDir)/Config/CPU/Cortex-M4.svd");
    Project.AddSvdFile("$(JTOOLS_1)/Iar/Arm/latest/config/debugger/NXP/MIMXRT1176_cm4.svd");
    //
    // User settings
    //
    //Edit.SysVar (VAR_RTT_ENABLED, 1);
    File.Open("$(ProjectDir)/../emulator/executable.elf");

    // Enables or disables the Real-Time Transfer interface
    //Project.SetRTT(1);

    // Set J-Link project file
    Exec.Command("ProjectFile = $(ProjectDir)/ozone.jlink");

    // RM_RESET_HALT Resets the target and halts the program at the reset vector.
    // RM_BREAK_AT_SYMBOL Resets the target and advances program execution to the function specified by system variable VAR_BREAK_AT_THIS_SYMBOL.
    // RN_RESET_AND_RUN Resets the target and starts executing the program.
    Debug.SetResetMode(RM_RESET_HALT);
    }

    Even if I tried to download and debug the original executable.srec (RAM starting address), I'm not able to connect to M4 core.

    This is the log I got:
    Project.SetDevice ("MIMXRT1176xxxA_M4");
    Project.SetHostIF ("USB", "");
    Project.SetTargetIF ("SWD");
    Project.SetTIFSpeed ("50 MHz");
    Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-M4.svd");
    File path resolved: "$(InstallDir)/Config/CPU/Cortex-M4.svd" was found at "C:/Program Files/SEGGER/Ozone/Config/CPU/Cortex-M4.svd"
    Project.AddSvdFile ("$(JTOOLS_1)/Iar/Arm/latest/config/debugger/NXP/MIMXRT1176_cm4.svd");
    File path resolved: "$(JTOOLS_1)/Iar/Arm/latest/config/debugger/NXP/MIMXRT1176_cm4.svd" was found at "C:/jtools_1/Iar/Arm/latest/config/debugger/NXP/MIMXRT1176_cm4.svd"
    File path resolved: "$(ProjectDir)/../emulator/executable.elf" was found at "C:/WORK/Git-Repo/m4core/emulator/executable.elf"
    File.Open ("C:/WORK/Git-Repo/m4core/emulator/executable.elf");
    Exec.Command ("ProjectFile = $(ProjectDir)/ozone.jlink");
    Executed J-Link command "ProjectFile = C:/WORK/Git-Repo/m4core/.ide/ozone.jlink"
    Debug.SetResetMode (RM_RESET_HALT);
    File.Open: completed in 179 ms
    Program segments:
    Address Size Code RO Data RW Data ZI Data Flg
    --------- --------- --------- --------- --------- --------- ---
    1FFE0000 1 024 1 024 0 0 0 R E
    1FFE0400 14 628 14 628 0 0 0 R E
    --------- --------- --------- --------- --------- --------- ---
    Total: 15 652 15 652 0 0 0
    --------- --------- --------- --------- --------- --------- ---
    For further information on ELF file data sections, execute command Elf.PrintSectionInfo(0).
    Debug.ReadIntoInstCache: updated instruction information within 1 code ranges (0x1FFE0000-0x1FFE3D24)
    Debug.SetConnectMode (CM_ATTACH);
    Debug.Start();
    Device "MIMXRT1176XXXA_M4" selected.
    Device "MIMXRT1176XXXA_M4" selected.
    InitTarget() start
    InitTarget() end - Took 1ms
    Found SW-DP with ID 0x6BA02477
    DPIDR: 0x6BA02477
    CoreSight SoC-400 or earlier
    AP map detection skipped. Manually configured AP map found.
    AP[0]: AHB-AP (IDR: Not set)
    AP[1]: AHB-AP (IDR: Not set)
    AP[2]: APB-AP (IDR: Not set)
    AP[1]: Core found
    AP[1]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    [0][7]: E0043000 CID B105900D PID 001BB908 CSTF
    [0][8]: E0042000 CID B105900D PID 005BB906 CTI
    Connected to target device.
    Connection to target device lost.


    Let me add other info:
    M4 debugging with IAR+Jlink works properly but not using Ozone+Jlink
    M7 debugging works as expected with IAR+Jlink and Ozone+JLink

    Can anyone please address me to find out the solution?
    Thanks
    T.
  • Hello,

    Thank you for your inquiry.
    Are you looking to attach or connect to the M4? Please note that these are different things.

    Currently your project is setup to connect.
    In that case you might need to handle the Boot ROM which does not jump to the application automatically as explained here:
    wiki.segger.com/i.MXRT117x#Reset

    If you are looking to attach you need to change the mode to Debug.SetConnectMode (CM_ATTACH);

    Or you can set it via the GUI also.

    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.