SWO Trace Profile/Int empty

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

SWO Trace Profile/Int empty

2,497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Tue Nov 24 06:16:30 MST 2015
Hello.

I am facing a "problem" regarding SWO trace capabilities of LCPXpresso. I have the LPCXpresso v7.9.0 and my MCU is the LPC4337. My Debug launch configuration is selected as SWD and I am using the LPC-Link2 as debug probe.

I did not receive any messages regarding SWD trace errors while debuging and/or starting SWO trace.

I also tried to vary the PC sample rate and nothing appears in both "Profile" and "Int" windows.


Every time that I start a SWD debug connection, in the SWO trace config window, the clock speed in the middle is as I expected but only the "SWD connection" and "clock speed", on the right side, are green. However if I "Enable Profile" and "Stop Profiling" in SWO Profle window (empty data), all lines on the right side in SWO Trace Config window turn green. It seems that needed some window refresh.

Anyome notice this problem?


Best Regards
0 Kudos
Reply
13 Replies

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Thu Dec 03 04:04:45 MST 2015
Hi,

I am using Windows 8.1.

The debug log:

LPCXpresso RedlinkMulti Driver v8.0 (Nov 17 2015 10:18:17 - crt_emu_cm_redlink build 556)
Probe Firmware: LPC-LINK2 CMSIS-DAP V5.134 (NXP Semiconductors)
VID:PID:  1FC9:0090
USB Path: \\?\hid#vid_1fc9&pid_0090&mi_00#8&2380d84a&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Vector catch on SYSRESETREQ signal
Emu(0): Connected&Reset. DpID: 2BA01477. CpuID: 410FC240. Info: <None>
Debug protocol: SWD. RTCK: Disabled. Vector catch: Enabled.
loaded v.2 On-chip Flash Memory C:\nxp\LPCXpresso_8.0.0_526\lpcxpresso\bin\Flash\LPC18x7_43x7_2x512_BootA.cfx
image 'LPC18x7/LPC43x7 2x512KB (Boot Bank A) Nov  2 2015 16:51:57'
NXP: LPC4337  Part ID: 0x006569E4
Connected: was_reset=true. was_stopped=false
LPCXpresso Free License - Download limit is 256K
Writing 4876 bytes to address 0x1A000000 in Flash
Erased/Wrote page  0-0 with 4876 bytes in 349msec
Flash Write Done
Flash Program Summary: 4876 bytes in 0.35 seconds (13.64 KB/sec)
============= SCRIPT: LPC18LPC43InternalFLASHBootResetscript.scp =============
Boot from FLASH image pc/sp reset script
PC = 0x1A00061D
SP = 0x10008000
XPSR = 0x01000000
VTOR = 0x00000000
============= END SCRIPT =====================================================

Stopped: Breakpoint #1


While I was getting the data to give you feedback I used the oscilloscope to see if SWO pin changes its state after starting the SWO Profile. I notice that it changes!

In that data I notice that only the "Empty buffers" changes.

Since the debug log do not shows anyhthing strange I decide to see again my connections between my board and LPC Link 2 and I found my problem! I am using the J6 interface and I notice that my SWO pin had a SC to GND however it was not visible. Thus, I change to another LPCLink 2 (soldering a new J6 connector) and the problem was resolved.

Thanks for your help ;)

Best Regards
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Dec 02 10:33:51 MST 2015
Hi Hugo,

Thanks for the screen capture.

Checking the SWO signal with a scope is a very good idea. I've tried to reproduce your problem here and get profile data out in Windows 7 using a Link II to connect to the LPCXpresso LPC4337 board. Could you confirm your OS and locale.

I noticed that you had the "," as a the decimal symbol so I set my locale to French to check there was no internationalization issue. Il a bien fonctionné (it worked).

One further thing to check is the SWO Stats view (type "Swo Stats" in the quick access search box in the top right toolbar). This should report information about the packets received. A video of this running would be interesting. Note this is different from the "SWO Int Stats" view.

Connect to your target and start profile trace. Open the Swo Stats view

If you see more "bad bytes" being reported than "good bytes" then there is probably a clock configuration issue - i.e. the value of the SystemCoreClock variable read by the detect button is incorrect. Double check the clocking with your scope.

If there are just empty packets being reported then the something is up with the configuration of the ITM. Please could you post a zip of the .log file - it might be worth deleting your old one to remove any old data from it and then attempting the profile again ( see here https://www.lpcware.com/content/faq/lpcxpresso/debug-log )

Ciao,

LPCXpresso Support
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Tue Dec 01 10:29:13 MST 2015
I tested again but know with a simple blinky program. The core frequency was 12 MHz.

I start the SWD trace Profile and nothing appears. In this test I do not lost the debug connection.

I attacth a video that shows my test (opens with windows media player)

I verified again the SWD connection and seems Ok, I have the SWO pin connect to the LPC-Link 2 (when I have opportunity I will verify the SWO signal with an oscilloscope).
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Tue Dec 01 08:25:16 MST 2015

Quote: lpcxpresso-support
Hi Hugo,

While you could be forgiven for thinking this error is undocumented, the key part is 'Target error from status-poll: Ee(FF)' - which means the debugger is no longer able to poll the target.

Such an error will be seen if the target is externally reset or has entered a low power state - where the debug interface is no longer operating.

If this error is generated at exactly the time you start SWO trace capture then clearly some action initiated by the debug tools have caused this to occur.

1 - Can you identify if the target has actually been reset?
2 - This loss of connection appears different from the behavior you reported originally, can you confirm you see different behavior with LPCXpresso V8.00 from the earlier version you were using?

At a fundamental level, when SWO capture is initiated, the debug tools will perform some target configuration and then capture data from the debug connection (SWO/TDO) pin. These actions should not be capable of causing a reset to occur.

I can see no issues with the debug log that you have posted.

My suggestion at this point is that you check the debug circuitry for your board.

Yours,

LPCXpresso Support



I will test and soon I have something I will give feedback.

Best Regards
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri Nov 27 06:57:35 MST 2015
Hi Hugo,

While you could be forgiven for thinking this error is undocumented, the key part is 'Target error from status-poll: Ee(FF)' - which means the debugger is no longer able to poll the target.

Such an error will be seen if the target is externally reset or has entered a low power state - where the debug interface is no longer operating.

If this error is generated at exactly the time you start SWO trace capture then clearly some action initiated by the debug tools have caused this to occur.

1 - Can you identify if the target has actually been reset?
2 - This loss of connection appears different from the behavior you reported originally, can you confirm you see different behavior with LPCXpresso V8.00 from the earlier version you were using?

At a fundamental level, when SWO capture is initiated, the debug tools will perform some target configuration and then capture data from the debug connection (SWO/TDO) pin. These actions should not be capable of causing a reset to occur.

I can see no issues with the debug log that you have posted.

My suggestion at this point is that you check the debug circuitry for your board.

Yours,

LPCXpresso Support




0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Thu Nov 26 11:41:46 MST 2015
Hello,

I have tired test again with a much simpler code (Blinky) but using some of my libraries. The core frequency is at maximum (204MHz) using IRC as clock source. The core frequency is correctely detected by SWO config.

Soon as I start the SWO trace to get data I receive a undocumented error and loose the debug connection. The log is below:

LPCXpresso RedlinkMulti Driver v8.0 (Nov 17 2015 10:18:17 - crt_emu_cm_redlink build 556)
Probe Firmware: LPC-LINK2 CMSIS-DAP V5.134 (NXP Semiconductors)
VID:PID:  1FC9:0090
USB Path: \\?\hid#vid_1fc9&pid_0090&mi_00#8&2380d84a&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Vector catch on SYSRESETREQ signal
Emu(0): Connected&Reset. DpID: 2BA01477. CpuID: 410FC240. Info: <None>
Debug protocol: SWD. RTCK: Disabled. Vector catch: Enabled.
loaded v.2 On-chip Flash Memory C:\nxp\LPCXpresso_8.0.0_526\lpcxpresso\bin\Flash\LPC18x7_43x7_2x512_BootA.cfx
image 'LPC18x7/LPC43x7 2x512KB (Boot Bank A) Nov  2 2015 16:51:57'
NXP: LPC4337  Part ID: 0x002D6B5C
Connected: was_reset=true. was_stopped=false
LPCXpresso Free License - Download limit is 256K
Writing 4876 bytes to address 0x1A000000 in Flash
Erased/Wrote page  0-0 with 4876 bytes in 342msec
Flash Write Done
Flash Program Summary: 4876 bytes in 0.34 seconds (13.92 KB/sec)
============= SCRIPT: LPC18LPC43InternalFLASHBootResetscript.scp =============
Boot from FLASH image pc/sp reset script
PC = 0x1A00061D
SP = 0x10008000
XPSR = 0x01000000
VTOR = 0x00000000
============= END SCRIPT =====================================================


Stopped: Breakpoint #1
Target error from status-poll: Ee(FF). Undocumented error.


I already tried delete the.setting folder as you said using the LPCXpresso 8.0.0
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Nov 26 06:27:27 MST 2015
As we have stated in previous posting:

"And with regards to clock frequency for doing SWO Trace - I'm not sure where the limit of 120 MHz is the user manual comes from. We have not seen any issues doing this at 180 MHz (LPC18xx) / 204 MHz(LPC43xx) in our testing of LPCXpresso's SWO trace functionality."

Yours,

LPCXpresso-support
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Thu Nov 26 04:40:55 MST 2015

Quote:
Just to ask the obvious - your board does have the SWO signal wired up from the debug header to the MCU doesn't it?




Yes the signal is wired ;-)
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Thu Nov 26 04:40:26 MST 2015

Quote: starblue
Did you see this: "The core frequency must be 120 MHz or lower to use the SWO." ? (Description of the SWO pin on page 1372)




I did not notice that :\ The core frequency is arround 202 MHz.  I need to have a overview of my code performance in real conditions. Since timing are critical in my project, 120 MHz is not suitable for debug and get real info.
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Thu Nov 26 01:47:30 MST 2015
Did you see this: "The core frequency must be 120 MHz or lower to use the SWO." ? (Description of the SWO pin on page 1372)
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Wed Nov 25 09:46:37 MST 2015
Just to ask the obvious - your board does have the SWO signal wired up from the debug header to the MCU doesn't it?
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Wed Nov 25 09:07:50 MST 2015
Hello,

1 - I am using a custom board.

2 - I confirm that I use the last version of CMSIS-DAP.

3 -  I will try and soon I have news I let you know.


Best Regards
0 Kudos
Reply

2,345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Nov 25 04:23:33 MST 2015
Hi Hugo,

Please let me rattle through some things to try.

1 - If you are using an LPCXpresso development board, pick a project that is known to work 'out of the box' such as LPCOpen LPC4337 blinky example that is available from the LPCXpresso IDE examples directory.

2 - Ensure that you are using a probe firmware version that is compatible with SWO trace capture. The simplest scheme is to allow LPCXpresso to softload the default debug probe firmware - to achieve this on an LPCXpresso LPC4337 V3 board, ensure the DFULink (above the USB debug connection) is made, and the board has been power cycled. You should be using Probe Firmware: LPC-LINK2 CMSIS-DAP V5.112 (NXP Semiconductors) or later.

If you wish to permanently program debug probe firmware then visit: LPCScrypt, although in general allowing LPCXpresso to softload is preferable.

3 - Force the debugger to re-prompt for clock speed settings. To do this click the project name on the bottom bar of the IDE, this will open the project directory. Then delete the .settings folder. The restart the debug connection, and allow the trace interface to detect the clock frequency.

If you still unable to achieve SWO trace output, please post a copy of the text from your Debug Messages Console - this will start with text similar to "LPCXpresso RedlinkMulti Driver v7.9 (Jul 23 2015 14:19:54) ....."

Finally as you probably know - the latest version of LPCXpresso IDE is currently V7.9.2.

Yours,
LPCXpresso-Support
0 Kudos
Reply