Wrong Data from MCUXpresso's SWO Tracing on the RT1176

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

Wrong Data from MCUXpresso's SWO Tracing on the RT1176

Jump to solution
7,041 Views
D_TTSA
Contributor V

Good day

I am debugging an RT1176 processor with NXP's MCU-Link Debug Probe. I would like to obtain detailed information about the interrupts in my project, so I tried to configure the project for SWO Tracing.

These are the steps I followed:

  1. Configure the CSTRACE clock in the “Clocks” ConfigTool view to have a 132MHz frequency:
    D_Tram23_0-1661523317905.png
  2. In the “Pins” ConfigTool view, enable the SWO pin and route it to one of the two given options:
    D_Tram23_1-1661523317957.pngD_Tram23_2-1661523317915.png
  3. In the “Routing details” view in the “Pins” ConfigTool view, the default setup for the pin is given in italics. Click the dropdown menu for each accessible option and re-select the default value. This will change the setup parameters to normal text (not italics). This ensures that the code is generated for these settings. I have previously found that using these ‘default’ (italics) values as is can cause a pin not to work as expected.
  4. Click "Update Code" in the ConfigTools view.
  5. Start a debugging session
  6. In the “SWO Trace Config” window, configure the “Clock speed” to 132MHz.
  7. Use the various SWO Trace views’ start/stop controls to trace

To verify my SWO Tracing setup, I followed the above steps on the eaimxrt1176_cm7 Embedded Artist SDK example project. Note that one must enable the Pins tool for the project before the changes to the pins can be made (because it is an SDK project).

According to the project's main(), the PIT interrupt should occur once per second:

D_Tram23_5-1661525598766.png

However, the trace shows that it only occurs about once every 7s (see "measured interval"):

D_Tram23_4-1661525548259.png

The Cortex M7 core root clock is set to 996MHz. It seems like the SWO tracing is using the core root clock to determine the interrupt timing, instead of the CSTRACE clock. This could explain the multiplier of approximately 7, since 996/132 = 7.54. 

I have the same problem in both MCUXpresso v11.5.1 and MCUXpresso v11.6.0.

Is this a bug in the SWO Tracing of the RT1176? Is there a known fix?

Thanks in advance.

0 Kudos
Reply
1 Solution
6,077 Views
D_TTSA
Contributor V

Good day @Pavel_Hernandez 

Thanks for the help.

This problem is solved in MCUXpresso IDE v11.6.1, as stated in the release notes.

Regards

D_TTSA

View solution in original post

0 Kudos
Reply
25 Replies
6,013 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport
Hello,
Update from IDE team: This fix will be available in 11.6.1 that will be released next week on October 5th/6th. I apologize for the time long this is taking.
Best regards,
Pavel
 
 
0 Kudos
Reply
5,711 Views
johnvanmaanen
Contributor I

Hello Pavel,

Is the update still planned for today? We could really use this function.

Kind regards,

John

 

0 Kudos
Reply
5,708 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, 

I apologize for the inconvenience the IDE team is on Holiday this week.

Best regards,
Pavel

0 Kudos
Reply
6,078 Views
D_TTSA
Contributor V

Good day @Pavel_Hernandez 

Thanks for the help.

This problem is solved in MCUXpresso IDE v11.6.1, as stated in the release notes.

Regards

D_TTSA

0 Kudos
Reply
5,960 Views
D_TTSA
Contributor V

Hi @Pavel_Hernandez 

Thank you for the update. That is good news.

After the release, I will test it and post an update on this thread.

Regards

D_TTSA

0 Kudos
Reply
6,217 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I'm still following your case, I'm working to get a solution to this issue. When I have more comments I will contact you, my I apologize for the inconvenience this may cause.

Best regards,
Pavel

0 Kudos
Reply
6,182 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I talked to the IDE department and they reproduced the same issue they will work on a solution for the next release, unfortunately, we do not have a date for this release, I apologize for the inconvenience this may cause.

Best regards,
Pavel

 

0 Kudos
Reply
6,175 Views
D_TTSA
Contributor V

Hi @Pavel_Hernandez 

Okay, thank you for the update.

So it is an IDE problem then? So we can expect that the MCUXpresso IDE version after v11.6 will include a fix for this?

Would it be possible for you to post in this thread once the fixed MCUXpresso IDE version has been released?

D_TTSA

0 Kudos
Reply
6,162 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

In fact, I pushing to get a temporary path, but I do not warranty for this. I will stay updated on this thread for the permitted time.

Best regards,
Pavel

0 Kudos
Reply
6,638 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

Unfortunately, there is not much information about your specific issue but I find this information maybe could help you, if not please let me know.

How to Enable SWO Trace for i.MX RT10xx Series (nxp.com)

Best regards,
Pavel

0 Kudos
Reply
6,619 Views
D_TTSA
Contributor V

Hi @Pavel_Hernandez 

Unfortunately, that information is not helpful.

I believe that there is a difference between SWO tracing an RT10xx and tracing an RT11xx.

Please escalate this issue.

6,597 Views
D_TTSA
Contributor V

Update @Pavel_Hernandez 

I found this document (attached), which has been recently updated to include a section on how to configure the RT1176 for SWO tracing.

By following these steps exactly, I get the incorrect interrupt timing information (as described in my first post).

Please get back to me as soon as you can.

D_TTSA

0 Kudos
Reply
6,595 Views
D_TTSA
Contributor V

Update @Pavel_Hernandez @jingpan @kerryzhou 

I tested out my earlier hypothesis as to why there is a timing problem.

In the eaimxrt1176_pit_cm7 example, I decreased the M7's clock frequency to 264MHz (I couldn't decrease it to 132MHz because the required prescaler value is out of bounds). I left the CSTRACE clock frequency at 132MHz. I clicked "Update Code" in ConfigTools.

D_Tram23_2-1661848710847.png

I decreased the timer period to 1s:

D_Tram23_0-1661848423632.png

Then I ran the debug again, and again set the SWO config clock speed to 132MHz.

Now the 1s interrupts occur every 1s 999ms - proving that M7_cloc_freq / CSTRACE_clock_freq is the factor that is unaccounted for in the SWO trace's time calculations.

D_Tram23_3-1661848747428.png

I have uploaded my project too, so that NXP can download it and try it out for themselves.

Please could NXP get back to me on this with a fix or work-around, as soon as possible.

0 Kudos
Reply
6,553 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I appreciate all your information, I will check your information and when I have more details I will contact you. I apologize for the time long this maybe will take.

Edit: Let me get in these days an RT1170 to reproduce this issue. Here are other notes in other threads for SWO RT1170.
[SWO with NXP i.MX RT1064-EVK Board - NXP Community] [MCUXpresso IDE SWO Trace Guide (nxp.com)] [How using SWO on RT1170 and MIMXRT1170-EVK board ? - NXP Community] in the 3rd thread review the response from Kerry, maybe could help you.

Best regards,
Pavel

6,543 Views
D_TTSA
Contributor V

Hi @Pavel_Hernandez 

Thanks for the threads. I have read them, and unfortunately they do not address my issue.

So far, I have been working with the MCU-Link external debugger, my employer's own PCB and JTAG connection, and Embedded Artists' RT1176 uCOM board.

However, I have just reproduced the problem on NXP's RT1170-EVK, with the evkmimxrt1170_pit_cm7 SDK example (SDK version 2.12.0).

Follow my steps below:

  1. Using this post by Kerry, I changed the RT1170-EVK's onboard debugger's firmware to LPC-LINK2 CMSIS-DAP. This allows SWO tracing on the EVK with the onboard debugger.
  2. I imported the evkmimxrt1170_pit_cm7 SDK example (SDK version 2.12.0).
    I navigated to the "Pins" perspective of ConfigTools for this project, and "routed" GPIO_LPSR_11 to ARM SWO.
    D_Tram23_4-1662027448568.png
  3. I navigated to the "Clocks" perspective of this project's ConfigTools, and confirmed that the CSTRACE clock has a frequency of 132MHz.
    D_Tram23_3-1662027348607.png
  4. I clicked on the ConfigTools "Update code" button to add the ARM SWO pin configuration to the project's code.
  5. I debugged the project with the onboard debugger (now LPC-LINK2 CMSIS-DAP):D_Tram23_2-1662027281380.png
  6. I opened the "SWO Config" window and clicked on "Change" clock speed, and changed the value to 132MHz.
    D_Tram23_1-1662027230048.png
  7. I navigated to the "SWO Interrupts" window and clicked on the "Resume data display" button (green play button).
  8. I waited for a few minutes, and then I clicked on the "Pause data display" button (yellow pause button).
  9. I clicked on the "Perform Auto Scale" button, and then used the "Horizontal Measurement" button to measure between interrupts. As you can see below, the interrupts are measured as 7s apart:
    D_Tram23_0-1662027183082.png

The SDK example configures these interrupts to occur once per second (1s period), so there is clearly something wrong with the SWO tracing.

The fact that I could reproduce this problem on the RT1170-EVK with its onboard debugger proves that the MCU-Link Debug probe is not the cause of the problem. It also proves that it is not to do with Embedded Artists' RT1176 uCOM board. This allows NXP to debug this internally.

@Pavel_Hernandez  If you follow the above steps, you will be able to recreate my problem on an RT1170-EVK.

Please let me know if you have any further information.

D_TTSA.

0 Kudos
Reply
6,539 Views
D_TTSA
Contributor V

@Pavel_Hernandez 

To further specify the cause of the problem, I followed the above steps, but using the evkmimxrt1170_pit_cm4 SDK example (also using SDK version 2.12.0, RT1170-EVK and its internal debugger with LPC-LINK2 firmware).

Now, the SWO tracing is performed on the Cortex-M4 core.
See the result below:

D_Tram23_0-1662033444216.png

Now the interrupts measure as 2s 975ms apart instead of 1s apart.

This brings me back to one of my first few posts in this thread. I said that I believed that the factor offset is the traced processor core's root clock frequency divided by the CSTRACE clock frequency.

In the evkmimxrt1170_pit_cm4 example,
the Cortex-M4's root clock frequency = 4320/11 = 392.7272...MHz:

D_Tram23_1-1662034067663.png

The CSTRACE clock frequency is still 132MHz.

Therefore, the time factor that is shown in the SWO tracing is:

D_Tram23_2-1662034248517.png

This confirms that my above hypothesis is true - the timing error factor is equal to the traced processor core's root clock frequency divided by the CSTRACE clock frequency.

This also shows that the problem is not specific to the Cortex-M7 core.

I believe it is a problem with the MCUXpresso IDE's SWO tracing software for the RT1176.

Please follow up with the relevant NXP team and get back to me on this.

D_TTSA

0 Kudos
Reply
6,497 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I tested the project your share with us [eaimxrt1176_pit_cm7] and I reproduce the same issue.


 
Updating Media

I will make a report to get more details.

Best regards,
Pavel

 

 

0 Kudos
Reply
6,464 Views
D_TTSA
Contributor V

Hi @Pavel_Hernandez 

Please note that you can also reproduce this by running either the evkmimxrt1170_pit_cm7 project or the evkmimxrt1170_pit_cm4 project on the RT1170-EVK.

Please get back to me as soon as possible regarding this, because I need this feature to debug my own project.

D_TTSA

6,394 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I follow your case, it taking more than I expected, when I have more details I will contact you.

Best regards,
Pavel

0 Kudos
Reply
6,349 Views
D_TTSA
Contributor V

Hi @Pavel_Hernandez 

Okay, please get back to me as soon as possible.

We are waiting on you.

D_TTSA