{{announcement.body}}
{{announcement.title}}

Using SEGGER J-Link With QSPI FLASH on NXP i.MX Boards

DZone 's Guide to

Using SEGGER J-Link With QSPI FLASH on NXP i.MX Boards

Learn more about using SEGGER J-Link in this tutorial.

· IoT Zone ·
Free Resource

Segger J-Link

Learn more about using SEGGER J-Link in this tutorial.

In previous posts, "Seeed Studio Arch Mix NXP i.MX RT1052 Board" and "Debug and Execute Code from FLASH on the Seeed Arch Mix NXP i.MX RT1052 Board," I used the NXP LPC-Link2 to debug the Seeed Arch Mix board with the NXP i.MX RT1052, because the SEGGER J-Link does not work out-of-the-box with the i.MX RT using QSPI Flash.

This article shows how the J-Link connection can be changed from HyperFlash to work with QSPI Flash.

J-Link EDU Mini with Seeed i.MX RT1052

J-Link EDU Mini with Seeed i.MX RT1052

Depending on what external FLASH memory is used (SPI Flash, HyperFlash, etc.), the debug connection needs to be made aware so that it can use the correct driver to access and program the memory. The NXP LPC-Link2 debug connection has a flexible way to load the needed flash driver using a setting the Eclipse (MCUXpresso) IDE project properties:

Flash Driver Setting

Flash Driver Setting

That way, the debugger connection can load the appropriate flash driver. That above flash drive is specific for the LPC-Link2 debug connection.

For the SEGGER J-Link, one would expect that the needed driver could be specified on the command line starting the debug connection, as it is, for example, for the core/device under debug. But instead, the external flash driver setting is configured in a global JLinkDevices.xml file.

By default, (probably because the first NXP boards for i.MX RT1052 were using HyperFlash), the default is using that FLASH technology. To change, it, locate the JLinkDevices.xml file. On Windows, this should be in:

C:\Program Files (x86)\SEGGER\JLink


JLinkDevices.xml

JLinkDevices.xml

Open the file with a text editor to edit it (you might need administrative rights).

Note: This file is *global* and changing it will not allow you to connect to a board with HyperFlash and vice versa. If having different boards with different FLASH memory on it means always changing that XML file. Best if using a batch file to switch between different FLASH variants.

Search in the JLinkDevices.xml the device used. In my case, it is the MCIMXRT1052, which is shown in the J-Link connection console:

Target Device used by J-Link

Target Device used by J-Link

Search for that device in the XML file:

Loader to program the flash

Loader to program the flash

The loader identifies the driver to program the flash, plus the memory range. The J-Link FLASH drivers are inside the 'Devices' folder of the J-Link installation folder:

Segger J-Link Flash Drivers for i.MX RT105x

Segger J-Link Flash Drivers for i.MX RT105x

In my case, I change it to use the QSPI Flash instead:

Setting to use QSPI Flash

Setting to use QSPI Flash

With this, I can download and debug the i.MX RT1052 Seeed board with QSPI Flash in Eclipse.

Debugging i.MRT with QSPI FLASH

Debugging i.MRT with QSPI FLASH

Summary

To switch to a different (non-default) FLASH with the SEGGER J-Link, I must manually edit and change the JLinkDevices.xml file inside the JLink installation folder. That works fine, but do not forget to switch back if using a different board with a different FLASH memory device on it. And do not forget to make the change again after installing a new J-Link version.

Happy Flashing!

Further Reading

40+ Emerging IoT Technologies You Should Have on Your Radar

7 Common IoT Mistakes and How to Avoid Them

Topics:
iot ,eclipse ,flash ,tutorial ,microcontroller ,seeed ,j-link

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}