RT1160 can't debug dual core using JLink

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1160 can't debug dual core using JLink

Jump to solution
1,632 Views
enricorocheti_
Contributor III

Hi,

I'm using the MIMRX1160-EVK to run a dual-core application.

Previously, I uploaded the CM4 firmware to external RAM (0x80000000) using an external JLink EDU and CM7 would boot CM4 from there (using MCMGR). I've followed the instructions of this post. There were no problems at all doing this and debugging both CM7 and CM4 cores simultaneously using the MCUXpresso IDE.

Due to a project restriction, I need to move the CM4 firmware back to its original ITCM memory (0x20200000), as most of the SDK examples do. Unfortunately, I'm unable to do this using the external JLink. I've checked numerous memory/linker configurations, and they all seem to be correct. To confirm this, I attempted to debug this dual-core project using the NXP LinkServer (USB cable), and it worked perfectly. In other words, there are no issues with my memory/linker settings.

I've tried following the steps presented in [link] to debug my dual-core app using an external JLink, but it just doesn't seem to work. Additionally, it doesn't seem practical to perform those steps every time I want to debug this app (e.g., step 6 - disabling the "attach to a running target" flag every debug session). I simply want to follow the same steps I was using when running CM4 in BOARD RAM: clicking the Debug button on the CM7 project, which would also boot the CM4 project, allowing me to debug both cores simultaneously using the "dual-core" buttons (Resume All Debug Sessions, Suspend All Debug Sessions, etc.).

Can anyone help me with this?

0 Kudos
Reply
1 Solution
1,331 Views
enricorocheti_
Contributor III

After some research and lots of tests, I've managed to get my RT1160 MCU debugging through J-Link. 

The NXP tutorial forgets to mention that you need to uncheck the "Enable auto-debug secondary project(s) for multicore project" checkbox inside the MCUXpresso IDE (“Window” → “Preferences” → “MCUXpresso IDE” → “Debug Options” → “J-Link Options”). After unchecking this option, I was able to debug the CM7 project first, then wait for its debug instance to be ready, and finally debug CM4 project. Now both cores can be debugged simultaneously.

 

View solution in original post

6 Replies
1,332 Views
enricorocheti_
Contributor III

After some research and lots of tests, I've managed to get my RT1160 MCU debugging through J-Link. 

The NXP tutorial forgets to mention that you need to uncheck the "Enable auto-debug secondary project(s) for multicore project" checkbox inside the MCUXpresso IDE (“Window” → “Preferences” → “MCUXpresso IDE” → “Debug Options” → “J-Link Options”). After unchecking this option, I was able to debug the CM7 project first, then wait for its debug instance to be ready, and finally debug CM4 project. Now both cores can be debugged simultaneously.

 

1,334 Views
enricorocheti_
Contributor III

@Omar_Anguiano Hello, do you have any news on this? I would appriciate some help from NXP, like a comprehensive step-by-step tutorial or something like that. 

BTW, I can see that my firmware is uploaded inside the MCU. After debug fails, I reset the EVK board and I can see that my firmware is running on it, but I still can't debug it using JLink.

0 Kudos
Reply
1,571 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Unfortunately, there is a limitation for debugging multicore on Jlink so the steps on the link attached need to be followed.
Which version of Jlink are you using? Is the jlink script used located on the most recent SDK version?

Best regards,
Omar

0 Kudos
Reply
1,527 Views
enricorocheti_
Contributor III

Hi Omar,

I'm using J-Link EDU.

  • Firmware: J-Link EDU Mini V1 compiled Jun 6 2023 10:50:57
  • Hardware version: V1.00

I'm using the script evkmimxrt1160_connect_cm4_cm4side.jlinkscript from SDK v2.13.0 (2023-01-28 version).

The steps in the mentioned tutorial are not clear to me, especially steps 6 and 7. Debugging two projects simultaneously, as the tutorial suggests (first debugging CM7, then switching to CM4 and debugging again), is not working for me, as the IDE pops an error "There is already a debug session running".

It's strange that I had no problems debugging the MIMRX1160-EVK board through this J-Link when the CM4 firmware was uploaded to external RAM. Could you assist me with this?

0 Kudos
Reply
1,488 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

For JLink debugger, un-populate J5-J8.

It is important that the checkbox "attach to a running target" is clear. When starting the debug session for CM7 you need to make sure that the checkbox for the MC4 configuration is clear. 
Once CM7 is on, you could use the function of attach to target or click  Omar_Anguiano_0-1701895308868.png

Best regards,
Omar

 

0 Kudos
Reply
1,464 Views
enricorocheti_
Contributor III

Hi Omar, 

I'm still having trouble with this issue. I've already removed jumpers J5 and J8.

These are the steps that I'm doing: 

  • I uncheck the box "attach to a running target" in "CM4 Jlink Debug.launch" file and I add the jlink script there (evkmimxrt1160_connect_cm4_cm4side.jlinkscript) 
  • I click on CM7 project and debug it using the blue bug button (the same one that you mentioned in your last comment)
  • I wait for CM7 debug circumstance to get ready, then I open the "CM4 Jlink Debug.launch" file and once again I uncheck the box "attach to a running target"
  • I try to run the code and nothing happens. My CM7 firmware gets stucked in the MCMGR_StartCore function and my CM4 firmware doesn't even reach the break point at the first line on main.c function (BOARD_ConfigMPU).

What do you mean by "Once CM7 is on, you could use the function of attach to target or click"? If I start a debug session in CM7, I can't start another one in CM4 as I get the error "There is already a running debug session for the launch configuration".

 

0 Kudos
Reply