QSPI flash programming support
QSPI flash programming support is included since software version V6.32. It allows to program any common SPI flash connected to the QSPI controller. Programming is supported out-of-the-box thus no additional scripts are required. A detailed list of all supported SPI flashes can be found here: https://www.segger.com/products/debug-probes/j-link/technology/cpus-and-devices/supported-spi-flashes/
Multi-core support for iMX7D
J-Link script files are necessary to connect to both A7 cores and the M4 core of the iMX7D MCU.
- A7 core0: File:NXP iMX7D Connect CortexA7 0.JLinkScript
- A7 core1: File:NXP iMX7D Connect CortexA7 1.JLinkScript
- M4 core: File:NXP iMX7D Connect CortexM4.JLinkScript
Example package for J-Link Commander:
How to use script files: Please refer to J-Link User Guide (UM08001), chapter 5.11 "J-Link script files"
Startup procedure is:
1) Start debug session that connects to A7_0 2) Start debug session that connects to A7_1 3) Start debug session that connects to M4 [...] x) Close debug session that connects to M4 x + 1) Close debug session that connects to A7_1 x + 2) Close debug session that connects to A7_0
On the iMX7D the A7_1 core cannot be independently debugged without enabling the core by either having something running on the A7_0 or M4 that enables the A7_1 or as part of the A7_0 J-Link script file. In the example script file above, we chose the later case to enable the A7_1 core from within the A7_0 J-Link script file.
M4 Debug Application (Example)
In order to debug an application running on the M4, the application needs to be loaded on the Cortex-M4 using the Cortex-A7. This can be done either by the application running on the A7 core or by loading the code manually (e.g. using J-Link Commander). A step-by-step instruction with detailed information is provided by NXP in the Application Note AN5317 (http://www.nxp.com/assets/documents/data/en/application-notes/AN5317.pdf). A short step-by-step instruction which shows how to reload & debug the code on the M4 using J-Link Commander is given below. The used application is part of the FreeRTOS example, available for download on the NXP webpage. The example has been created to run on the MCIMX7SABRE evaluation board (red LED D10 blinks): File:blinking imx demo gpt.zip. The example assumes that a UART connection to the debug UART of the M4 is open.
- Prepare the debug UART
- Supply power to the MCIMX7SABRE evaluation board
- Connect the DEBUG UART via USB to the PC
- Connect to the M4 debug UART using a terminal application (e.g. HTerm; COMxxx; Baud: 115200; Data: 8; Stop: 1; Parity: None)
- Download the application to the M4 through the A7
- Start J-Link Commander and connect to the A7 main core by selecting "MCIMX7D7_A7_0" as target device
- Halt the CPU using the h command in J-Link Commander
- Issue a software reset of the M4 (w4 0x3039000C 0xAC)
- Load the M4 application code to the TCM_L memory space (loadfile blinking_imx_demo_gpt.bin,0x007F8000)
- Set PC and SP according to the build M4 application (In this example: w4 0x00180000 0x20008000 and w4 0x00180004 0x1FFFACFD
- Perform a software reset of the M4 core in order to start the application (w4 0x3039000C 0xAA)
- If the application has been started successfully, the red LED (D10) starts blinking
- Start J-Link Commander and connect to the M4 core using the iMX7D_Connect_CortexM4.JLinkScript J-Link script file
- Issue a halt request using the h command in J-Link Commander --> LED stops blinking
- Let the application run again using the go command in J-Link Commander --> LED starts blinking again
Debugging in OCRAM
The i.MX7 series devices incorporate a device-specific cache unit that is controlled via the LMEM peripheral/module. In order to allow settings software breakpoints when debugging in RAM, the LMEM module should be disabled. When debugging in OCRAM on the M4 core, the LMEM module needs to be disabled to set any breakpoint. This is needed because the OCRAM is above addr. 0x1FFFFFFF which is the max. address for which HW breakpoints can be used on the M4. This means, for OCRAM debugging, always software breakpoints would be used on the M4 and this requires LMEM to be disabled.
Note: This might be handled automatically by a future J-Link software version but there are no immediate plans yet.