JLINK flash breakpoints in QUAD SPI for iMX7 Sabre dev board

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

    • JLINK flash breakpoints in QUAD SPI for iMX7 Sabre dev board

      Hello Nino - sorry to start another thread, the last thread was marked as closed before I had a chance to respond to your last inquiry. I am currently running J-LINK v6.34h family of tools. I am using Elipse as my IDE and have had success with RAM-based applications, but still no luck on QUAD SPI based applications running on the M4 core of the iMX7D.

      For my current debugging I am stopping the A-core in UBOOT and running the "sf probe" command with essentially sets up the QUAD-SPI interface allowing access. When I go to debug a QUAD-SPI application I see the console report that it is downloading the code and verifying it (all OK with one exception at one particular address), but I am not convinced that this 'downloading' is actually doing anything. I also still get "WARNING: No more breakpoint resources left". There is a dump of the console upon starting the debug session below.

      I did try using J-FLASH but the memory part is not in the supported list (Maybe it's not supported at all?). Our Sabre SD board has a Macronix MX25L51245GXDI-10G, 64M-byte part on it. I tried using some similar parts and manually setting up a part but have had no luck; I can connect to the board just fine, but the memory part is not recognized. The base address of the SPI bus is 0x60000000.

      Source Code

      1. SEGGER J-Link GDB Server V6.34h Command Line Version
      2. JLinkARM.dll V6.34h (DLL compiled Oct 9 2018 15:48:11)
      3. Command line: -if jtag -device CORTEX-M4 -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 19021 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui -scriptfile C:\Program Files (x86)\SEGGER\JLINK_Scripts\NXP_iMX7D_Connect_CortexM4.JLinkScript
      4. -----GDB Server start settings-----
      5. GDBInit file: none
      6. GDB Server Listening port: 2331
      7. SWO raw output listening port: 2332
      8. Terminal I/O port: 19021
      9. Accept remote connection: localhost only
      10. Generate logfile: off
      11. Verify download: on
      12. Init regs on start: on
      13. Silent mode: off
      14. Single run mode: on
      15. Target connection timeout: 0 ms
      16. ------J-Link related settings------
      17. J-Link Host interface: USB
      18. J-Link script: C:\Program Files (x86)\SEGGER\JLINK_Scripts\NXP_iMX7D_Connect_CortexM4.JLinkScript
      19. J-Link settings file: none
      20. ------Target related settings------
      21. Target device: CORTEX-M4
      22. Target interface: JTAG
      23. Target interface speed: 1000kHz
      24. Target endian: little
      25. Connecting to J-Link...
      26. J-Link is connected.
      27. Firmware: J-Link V10 compiled Sep 4 2018 11:24:21
      28. Hardware: V10.10
      29. S/N: 50101423
      30. Feature(s): GDB
      31. Checking target voltage...
      32. Target voltage: 3.30 V
      33. Listening on TCP/IP port 2331
      34. Connecting to target...
      35. J-Link found 1 JTAG device, Total IRLen = 4
      36. JTAG ID: 0x5BA00477 (Cortex-M4)
      37. WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
      38. Connected to target
      39. Waiting for GDB connection...Connected to 127.0.0.1
      40. Reading all registers
      41. Read 4 bytes @ address 0x00000000 (Data = 0x1FFFFEFF)
      42. Read 2 bytes @ address 0x00000000 (Data = 0xFEFF)
      43. Received monitor command: speed 1000
      44. Target interface speed set to 1000 kHz
      45. Received monitor command: clrbp
      46. Received monitor command: reset 1
      47. WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
      48. Resets the core only, not peripherals.
      49. Received monitor command: halt
      50. Halting target CPU...
      51. ...Target halted (PC = 0x6010AC9C)
      52. Received monitor command: regs
      53. R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
      54. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
      55. R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
      56. R12= 00000000, R13= 1FFFFEFC, MSP= 1FFFFEFC, PSP= 00000000
      57. R14(LR) = FFFFFFFF, R15(PC) = 6010AC9C
      58. XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
      59. CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
      60. Reading all registers
      61. Read 4 bytes @ address 0x6010AC9C (Data = 0x49144813)
      62. Read 2 bytes @ address 0x6010AC9C (Data = 0x4813)
      63. Received monitor command: speed auto
      64. Select auto target interface speed (4000 kHz)
      65. Received monitor command: flash breakpoints 1
      66. Flash breakpoints enabled
      67. Received monitor command: semihosting enable
      68. Semi-hosting enabled (Handle on BKPT)
      69. Received monitor command: semihosting IOClient 2
      70. Semihosting I/O set to GDB Client
      71. Read 4 bytes @ address 0x6010AC9C (Data = 0x49144813)
      72. Read 2 bytes @ address 0x6010AC9C (Data = 0x4813)
      73. Downloading 1024 bytes @ address 0x60100000 - Verified OK
      74. Downloading 16128 bytes @ address 0x60100400 - Verified OK
      75. Downloading 16048 bytes @ address 0x60104300 - Verified OK
      76. Downloading 16000 bytes @ address 0x601081B0 - Verified OK
      77. Downloading 16000 bytes @ address 0x6010C030 - Verified OK
      78. Downloading 16016 bytes @ address 0x6010FEB0 - Verified OK
      79. Downloading 15984 bytes @ address 0x60113D40 - Verified OK
      80. Downloading 16032 bytes @ address 0x60117BB0 - Verified OK
      81. Downloading 16016 bytes @ address 0x6011BA50 - Verified OK
      82. Downloading 16048 bytes @ address 0x6011F8E0 - Verify failed
      83. Downloading 16320 bytes @ address 0x60123790 - Verified OK
      84. Downloading 16240 bytes @ address 0x60127750 - Verified OK
      85. Downloading 4544 bytes @ address 0x6012B6C0 - Verified OK
      86. Downloading 8 bytes @ address 0x6012C880 - Verified OK
      87. Downloading 4064 bytes @ address 0x6012C888 - Verified OK
      88. Read 4 bytes @ address 0x6010AC9C (Data = 0x49144813)
      89. Read 2 bytes @ address 0x6010AC9C (Data = 0x4813)
      90. Read 2 bytes @ address 0x6010467A (Data = 0x4802)
      91. Read 4 bytes @ address 0x60104684 (Data = 0x60127208)
      92. Read 2 bytes @ address 0x6010467A (Data = 0x4802)
      93. Read 4 bytes @ address 0x60104684 (Data = 0x60127208)
      94. Read 2 bytes @ address 0x6010467A (Data = 0x4802)
      95. Read 2 bytes @ address 0x60104C90 (Data = 0x4B12)
      96. Read 4 bytes @ address 0x60104CDC (Data = 0x009204B8)
      97. Read 2 bytes @ address 0x60104CDA (Data = 0x4770)
      98. Read 2 bytes @ address 0x6010284C (Data = 0x4D8A)
      99. Read 4 bytes @ address 0x60102A78 (Data = 0x00920418)
      100. Read 2 bytes @ address 0x6010284E (Data = 0x4F8B)
      101. Read 2 bytes @ address 0x6010D9D0 (Data = 0x4B11)
      102. Read 4 bytes @ address 0x6010DA18 (Data = 0x009204B8)
      103. Read 2 bytes @ address 0x6010D9D8 (Data = 0x9A01)
      104. Read 2 bytes @ address 0x6010F8B0 (Data = 0x6803)
      105. Read 2 bytes @ address 0x6010F966 (Data = 0x4648)
      106. Read 2 bytes @ address 0x60104C42 (Data = 0xAA08)
      107. Read 2 bytes @ address 0x60104C4C (Data = 0x9205)
      108. Read 2 bytes @ address 0x60102342 (Data = 0x4829)
      109. Read 4 bytes @ address 0x601023E8 (Data = 0x60123434)
      110. Read 2 bytes @ address 0x60102348 (Data = 0x4A28)
      111. Read 2 bytes @ address 0x601031DE (Data = 0x2803)
      112. Read 2 bytes @ address 0x601032BE (Data = 0xF7FF)
      113. Read 2 bytes @ address 0x601049C8 (Data = 0x4B22)
      114. Read 4 bytes @ address 0x60104A54 (Data = 0x009204B8)
      115. Read 2 bytes @ address 0x60104A22 (Data = 0x602C)
      116. Read 2 bytes @ address 0x6010693A (Data = 0x4B22)
      117. Read 4 bytes @ address 0x601069C4 (Data = 0x009204B8)
      118. Read 2 bytes @ address 0x60106974 (Data = 0x4630)
      119. Read 2 bytes @ address 0x6010D8B2 (Data = 0x4604)
      120. Read 2 bytes @ address 0x6010D8B4 (Data = 0x4608)
      121. Read 2 bytes @ address 0x6010F8B0 (Data = 0x6803)
      122. Read 2 bytes @ address 0x6010F8D0 (Data = 0x2F00)
      123. Read 2 bytes @ address 0x60106F50 (Data = 0x4B68)
      124. Read 4 bytes @ address 0x601070F4 (Data = 0x009204B8)
      125. Read 2 bytes @ address 0x60106F4C (Data = 0xE92D)
      126. Read 2 bytes @ address 0x60100878 (Data = 0x2204)
      127. Read 2 bytes @ address 0x60100884 (Data = 0x4B04)
      128. Read 2 bytes @ address 0x6010F8B0 (Data = 0x6803)
      129. Read 2 bytes @ address 0x6010F8B2 (Data = 0xF8D0)
      130. Read 2 bytes @ address 0x60106D34 (Data = 0x29BF)
      131. Read 2 bytes @ address 0x60106DE8 (Data = 0x2002)
      132. Read 2 bytes @ address 0x6010955A (Data = 0x4605)
      133. Read 2 bytes @ address 0x6010955C (Data = 0xF7FB)
      134. Read 2 bytes @ address 0x60106F50 (Data = 0x4B68)
      135. Read 4 bytes @ address 0x601070F4 (Data = 0x009204B8)
      136. Read 2 bytes @ address 0x60106F4C (Data = 0xE92D)
      137. Received monitor command: clrbp
      138. Received monitor command: halt
      139. Halting target CPU...
      140. ...Target halted (PC = 0x6010AC9C)
      141. Received monitor command: memU32 0x3039000C 0xAC
      142. Writing 0x000000AC @ address 0x3039000C
      143. Received monitor command: memU32 0x00180000 0x1ffffeff
      144. Writing 0x1FFFFEFF @ address 0x00180000
      145. Received monitor command: memU32 0x00180004 0x6010ac9c
      146. Writing 0x6010AC9C @ address 0x00180004
      147. Received monitor command: memU32 0xE000EDFC 0x01000001
      148. Writing 0x01000001 @ address 0xE000EDFC
      149. Received monitor command: memU32 0x3039000C 0xAA
      150. Writing 0x000000AA @ address 0x3039000C
      151. Read 2 bytes @ address 0x6010467A (Data = 0x4802)
      152. Read 4 bytes @ address 0x60104684 (Data = 0x60127208)
      153. Read 2 bytes @ address 0x6010467A (Data = 0x4802)
      154. Read 4 bytes @ address 0x60104684 (Data = 0x60127208)
      155. Read 2 bytes @ address 0x6010467A (Data = 0x4802)
      156. Received monitor command: regs
      157. R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
      158. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
      159. R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
      160. R12= 00000000, R13= 1FFFFEFC, MSP= 1FFFFEFC, PSP= 00000000
      161. R14(LR) = FFFFFFFF, R15(PC) = 6010AC9C
      162. XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
      163. CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
      164. Reading all registers
      165. Read 4 bytes @ address 0x6010AC9C (Data = 0x49144813)
      166. Read 2 bytes @ address 0x6010AC9C (Data = 0x4813)
      167. Setting breakpoint @ address 0x60102348, Size = 2, BPHandle = 0x0000
      168. WARNING: No more breakpoint resources left
      169. ERROR: Failed to set breakpoint at 0x60102348
      170. Setting breakpoint @ address 0x6010467A, Size = 2, BPHandle = 0x0000
      171. WARNING: No more breakpoint resources left
      172. ERROR: Failed to set breakpoint at 0x6010467A
      173. Read 2 bytes @ address 0x6010467A (Data = 0x4802)
      174. Read 4 bytes @ address 0x60104684 (Data = 0x60127208)
      175. Read 2 bytes @ address 0x6010467A (Data = 0x4802)
      176. Read 4 bytes @ address 0x60104684 (Data = 0x60127208)
      177. Read 2 bytes @ address 0x6010467A (Data = 0x4802)
      178. GDB closed TCP/IP connection
      Display All
    • Hello,

      Thank you for your inquiry.

      jmcclintock wrote:

      For my current debugging I am stopping the A-core in UBOOT and running the "sf probe" command with essentially sets up the QUAD-SPI interface allowing access.
      Unfortunately we can't comment on UBOOT as it is not our software, so we have no control if UBOOT is executing the correct init steps.

      The imx7D series SPI programming is already supported by J-Link to work out-of-the-box.
      More information can be found here: wiki.segger.com/IMX7D

      jmcclintock wrote:

      I did try using J-FLASH but the memory part is not in the supported list (Maybe it's not supported at all?).
      It is supported: segger.com/products/debug-prob…es/supported-spi-flashes/
      In J-Flash you need to select the correct imx7D as device, SPI Flash detection then is automatic: wiki.segger.com/IMX_Series_Devices


      Best regards,

      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      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 contact us per e-mail.
      Alternatively our support ticketing system can be used as well: segger.com/ticket/
    • Hello,

      Flash BP are included in J-Link models J-Link Plus or higher.
      So for a J-Link Base you need an extra license for Flash BP as well.
      You can also purchase an upgrade package from J-Link Base to Plus which includes both licenses:
      8.08.13 J-Link Upgrade BASE to PLUS segger.com/purchase/pricing/jlink-related/

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      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 contact us per e-mail.
      Alternatively our support ticketing system can be used as well: segger.com/ticket/
    • Hello,

      You will need a Flash BP license if you want any Flash BP. Unlimited is then just a bonus.

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      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 contact us per e-mail.
      Alternatively our support ticketing system can be used as well: segger.com/ticket/
    • Hello Nino - thank you again for the assistance, I think it is almost working, here is what I have found with both a temp J-FLASH and FLASH BP license.

      1) If I connect to the iMX7D Sabre SD board with the M4 core as the target, I connect just fine but I am unable to set any flash breakpoints, it always fails.
      2) If I connect with the A7_0 as the target, I AM able to set flash breakpoints, but these are never 'hit'

      Maybe it's the way in which we are running our two cores that is the issue? We have the A7 booting from the CF card (UBOOT and Linux), and we have our M4 application in the QUADSPI NOR flash. We have scripts in UBOOT to launch the M4 processor before we boot into Linux.

      I am trying to debug the QUADSPI M4 application on the M4 via Eclipse. This works fine for RAM-only applications when specifying the M4 as the target core, but still no luck with flash applications.

      I have tried stopping the A7 core in UBOOT; the J-LINK attaches to the A7 fine and updates the QUADSPI application and sets the breakpoints OK, but typically results in a reboot of the both cores and the breakpoints are never hit - I get various errors about being unable to read a memory location in QUADSPI memory (0x6010xxxx) and then immediately after an error about being unable to read memory 0xDEADBEEF.

      I have tried removing the CF card so that the A7 is not running anything; the flash loads and breakpoints are set without issue but then it fails with ERROR: Could not start CPU core. Then JLinkGDBServerCL.exe crashes.

      Do you know of anyone who it trying to debug in QUADSPI for the M4 that has it working?

      thank you again,
      Jeremy
    • Hello Jeremy,

      Could you open a support ticket in that regard?
      You can find a link to the ticket site in my signature.

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      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 contact us per e-mail.
      Alternatively our support ticketing system can be used as well: segger.com/ticket/