Ruffian Heng embedded: Super download algorithm rt-ufl v1 Use of 0 under IAR EW for arm

Time:2022-5-7

“Academic” project led by ruffian HengRt-ufl – Design of a super download algorithm for full platform i.mxrtv1. Version 0 has been released for nearly four months. Some customers have used this super download algorithm in the actual project development and debugging. At present, the feedback is OK, but this super download algorithm is far from mature. Ruffian Heng is planning v2 Version 0.

Super download algorithm rt-ufl v1 Version 0 is mainly aimed at segger j-link debugger. The development and testing are also carried out under j-link commander and j-flash software, but in fact, it is also applicable to major common ides. Today, let’s talk about its use under IAR EW for arm:

1、 Prepare test environment

First of all, we need to prepare the test environment, including necessary software and hardware. The environment of ruffian Heng is as follows:

  • Integrated development environment: IAR EW for arm V8 50.6,Click here to download
  • Software development kit: SDK_ 2.10.0_ Evkb-imxrt1050 (the toolchain needs to include IAR),Click here to download
  • Software driver: j-link driver V6 86f,Click here to download
  • Hardware tools: j-link plus debugger
  • Hardware development board: mimxrt1050-evkb (Rev. A1)

In the above software environment, there is no explicit dependency between IAR version and SDK package version, but there are some associations between j-link software driver version and IAR version, which will be mentioned in Section 2.2 below.

The j-link software driver is not necessarily limited to V6 86F, just super download algorithm v1 0 is tested in detail under this version, and other j-link versions may also be suitable. Further testing is required.

2、 Using steps under IAR EW for arm

2.1 enter the super download algorithm package into the j-link driver

In fact, the first step has nothing to do with IAR. Because it is a super download algorithm based on j-link, you should first make an update package for the j-link software driver. For details, please refer toSuper download algorithm rt-ufl v1.0 release, with installation tutorial under j-linkA penny.

  • Note: during IAR installation, a default j-link driver will be installed in the \ IAR systems \ embedded workbench 8.50.6 \ arm \ bin \ path (the version is uncontrollable and should match the IAR version). However, in order to avoid unforeseen problems, it is best to manually install a specific version of j-link driver (ruffian Heng is installed in C: \ tools_mcu \ segger \ jlink_v686f).

2.2 specify j-link driver including super download algorithm for IAR

By default, all IAR projects uniformly use the j-link software driver and its download algorithm under the IAR installation directory (assuming that the emulator in the app project option setting selects j-link and does not use the IAR download algorithm), but we have additionally installed a specified version of j-link software driver (v6.86f) for the super download algorithm, Therefore, we need to specify IAR to use the j-link driver including super download algorithm. Here, it is not set in the app project option, but with the help of jlinkdllupdate Exe tool.

In the C: \ tools that we additionally installed with the super download algorithm_ mcu\SEGGER\JLink_ Under the v686f directory, there is a file named jlinkdllupdate Exe gadget. Double click this tool to see that it searches the list of ides installed in the current PC environment, including IAR v8.exe we are using 50.6. Check IAR to complete the designation of j-link drive.

In fact, there are two versions of IAR installed on ruffian Heng’s current PC, which are v8.0 50.6 and V9 10.2, but j-link V6 Jlinkdllupdate.86f Exe only recognized IAR V8 50.6, which means that if you install IAR V9 10.2, it may not be possible to specify the use of additional installed j-link V6 86F version driver. Later, ruffian Heng installed the latest j-link v7 56B, jlinkdllupdate Exe can recognize both versions of IAR, which is the association restriction between j-link driver version and IAR version mentioned earlier in the article.

2.3 open an SDK project using IAR

Now we need an IAR project. Here we directly open the \ SDK_ 2.10.0_ EVKB-IMXRT1050\boards\evkbimxrt1050\demo_ apps\led_ Blinky project, pay attention to switching the project to flexspi_ Nor build, that is, the execution version of code XIP.

2.4 ensure that the board is in flash startup mode and the SDK project can XIP

Then power on the board to ensure that the board is in NOR flash startup mode (boot mode and boot CFG should be set correctly), and then check whether the flash startup head in IAR project matches the actual flash model on the board.

  • Note: to realize Flash debugging under the hardware reset reset type set in IDE, the above conditions must be met. However, if it is changed to software / core reset type, the board startup mode and the flash startup header in the project will not affect the debugging.

2.5 use j-link download algorithm in SDK project settings

IAR supports many kinds of hardware simulators. Here we first need to select the engineering optionsDebugger/ SetupLowerDriverSelect from the drop-down menuJ-Link/J-Trace, indicating that the j-link hardware simulator is connected to the target board.

Then came to the most critical setting in the full text, project optionsDebugger/ DownloadLowerUse flash loader(s)This option is checked by default, which means that no matter what kind of hardware emulator is connected outside, the built-in emulator in IAR directory will be used uniformly Out download algorithm, but we must remove this check box, because we need to use the super download algorithm driven by the specified j-link software.

  • Note: IAR installation directory \ IAR systems \ embedded workbench 8.50.6 \ arm \ config \ flashloader \ NXP The out format download algorithm is applicable to both cmsis-dap and j-link hardware simulators. Therefore, even if the j-link simulator is connected, there can be two different types of download algorithms. In this regard, the design of IAR is different from that of MCU Xpress ide algorithm introduced in the previous article.

2.6 select the appropriate super download algorithm for online download and debugging

The last step is to happily debug in flash. We connect the j-link emulator to the board and click the IAR menu barDownload and DebugButton for debugging and found that an error was reported. It seems that there is a download process, but it is impossible to run in one step. This is understandable because we haven’t selected the appropriate super download algorithm, at least not explicitly in the IAR project option.

In fact, the IAR project setting does not give us the opportunity to actively choose the j-link download algorithm. It secretly passes through the in the project optionGeneral Options/TargetLowerDeviceSet to C: \ tools according to the mimxrt1052xxx6b value_ mcu\SEGGER\JLink_ V686f\JLinkDevices. XML file, and the first mimxrt1050 matched is automatically selected_ UFL_ L0 algorithm, but in fact, what we need for this test is mimxrt1050_ UFL_ L1 algorithm.

  • Note: see C: \ tools for the specific code of super download algorithm_ mcu\SEGGER\JLink_ V686f\JLinkDevices. XML file, code suffix_ L0 is applicable to QSPI and octal flash, code suffix_ L1 / L2 is applicable to hyper flash.

How to solve the problem of selecting a specific super download algorithm? Of course, dynamically adjust C: \ tools according to the situation_ mcu\SEGGER\JLink_ V686f\JLinkDevices. The content of XML file is feasible. For example, mimxrt1050_ UFL_ L1 algorithmDescription block moved to mimxrt1050_ UFL_ L0 algorithmDescription blocks, or keep their positions unchanged, but temporarily mimxrt1050_ UFL_ L0 algorithmThe mimxrt1052xxx6b value in the alias expression in the description block is removed. But this method is too unfriendly. Is there a more convenient way?

Since ruffian Heng asked this question, it must be. When debugging with j-link in IAR, whether it is successful or not, an xxproject will be generated in the project directory (\ sdk_2.10.0_evkb-imxrt1050 \ boards \ evkbimxrt1050 \ demo_apps \ led_blinky \ IAR \ settings)_ flexspi_ nor_ debug. JLINK file, open this with a text editor JLINK file, change override to 1, and then set the value of device to super download algorithm code. Now let’s see if you can download and debug normally.

Override = 1
Device="MIMXRT1050_UFL_L1"

Welcome to subscribe

The article will be published to me at the same timeBlog Park HomepageCSDN home pageZhihu HomepageWechat official accountOn the platform.

Wechat search“Ruffian scale“Or scan the QR code below, and you can see it for the first time on your mobile phone.