[SOLVED]Trying to flash custom board with i.MXRT1176 - "Failed to prepare RAMCode using RAM" and "Error while determining flash info"

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

  • [SOLVED]Trying to flash custom board with i.MXRT1176 - "Failed to prepare RAMCode using RAM" and "Error while determining flash info"

    We are developing a custom board with an i.MXRT1176 processor, that is using different flash than the one used on the NXP MIMXRT1170-EVK eval board. Building code that only uses the internal RAM and uploading it to the RT1176 does work just fine. With that we've confirmed the design of the hardware, we were also able to talk to the primary flash via our firmware. So we are sure that the flash is attached correctly. But building a software that utilises the flash and trying to flash it to our device does fail (compare log below).
    The flash on our board does have different timings to the one used on the eval board, we saw that using the timings of the IS25WP128-JBLE of the eval board does lead to failing communication with out flash. We need to initialise the RT1176 quite a bit differently than the eval board does it in order to speak to our ext flash. The external flash on our custom board is a QSPI flash and connected to FlexSPI1, just like the IS25WP128-JBLE on the eval board. Now to my actual questions:

    • Do I understand the SEGGER wiki correctly, that by specifying -device MIMXRT1176xxxA_M7 the JLink expects a IS25WP128-JBLE to be present and initialises the RT1176 before writing to flash accordingly?
    • Thus in order to flash to the flash on our custom board, we need to write a custom J-Link script?
      • Is HandleBeforeFlashProg() the correct function to use for initialising the FlexSPI of the RT1176 for communication with our external flash? I expect that we need to tell the JLink how to initialise the FlexSPI interface of the RT1176 in order to talk to our external flash.
      • Do we need to touch other functions, e.g. HandleBeforeMemAccessWrite() or HandleAfterMemAccessWrite()?
    • Can you give me some more details to the error messages posted by the JLinkGDBServer?
      • What does the JLink tries to do when it reports "ERROR: Failed to prepare RAMCode using RAM"?
      • What is the flash info it tries to determine ("Error while determining flash info (Bank @ 0x30000000)")? The Address 0x30000000 lines up with the region that the RT1176 memory mappes to the FlexSPI1, which is the interface that our flash is connected to.


    Source Code

    1. $ JLinkGDBServer -endian little -noir -speed 4000 -port 2331 -device MIMXRT1176xxxA_M7 -if SWD -halt -reportuseraction -powertarget 1
    2. SEGGER J-Link GDB Server V7.70e Command Line Version
    3. JLinkARM.dll V7.70e (DLL compiled Aug 31 2022 17:11:20)
    4. Command line: -endian little -noir -speed 4000 -port 2331 -device MIMXRT1176xxxA_M7 -if SWD -halt -reportuseraction -powertarget 1
    5. -----GDB Server start settings-----
    6. GDBInit file: none
    7. GDB Server Listening port: 2331
    8. SWO raw output listening port: 2332
    9. Terminal I/O port: 2333
    10. Accept remote connection: yes
    11. Generate logfile: off
    12. Verify download: off
    13. Init regs on start: off
    14. Silent mode: off
    15. Single run mode: off
    16. Target connection timeout: 0 ms
    17. ------J-Link related settings------
    18. J-Link Host interface: USB
    19. J-Link script: none
    20. J-Link settings file: none
    21. ------Target related settings------
    22. Target device: MIMXRT1176xxxA_M7
    23. Target device parameters: none
    24. Target interface: SWD
    25. Target interface speed: 4000kHz
    26. Target endian: little
    27. Connecting to J-Link...
    28. J-Link is connected.
    29. Device "MIMXRT1176XXXA_M7" selected.
    30. Firmware: J-Link V11 compiled Aug 30 2022 11:47:49
    31. Hardware: V11.00
    32. S/N: 51023305
    33. Feature(s): GDB
    34. Checking target voltage...
    35. Target voltage: 3.30 V
    36. Listening on TCP/IP port 2331
    37. Connecting to target...
    38. Found SW-DP with ID 0x6BA02477
    39. DPIDR: 0x6BA02477
    40. CoreSight SoC-400 or earlier
    41. Scanning AP map to find all available APs
    42. AP[3]: Stopped AP scan as end of AP map has been reached
    43. AP[0]: AHB-AP (IDR: 0x84770001)
    44. AP[1]: AHB-AP (IDR: 0x24770011)
    45. AP[2]: APB-AP (IDR: 0x54770002)
    46. Iterating through AP map to find AHB-AP to use
    47. AP[0]: Core found
    48. AP[0]: AHB-AP ROM base: 0xE00FD000
    49. CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
    50. Found Cortex-M7 r1p2, Little endian.
    51. FPUnit: 8 code (BP) slots and 0 literal slots
    52. CoreSight components:
    53. ROMTbl[0] @ E00FD000
    54. [0][0]: E00FE000 CID B105100D PID 000BB4C8 ROM Table
    55. ROMTbl[1] @ E00FE000
    56. [1][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table
    57. ROMTbl[2] @ E00FF000
    58. [2][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    59. [2][1]: E0001000 CID B105E00D PID 000BB002 DWT
    60. [2][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7
    61. [2][3]: E0000000 CID B105E00D PID 000BB001 ITM
    62. [1][1]: E0041000 CID B105900D PID 001BB975 ETM-M7
    63. [1][2]: E0042000 CID B105900D PID 004BB906 CTI
    64. [0][1]: E0043000 CID B105900D PID 001BB908 CSTF
    65. Cache: Separate I- and D-cache.
    66. I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
    67. D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
    68. Connected to target
    69. Waiting for GDB connection...Connected to 127.0.0.1
    70. Reading all registers
    71. Read 4 bytes @ address 0x00223104 (Data = 0xF7DEE7FE)
    72. Read 2 bytes @ address 0x00223104 (Data = 0xE7FE)
    73. Received monitor command: reset 2
    74. Reset: Halt core after reset via DEMCR.VC_CORERESET.
    75. Reset: Reset device via reset pin
    76. Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?).
    77. Reset: Reconnecting and manually halting CPU.
    78. Found SW-DP with ID 0x6BA02477
    79. DPIDR: 0x6BA02477
    80. CoreSight SoC-400 or earlier
    81. AP map detection skipped. Manually configured AP map found.
    82. AP[0]: AHB-AP (IDR: Not set)
    83. AP[0]: Core found
    84. AP[0]: AHB-AP ROM base: 0xE00FD000
    85. CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
    86. Found Cortex-M7 r1p2, Little endian.
    87. Reset: Halt core after reset via DEMCR.VC_CORERESET.
    88. Reset: Reset device via AIRCR.VECTRESET.
    89. AfterResetTarget() start
    90. Valid application detected. Setting PC / SP manually.
    91. PC = 0x0080A615
    92. SP = 0x01140210
    93. Clean & invalidate cached CPU registers
    94. AfterResetTarget() end
    95. Resets core & peripherals using RESET pin.
    96. Downloading 512 bytes @ address 0x30000400
    97. Downloading 52 bytes @ address 0x30001000
    98. Downloading 1024 bytes @ address 0x30002000
    99. Downloading 15792 bytes @ address 0x30002400
    100. Downloading 16000 bytes @ address 0x300061B0
    101. Downloading 16048 bytes @ address 0x3000A030
    102. Downloading 16032 bytes @ address 0x3000DEE0
    103. Downloading 16032 bytes @ address 0x30011D80
    104. Downloading 16048 bytes @ address 0x30015C20
    105. Downloading 16176 bytes @ address 0x30019AD0
    106. Downloading 16224 bytes @ address 0x3001DA00
    107. Downloading 16288 bytes @ address 0x30021960
    108. Downloading 9032 bytes @ address 0x30025900
    109. Downloading 8 bytes @ address 0x30027C48
    110. Downloading 4 bytes @ address 0x30027C50
    111. Downloading 4 bytes @ address 0x30027C54
    112. Downloading 964 bytes @ address 0x30027C58
    113. ERROR: Failed to prepare RAMCode using RAM
    114. Error while determining flash info (Bank @ 0x30000000)
    115. Writing register (PC = 0x300024b4)
    116. GDB closed TCP/IP connection (Socket 10)
    117. ^CRestoring target state and closing J-Link connection...
    118. Shutting down...
    Display All
  • Hi,

    We will close this thread, as you also contacted us via the Support Ticket system.
    Please make sure to keep communication to one channel for future request.
    Otherwise
    • information might be lost between channels
    • this might lead to a higher work load on our side, resulting in slower response time
    Best regards,
    Sebastian
    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.