SWO Support in 7.7.2 ... how?

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

SWO Support in 7.7.2 ... how?

1,751 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mubes on Wed Apr 29 09:15:06 MST 2015
Hi Folks,

I just saw that 7.7.2 has some level of tracing support via SWO so I thought I'd give it a go.  I know it's sticky fingers, but I don't see how I'm supposed to access the functions?

When I click on 'Profile+' with an active debugging session, for example, I just get a message that "SWV is currently only supported via the Red Probe+ debug probe".  I've checked I'm running 7.7.2 and I've power cycled the debug board (LPCLink2) and the target (custom LPC1346) with no effect. I'm on a Mac but have started the app from the shortcut in the subdirectory, as instructed.

Thanks for any guidance.

DAVE
0 Kudos
Reply
6 Replies

1,742 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Apr 30 04:16:38 MST 2015
Glad to hear you are now up and running.

We've now published an FAQ on this too (though for the moment it just duplicates the above information):

http://www.lpcware.com/content/faq/lpcxpresso/swo-trace-setup-lpc13xx

Regards,
LPCXpresso Support
0 Kudos
Reply

1,742 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mubes on Thu Apr 30 01:14:29 MST 2015
Guys,

Although I'm supposed to be working on something else, I couldn't resist giving this a try.  It fixes the problem perfectly and the functionality is very useful indeed.....consequence attached.  Please keep working on this kind of stuff - it truely differentiates you against the competition.

(...and you're right about the SSP0, the major effort in even trying this was to move the SSP0 functions to SSP1  :~ ).

Regards

DAVE


0 Kudos
Reply

1,742 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Apr 30 00:54:00 MST 2015
In addition to configuring P0.9, you also need to need turn on the trace clock. Thus you need some setup code like this:

  volatile unsigned int *TRACECLKDIV = (unsigned int *) 0x400480AC;
  volatile unsigned int *IOCON_PIO_0_9 = (unsigned int *) 0x40044024;
  // Write 1 to TRACECLKDIV  – Trace divider
  *TRACECLKDIV = 1;
  // Write 0x93 to I/O configuration for pin PIO0_9 to select ARM_TRACE_SWV
  *IOCON_PIO_0_9 = 0x93;


Also note that if you are using the SSP0 peripheral, it looks like you won't be able to do SWO trace, as the SWO and MOSI0 signals are only available on the same pin.

We'll look at adding a new FAQ to cover this, and also look at updating the startup code to do this configuration.

[For anyone using LPC1311/13/42/43 rather than LPC1315/16/46/47, on those parts IOCON_PIO_0_9 is at 0x40044064]

Regards,
LPCXpresso Support
0 Kudos
Reply

1,742 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mubes on Wed Apr 29 15:59:02 MST 2015
Grr, now I feel silly, sorry for that. A lot further along now I've RTFM  8-)

I'm running on a 1346, but I seem to be getting empty packets back.  I thought perhaps was that the issue was that IOCON for P0.9 needs to be set to FUNC3 (ARM_TRACE_SWV, Pg 72 of UM10524) but that didn't seem to make any difference either.  According to the scope there's nothing coming out of that pin....more digging I guess. Looking at the functionality it gives, it's going to be worth the effort.

...all lights in the configuration panel are green BTW.

OK, edited with a bit more information.  The value in 0x40044024 is 0x93 and the clock for IOCON is powered up....P0.9 is absolutely flat.  I _have_ checked that this pin is wired through to the LPCLink2 too.

I think it's time to sleep on this.

DAVE
0 Kudos
Reply

1,742 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Apr 29 10:32:05 MST 2015
And the read the FAQs, starting at ...

http://www.lpcware.com/content/faq/lpcxpresso/trace-overview

The classic problem with SWO tracing is not having the SWO pin actually accessible.

Regards,
LPCXpresso Support
0 Kudos
Reply

1,742 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Apr 29 09:32:03 MST 2015
Please read the user guide. It explains exactly what to do and how to use the features.
0 Kudos
Reply