[SOLVED] Ozone with IMXRT1062

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

  • [SOLVED] Ozone with IMXRT1062

    Is there a guide to setting up the Ozone project for an IMXRT1062 application compiled in MCUXpresso?

    I thought it would just require setting up the project target and pointing at the .axf (elf) file, but I get a bunch of issues/errors, both when loading the project and when trying to start a debug session.

    HTML Source Code

    1. Disabled output of control characters
    2. SEGGER Ozone - The J-Link Debugger V3.26h
    3. J-Link software found at:
    4. File.NewProjectWizard();
    5. Target core support plugin loaded.: /Applications/SEGGER/Ozone_V326h/Ozone.app/Contents/MacOS/Plugins/Core/CorePluginARM.dylib
    6. Project.SetDevice ("MIMXRT1062xxx6A");
    7. Project.SetHostIF ("USB", "");
    8. Project.SetTargetIF ("SWD");
    9. Project.SetTIFSpeed ("1 MHz");
    10. Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-M7F.svd");
    11. File path resolved: "$(InstallDir)/Config/CPU/Cortex-M7F.svd" was found at "/Applications/SEGGER/Ozone_V326h/Ozone.app/Contents/MacOS/Config/CPU/Cortex-M7F.svd"
    12. File.Open ("/Users/user/Documents/MCUXpressoIDE_11.4.1/sample_project/sample_os/Debug/sample_os.axf");
    13. Warning (128): The target application seems to be using FreeRTOS, but FreeRTOS-awareness is not enabled.
    14. Project settings were written to the project file.
    15. Project.SetOSPlugin ("FreeRTOSPlugin");
    16. File not found: FreeRTOSPlugin.js
    17. File name resolved: "FreeRTOSPlugin.dylib" was found at "/Applications/SEGGER/Ozone_V326h/Ozone.app/Contents/MacOS/Plugins/OS/FreeRTOSPlugin.dylib"
    18. RTOS awareness plugin loaded: /Applications/SEGGER/Ozone_V326h/Ozone.app/Contents/MacOS/Plugins/OS/FreeRTOSPlugin.dylib.
    19. Target.ReadMemory (0x20040338, 0x4); // returns 0x0
    20. Target.ReadMemory (0x20040338, 0x4): Could not read target memory.
    21. Target.ReadMemory (0x200402E0, 0x4); // returns 0x0
    22. Target.ReadMemory (0x200402E0, 0x4): Could not read target memory.
    23. File.Open: completed in 26340 ms
    24. Program segments:
    25. Address Size Code RO Data RW Data ZI Data Flg
    26. --------- --------- --------- --------- --------- --------- ---
    27. 60169DA8 0 0 0 0 0 R
    28. 20000000 297 615 0 0 9 751 287 864 RW
    29. 20266700 4 0 0 0 4 RW
    30. 60000000 1 482 152 1 409 720 72 432 0 0 R E
    31. 20200000 419 584 0 0 419 584 0 RW
    32. 20001000 0 0 0 0 0 RW
    33. 20002580 0 0 0 0 0 RW
    34. 80000000 3 554 432 0 0 3 554 432 0 RW
    35. --------- --------- --------- --------- --------- --------- ---
    36. Total: 5 753 787 1 409 720 72 432 3 983 767 287 868
    37. --------- --------- --------- --------- --------- --------- ---
    38. For further information on ELF file data sections, execute command Elf.PrintSectionInfo(0).
    39. Debug.ReadIntoInstCache: updated instruction information within 1 code ranges (0x60002000-0x6015A2B8)
    40. Warning (102): The symbol location decoder encountered an unsupported operand: 0xFA.
    41. RTT active
    42. Debug.Start();
    43. Device "MIMXRT1062XXX6A" selected.
    44. InitTarget() start
    45. InitTarget() end
    46. Found SW-DP with ID 0x0BD11477
    47. DPIDR: 0x0BD11477
    48. CoreSight SoC-400 or earlier
    49. Scanning AP map to find all available APs
    50. AP[1]: Stopped AP scan as end of AP map has been reached
    51. AP[0]: AHB-AP (IDR: 0x04770041)
    52. Iterating through AP map to find AHB-AP to use
    53. AP[0]: Core found
    54. AP[0]: AHB-AP ROM base: 0xE00FD000
    55. CPUID register: 0x411FC271. Implementer code: 0x41 (ARM)
    56. Found Cortex-M7 r1p1, Little endian.
    57. FPUnit: 8 code (BP) slots and 0 literal slots
    58. CoreSight components:
    59. ROMTbl[0] @ E00FD000
    60. [0][0]: E00FE000 CID B105100D PID 000BB4C8 ROM Table
    61. ROMTbl[1] @ E00FE000
    62. [1][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table
    63. ROMTbl[2] @ E00FF000
    64. [2][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    65. [2][1]: E0001000 CID B105E00D PID 000BB002 DWT
    66. [2][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7
    67. [2][3]: E0000000 CID B105E00D PID 000BB001 ITM
    68. [1][1]: E0041000 CID B105900D PID 001BB975 ETM-M7
    69. [1][2]: E0042000 CID B105900D PID 004BB906 CTI
    70. [0][1]: E0040000 CID B105900D PID 000BB9A9 TPIU-M7
    71. [0][2]: E0043000 CID B105F00D PID 001BB101 TSG
    72. Cache: Separate I- and D-cache.
    73. I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
    74. D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
    75. Connected to target device.
    76. ResetTarget() start
    77. Invalid flash header detected.
    78. Target halted on flash header read.
    79. ResetTarget() end
    80. AfterResetTarget() start
    81. AfterResetTarget() end
    82. Elf.GetBaseAddr(); // returns 0x60000000
    83. Target.ReadU32 (0x60000000); // returns 0x4, data is 0xFFFFFFFF
    84. Elf.GetEntryPointPC(); // returns 0x60002350
    85. Target.SetReg ("PC", 0x60002350);
    86. Failed to prepare RAMCode using RAM
    87. Error while determining flash info (Bank @ 0x60000000)
    88. Could not start CPU core. (ErrorCode: -1)
    89. Download failed: J-Link reports an unspecified download error
    90. Elf.GetBaseAddr(); // returns 0x60000000
    91. Target.ReadU32 (0x60000000); // returns 0x4, data is 0xFFFFFFFF
    92. Elf.GetEntryPointPC(); // returns 0x60002350
    93. Target.SetReg ("PC", 0x60002350);
    94. Target.SetReg ("PC", 0x60002350): Program is running.
    Display All



    thx
  • Hello,

    Thank you for your inquiry.
    With the NPX IMX series it is required to let the ROM bootloader run for the chip to function.
    So it is unfortunately a bit more complex than just loading up an elf file.

    Here is what is required:
    wiki.segger.com/Debug_on_a_Tar…Bootloader#ROM_bootloader

    With Keil compiler elf files the following might be needed as well:
    wiki.segger.com/Ozone_detects_wrong_application_entry_point

    Does your setup work after applying the setup changes?

    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.
  • I had tried that as well, but it still didn't work properly.

    I modified my .jdebug file to remove _SetupTarget() from AfterTargetReset() and AfterTargetDownload() and added Exec.Reset() in AfterTargetDownload():

    Source Code

    1. void AfterTargetReset (void) {
    2. // _SetupTarget();
    3. }
    4. ...
    5. void AfterTargetDownload (void) {
    6. // _SetupTarget();
    7. Exec.Reset();
    8. }


    I don't see anywhere to configure the type of flash memory being used with the MCU, in this case Adesto ATXP032 OctalSPI flash. The XiP program is running from flash, which is at address 0x60000000 on an Embedded Artists iMX.RT1062:
    I still get a flash error when trying to download and run the program:

    Source Code

    1. Connected to target device.
    2. ResetTarget() start
    3. Invalid flash header detected.
    4. Target halted on flash header read.
    5. ResetTarget() end
    6. AfterResetTarget() start
    7. AfterResetTarget() end
    8. Failed to prepare RAMCode using RAM
    9. Error while determining flash info (Bank @ 0x60000000)
    10. Download failed: J-Link reports an unspecified download error
    11. Exec.Reset();
    12. ResetTarget() start
    13. Invalid flash header detected.
    14. Target halted on flash header read.
    15. ResetTarget() end
    16. AfterResetTarget() start
    17. AfterResetTarget() end
    Display All

    I also looked at the trace example for iMXRT and it has a different config... from here: wiki.segger.com/Tracing_on_NXP…050_Trace_Reference_Board)

    It executes a compiled JLinkScript before target connect, which seems to be for the trace setup (?), which I am not using, but since it is compiled I cannot see the script details:

    Source Code

    1. void BeforeTargetConnect (void) {
    2. //
    3. // Trace pin init is done by J-Link script file as J-Link script files are IDE independent
    4. //
    5. Project.SetJLinkScript("./NXP_IMXRT105x_TRB.pex");
    6. }

    and the AfterTargetReset() and AfterTargetDownload() are *not* empty in the Trace example:

    Source Code

    1. void AfterTargetDownload (void) {
    2. unsigned int SP;
    3. unsigned int PC;
    4. unsigned int VectorTableAddr;
    5. VectorTableAddr = Elf.GetBaseAddr();
    6. if (VectorTableAddr == 0xFFFFFFFF) {
    7. Util.Log("Project file error: failed to get program base");
    8. } else {
    9. SP = Target.ReadU32(VectorTableAddr);
    10. Target.SetReg("SP", SP);
    11. PC = Target.ReadU32(VectorTableAddr + 4);
    12. Target.SetReg("PC", PC);
    13. }
    14. }
    Display All

    Source Code

    1. void AfterTargetReset (void) {
    2. unsigned int SP;
    3. unsigned int PC;
    4. unsigned int VectorTableAddr;
    5. VectorTableAddr = Elf.GetBaseAddr();
    6. if (VectorTableAddr == 0xFFFFFFFF) {
    7. Util.Log("Project file error: failed to get program base");
    8. } else {
    9. SP = Target.ReadU32(VectorTableAddr);
    10. Target.SetReg("SP", SP);
    11. PC = Target.ReadU32(VectorTableAddr + 4);
    12. Target.SetReg("PC", PC);
    13. }
    14. }
    Display All

    The post was edited 2 times, last by jking ().

  • OK, I think I got the flash working at least... the docs were zero help on this setup.

    I had to modify the JLinkDevices.xml file (for Ozone, which is different than JLink) and add an entry for the Embedded Artists iMXRT1062.

    I had to change the flash setting to make it 4MB flash and to use the QSPI loader (using the loader elf file from Embedded Artists):

    Source Code

    1. <Device>
    2. <ChipInfo Vendor="NXP" Name="MIMXRT1062_EA" WorkRAMAddr="0x20000000" WorkRAMSize="0x00080000" Core="JLINK_CORE_CORTEX_M7" JLinkScriptFile="Devices/NXP/iMXRT105x/NXP_iMXRT105x.pex" />
    3. <FlashBankInfo Name="HyperFlash" BaseAddr="0x60000000" MaxSize="0x00400000" Loader="Devices/NXP/iMXRT105x/NXP_iMXRT105x_QSPI.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
    4. </Device>
    Then select this new device when setting up the project. Now I can get the flash write to work, but I still get a hardfault on execution, so I still have some work to fix that.

    UPDATE: After changing the AfterTargetReset and AfterTargetDownload functions to be empty (again) the project does load/start and run in debug (good!)

    Hopefully this helps someone else using the Embedded Artists module.

    The post was edited 1 time, last by jking ().

  • Hello,

    Great to hear that you are up and running again.
    Actually the process is documented, but in the J-Link Wiki as device specifics do not have to do anything with Ozone.
    wiki.segger.com/i.MXRT1060

    The Ozone articles will only describe how to get a Ozone debug session running. Having hardware set up correctly is another story and user responsibility.

    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.