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:
Display All
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()?
- 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.
- 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.
- What does the JLink tries to do when it reports "ERROR: Failed to prepare RAMCode using RAM"?
Source Code
- $ JLinkGDBServer -endian little -noir -speed 4000 -port 2331 -device MIMXRT1176xxxA_M7 -if SWD -halt -reportuseraction -powertarget 1
- SEGGER J-Link GDB Server V7.70e Command Line Version
- JLinkARM.dll V7.70e (DLL compiled Aug 31 2022 17:11:20)
- Command line: -endian little -noir -speed 4000 -port 2331 -device MIMXRT1176xxxA_M7 -if SWD -halt -reportuseraction -powertarget 1
- -----GDB Server start settings-----
- GDBInit file: none
- GDB Server Listening port: 2331
- SWO raw output listening port: 2332
- Terminal I/O port: 2333
- Accept remote connection: yes
- Generate logfile: off
- Verify download: off
- Init regs on start: off
- Silent mode: off
- Single run mode: off
- Target connection timeout: 0 ms
- ------J-Link related settings------
- J-Link Host interface: USB
- J-Link script: none
- J-Link settings file: none
- ------Target related settings------
- Target device: MIMXRT1176xxxA_M7
- Target device parameters: none
- Target interface: SWD
- Target interface speed: 4000kHz
- Target endian: little
- Connecting to J-Link...
- J-Link is connected.
- Device "MIMXRT1176XXXA_M7" selected.
- Firmware: J-Link V11 compiled Aug 30 2022 11:47:49
- Hardware: V11.00
- S/N: 51023305
- Feature(s): GDB
- Checking target voltage...
- Target voltage: 3.30 V
- Listening on TCP/IP port 2331
- Connecting to target...
- Found SW-DP with ID 0x6BA02477
- DPIDR: 0x6BA02477
- CoreSight SoC-400 or earlier
- Scanning AP map to find all available APs
- AP[3]: Stopped AP scan as end of AP map has been reached
- AP[0]: AHB-AP (IDR: 0x84770001)
- AP[1]: AHB-AP (IDR: 0x24770011)
- AP[2]: APB-AP (IDR: 0x54770002)
- Iterating through AP map to find AHB-AP to use
- AP[0]: Core found
- AP[0]: AHB-AP ROM base: 0xE00FD000
- CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
- Found Cortex-M7 r1p2, Little endian.
- FPUnit: 8 code (BP) slots and 0 literal slots
- CoreSight components:
- ROMTbl[0] @ E00FD000
- [0][0]: E00FE000 CID B105100D PID 000BB4C8 ROM Table
- ROMTbl[1] @ E00FE000
- [1][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table
- ROMTbl[2] @ E00FF000
- [2][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
- [2][1]: E0001000 CID B105E00D PID 000BB002 DWT
- [2][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7
- [2][3]: E0000000 CID B105E00D PID 000BB001 ITM
- [1][1]: E0041000 CID B105900D PID 001BB975 ETM-M7
- [1][2]: E0042000 CID B105900D PID 004BB906 CTI
- [0][1]: E0043000 CID B105900D PID 001BB908 CSTF
- Cache: Separate I- and D-cache.
- I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
- D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
- Connected to target
- Waiting for GDB connection...Connected to 127.0.0.1
- Reading all registers
- Read 4 bytes @ address 0x00223104 (Data = 0xF7DEE7FE)
- Read 2 bytes @ address 0x00223104 (Data = 0xE7FE)
- Received monitor command: reset 2
- Reset: Halt core after reset via DEMCR.VC_CORERESET.
- Reset: Reset device via reset pin
- Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?).
- Reset: Reconnecting and manually halting CPU.
- 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[0]: Core found
- AP[0]: AHB-AP ROM base: 0xE00FD000
- CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
- Found Cortex-M7 r1p2, Little endian.
- Reset: Halt core after reset via DEMCR.VC_CORERESET.
- Reset: Reset device via AIRCR.VECTRESET.
- AfterResetTarget() start
- Valid application detected. Setting PC / SP manually.
- PC = 0x0080A615
- SP = 0x01140210
- Clean & invalidate cached CPU registers
- AfterResetTarget() end
- Resets core & peripherals using RESET pin.
- Downloading 512 bytes @ address 0x30000400
- Downloading 52 bytes @ address 0x30001000
- Downloading 1024 bytes @ address 0x30002000
- Downloading 15792 bytes @ address 0x30002400
- Downloading 16000 bytes @ address 0x300061B0
- Downloading 16048 bytes @ address 0x3000A030
- Downloading 16032 bytes @ address 0x3000DEE0
- Downloading 16032 bytes @ address 0x30011D80
- Downloading 16048 bytes @ address 0x30015C20
- Downloading 16176 bytes @ address 0x30019AD0
- Downloading 16224 bytes @ address 0x3001DA00
- Downloading 16288 bytes @ address 0x30021960
- Downloading 9032 bytes @ address 0x30025900
- Downloading 8 bytes @ address 0x30027C48
- Downloading 4 bytes @ address 0x30027C50
- Downloading 4 bytes @ address 0x30027C54
- Downloading 964 bytes @ address 0x30027C58
- ERROR: Failed to prepare RAMCode using RAM
- Error while determining flash info (Bank @ 0x30000000)
- Writing register (PC = 0x300024b4)
- GDB closed TCP/IP connection (Socket 10)
- ^CRestoring target state and closing J-Link connection...
- Shutting down...