Ruffian Heng embedded: Super download algorithm rt-ufl v1 Use of 0 under keil MDK

Time:2022-5-6

“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 keil MDK:

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: keil uVision V5 31,Click here to download
  • Software development kit: SDK_ 2.10.0_ Evkb-imxrt1050 (toolchain needs to include keil),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 clear dependency between j-link software driver, Keil version and SDK package version. 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、 Use steps under keil MDK

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

The first step has nothing to do with keil. 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: keil will be installed in \ Keil_ Install a default j-link driver under the V5 \ arm \ segger \ path (the version is uncontrollable and should match the Keil version), but in order to avoid unforeseen problems, you’d better manually install a clear j-link driver version to use (ruffian Heng is installed in C: \ tools_mcu \ segger \ jlink_v686f).

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

By default, all keil projects uniformly use the j-link software driver provided in keil installation directory (assuming that the emulator in app project option settings selects j-link), but we have additionally installed a specified version of j-link software driver (v6.86f) for super download algorithm, so we need to specify keil to use the j-link driver including super download algorithm, This 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. There is keil MDK we are using. Check keil to complete the designation of j-link driver.

2.3 open an SDK project with Keil

Now we need a keil project. Here we can 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 keil 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

Keil supports many kinds of hardware simulators. Here we first need to select the engineering optionsDebugLowerUseSelect from the drop-down menuJ-LINK / J-TRACE Cortex, indicating that the j-link hardware simulator is connected to the target board. Select and clickSettingsYou can identify the serial number of the current j-link emulator (if the emulator is connected to a PC), and check whether the DLL version is the j-link driver version with super download algorithm (v6.86f).

Then came to the most critical setting in the full text, project optionsUtilitiesLowerUse Target Driver for Flash ProgrammingThe option remains checked, but it needs to beUpdate Target before DebuggingThis check is removed (this option ostensibly means that a new download can be started only when the image file has changed since the last download, but there are implied functions in the actual measurement. If it is checked, Keil’s own download algorithm will be used, and if it is not checked, the algorithm in j-link driver will be used), because we need to use the super download algorithm driven by the specified j-link software.

  • Note: keil installation directory \ Keil_ It comes with V5 \ arm \ flash (or DFP package directory installed by pack installer) The FLM 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, Keil is different from the MCU Xpress ide algorithm introduced earlier.

RemovedUse Target Driver for Flash ProgrammingAfter the option, you also need to select the project optionUtilitieslowerProgramming AlgorithmRemove the Keil download algorithm and leave it blank here, otherwise keil will not enable the algorithm under j-link.

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

The last step is to happily debug in flash. In the previous step, after we set the project options, the j-link device selection window will pop up when we open the project options again. At this time, you can select the appropriate download algorithm. After selection, a jlinksettings will be generated in the project directory (\ sdk_2.10.0_evkb-imxrt1050 \ boards \ evkbimxrt1050 \ demo_apps \ led_blinky \ MDK) INI file, open this with a text editor INI file, check that override is 1, and then set the value of device to the super download algorithm code. 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.

Now let’s connect the j-link emulator to the board and click the Keil menu barStart/Stop Debug SessionButton (the button marked in the blue circle) to download and debug. Note that it cannot be usedDownloadButton (the button marked in red circle) to download becauseDownloadThe button always calls keil’s own download algorithm.

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.