Ruffian Heng embedded: three methods for online joint debugging of dual core project of Dahua dual core i.mxrt1170 (IAR)

Time:2022-5-26

Hello, I’m ruffian Heng, a serious technical ruffian. What ruffian Heng shared with you today isi. Method of on-line joint debugging of dual core project under mxrt1170 (based on IAR)

The ruffian wrote a piece of time agoMethod for separate on-line debugging of dual core i.mxrt1170 from nuclear engineering, that article introduced how to debug from nuclear engineering alone. After we stabilize the main nuclear project and the slave nuclear project respectively, we need dual core joint commissioning to verify the functions related to dual core communication interaction. Today, ruffian Heng will introduce three methods of dual core project joint commissioning under IAR development environment:

1、 Test preparation

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

  • Integrated development environment: IAR EW for arm v9.10.2,Click here to download
  • Software development kit: SDK_ 2.11.0_ Mimxrt1170-evk (the toolchain should include IAR),Click here to download
  • Software driver: j-link driver v7.56b,Click here to download
  • Hardware tools: j-link plus debugger
  • Hardware development board: mimxrt1170-evk (Rev. C), including onboard DAP link debugger

We know that the master-slave core of i.mxrt1170 is actually configurable in fuse. Let’s take the default configuration (cortex-m7 as the master and cortex-m4 as the slave) as an example.

2、 Commissioning under IAR

2.1 general method: the dual core project is not associated, and the debugger is loaded separately

The first method is to simply load with the help of an external debugger, and there is no dependency between the master nuclear project and the slave nuclear project. We choose the following two hellos in the SDK package_ World general engineering to test:

Main nuclear engineering: \ SDK_ 2.11.0_ MIMXRT1170-EVK\boards\evkmimxrt1170\demo_ apps\hello_ world\cm7\iar

First put hello_ world_ demo_ CM7 project (select flexspi_nor_debug build) to debug (download and debug button in the menu bar), and the breakpoint can be stopped in main. Then continue with Hello_ world_ demo_ CM4 project (select debug build) is also debugged (download and debug button in the menu bar). The process is very smooth. The following two projects can be debugged step by step or set breakpoints respectively.

  • Note1: the commissioning sequence does not necessarily require that the main nuclear engineering comes first, and the secondary nuclear engineering comes second. The switching sequence is the same, but the core reset must be selected for the engineering reset type of post commissioning (it is recommended to select this reset for both projects).
  • Note2: debugging from nuclear engineering hello_ world_ demo_ CM4 need helpMethod for separate on-line debugging of dual core i.mxrt1170 from nuclear engineeringThe script in the article activates the slave core, and do not suspend the master core in the script.
  • Note3: for the j-link debugger, there is no problem in debugging the dual core project separately; However, for DAP link debugger, when the first project is being debugged, the second project cannot be debugged directly (it will prompt that the available DAP link debugger cannot be found).

Ruffian Heng slightly modified the main functions of the two Hello world projects, printed out different contents, and added some delays. From the results, both cores are running normally. However, I would like to remind you that most of the peripherals inside i.mxrt1170 are shared by the two cores. It is recommended to allocate resources reasonably. Try not to print information through the same UART as this test (unless the resource sharing design is deliberately made in the code).

2.2 special method: dual core project is not related, IAR multi-core component loading

The second method is still to load with the help of an external debugger, and there is no dependency between the master nuclear project and the slave nuclear project. However, this time we need to use the multi-core components in IAR software, which are specifically set in the engineering optionsDebugger/MulticoreFill in the path of another nuclear project (also known as partner project) file (. Eww) and build here, and then click the download and debug button in the menu bar. IAR will automatically complete all loading and return to the debugging interface of the two projects:

  • Note1: the setting of multi-core components can be either in the master nuclear project or in the slave nuclear project. We can start commissioning from the main nuclear project or from the nuclear project.
  • It is not necessary to automatically download the script from the multi-core project or de activate the multi-core project, so it is not necessary to automatically download the script from the partner project.
  • Note3: the multi-core component function is only valid under DAP link debugger (or i-jet), but not under j-link debugger.

2.3 general method: the dual core project is related, and the master core loads the slave core

The first two methods are essentially loaded from the nuclear project with the help of the debugger. In fact, in addition to the debugger, we can also use the code in the main nuclear project to load the slave core. The steps areHow to activate cortex-m7 and cortex-m4 of dual core i.mxrt1170In this article, we use the following two hellos in the SDK package_ World multi-core routine to test:

Main nuclear engineering: \ SDK_ 2.11.0_ MIMXRT1170-EVK\boards\evkmimxrt1170\multicore_ examples\hello_ world\cm7\iar

In the multi-core example, from the Nuclear Engineering OptionOutput Converter / OutputThe generated Hello will be specified in_ world_ Cm4.bin, and then the main nuclear engineering optionLinker / InputHello will be entered in the_ world_ Cm4.bin path, so that the main nuclear project directly takes the slave core executable machine code as the source file array for subsequent copying and loading of the slave core program (the specific code is in the hello_world_core0. C file of the main nuclear project).

The multi-core example is mainly to show the dual core communication interaction, and this paper mainly introduces dual core debugging. Therefore, we can remove all the mcmgr related codes in the original project (the slave core activation statement should be added in the main nuclear project code), and the settings of multi-core components in the main nuclear project.

  • Note1: this method does not rely on the activation script of the slave nuclear engineering, because the activation is done in the main nuclear engineering code.
  • Note2: this method is applicable to j-link debugger, not DAP link debugger. The reason is similar to note 3 in Section 2.1.

After the two projects are modified, first debug the main nuclear project (download and debug button in the menu bar), run to the slave nuclear activation statement, and then debug the slave nuclear project (attach to running target button in the menu bar). So far, dual core debugging can also be carried out happily.

So far, the method of online joint debugging of dual core project under i.mxrt1170 has been introduced by ruffian Heng. Where is the applause~~~

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.

Recommended Today

Docker practical tutorial from introduction to improvement (III)

In the first two articles of this series, we have learned the installation steps of docker. Through practical examples, we have learned the implementation principle of mutual isolation between docker and host operating system file directories, as well as the working principle of docker volume: Docker practical tutorial from introduction to improvement (I) Docker practical […]