Hello, everyone. I’m a ruffian. I’m a real technical ruffian. What ruffian Heng introduced to you today isDesign of serial nor flash download algorithm for i.mxrt under j-link tool。
In the i. mxrt hardware seriesDebugging principle of serial nor flash XIPIn this paper, ruffian Heng briefly proposed the concept of serial nor flash download algorithm, and did not introduce the specific design details. About nor flash download algorithm, each ide / tool has its own set of design. Although the basic design concept is the same, there are still differences in details. Today, ruffian Heng will talk about the NOR flash download algorithm under j-link
1、 Support for i.mxrt in different versions of j-link
According to segger’s official website, the latest version of j-link driver is v6.86b, which can support all the i.mxrt series that have been mass produced at present. However, the version of v6.52e is installed on the PC of PI Ziheng, which can be downloaded fromJ-link history release noteIt can be seen that the current version of j-link does not support all i.mxrt models. If you want to support new chips (such as i.mxrt1170), do you have to re install the latest j-link? Not really!
|edition||Release time||Support chip|
J-link’s download support for new MCU models is not strictly bound with its own version. The way to add new chips is very flexible. We only need to add the corresponding algorithm files as required, so we don’t have to wait for the official release of segger.
2、 Add new i.mxrt model support to current j-link
About adding support for the new I. mxrt model, PI Ziheng wrote an article beforeEasily update segger j-link flash download algorithm file for i.mxrt designThis paper introduces how to add i.mxrt600 support for v.6.52e (in fact, there is a bit of negligence in that article. V6.52 has started to support i.mxrt600, which is directly integrated into JLinkARM.dll Yes, it’s not explicitly placed in the JLinkDevices.xml File).
Adding new i.mxrt model support to the current j-link driver is actually in the_ V652e\ JLinkDevices.xml Add some code according to the template in the file. As for the meaning of those codes, please refer to the_ V652e\Doc\Manuals\UM08001_ JLink.pdf Document’sChapter 12 Open FlashloaderThere is a detailed explanation.
Let’s try to analyze JLinkDevices.xml What is the meaning of the template code in the file, and take the most common i.mxrt1060 model as an example:
There are two main types of parameters in template code: chipinfo and flashbankinfo. The former describes the MCU chip information for which the algorithm is applicable, and the latter describes the flash operation information applicable to the MCU.
First of all, the parameters under chipinfo: vendor and name are used to determine the ID of the download algorithm file when creating a j-flash project or pop up the j-link option box when downloading online in the IDE. Core is used to specify the type of MCU chip core. Jlinkscriptfile specifies the JLINK script to be preloaded before starting to enable the download algorithm (you can do some special initialization work according to MCU characteristics, such as rt600 debug mailbox activation, rt1170 dual core switch, etc.). Aliases is a detailed expansion of name.
The two most important parameters in chipinfo are actually workramaddr and workramsize. They indicate that the download algorithm (some elf format file) is loaded into the area where SRAM is executed inside the MCU. The values of these two parameters are closely related to the MCU model and must be legal and valid, but not unique. The most important features of the download algorithm are read only position independent and read write position independent. In other words, the download algorithm itself is not a fixed address link, but a location independent link. The machine code of the algorithm code can be executed at any address.
In addition, the parameter name under flashbankinfo indicates the flash type to which the download algorithm is applicable (there can be multiple flashbankinfo, corresponding to different flash download algorithms). Baseaddr and maxsize indicate the address range of the flash in the memory mapping of MCU system. They are mainly used for subsequent XIP debugging and have little to do with downloading. Loader and loadertype indicate the location and type of the download algorithm file, which is the core. For the download support of the new i.mxrt model, most of the work is to provide the appropriate loader.
3、 NOR flash download algorithm design
As mentioned above, j-link’s download support for the new i.mxrt model is actually to provide appropriate loader files. The design of loader files is the core. How is j-link’s loader designed? This starts with understanding the parameter loadertype.
Search the whole um08001_ JLINK document, loadertype has only one value, namely flash_ ALGO_ TYPE_ Open, the explanation in the document is to use the public flashloader algorithm design. The public flashloader refers to the official CMSIS based flashloader of arm.
Arm open source flashloader algorithm belongs toCMSIS-PackIt is a component of Device Family Pack (DFP) in. It was originally used for keil MDK. However, in order to maintain the universality of its j-link tool chain, segger chose to keep the API interface consistent with arm flashloader, which means keil The download algorithm files of MDK and j-link can be used interchangeably (of course, there is a little difference in design, which will be introduced in the following article).
Since segger does not open source its download algorithm source code, we can not know how to implement the download algorithm file of its j-link (for example, devices / NXP / imxrt106x / NXP)_ iMXRT106x_ QSPI.elf ）Although we can know the dynamic state of the j-link driver according to the records of each update, we always think it is a black box.
Version V6.80d DLL 3.NXP RT106x: Flash programming >= 8 MB failed. Fixed. Version V6.80c DLL 1.NXP RT106x: QSPI programming failed under specific circumstances. Fixed. Version V6.70 DLL 19.NXP RT106x: QSPI programming did not work for some already supported flashes. Fixed. Version V6.62b DLL 9.NXP iMXRT106x: (Q)SPI flash programming did not work when using Adesto ATXP064 as external flash. Fixed. Version V6.60 DLL 1.Added flash programming support for NXP MIMXRT1062DVJ6A (QSPI flash). Version V6.40b DLL 4.Fixed clock restore settings within programming algorithms for iMXRT105x and iMXRT106x QSPI-FLASH and HyperFLASH series devices. Version V6.34 DLL 8.Added QSPI-Flash programming support for NXP i.MX RT106x series devices.
In the next article, ruffian Heng will take you to explore the download algorithm design under keil MDK. After understanding the MDK download algorithm, we can design our own download algorithm for j-link, and we will never have to worry about the black box again.
At this point, j-link tool i.mxrt serial nor flash download algorithm design will be completed, where is the applause~~~
Welcome to subscribe
Wechat search“Ruffian scale embedded“Or scan the QR code below, and you can read it for the first time on your mobile phone.