Lauterbach mTrace Setup Manual Download Page 10

10

Embedded Artists LPC4357 Guide

16 October 2013

Trace Examples

All of the previous tutorials have been using the JTAG or SWD interface. The next batch will look at using

the off-chip trace or ETM. The example scripts configure the trace port and pins but the board still needs to

be modified as described on page 4 so that the trace signals are available for the µTrace to capture.

Basic Trace Collection

Select Configuration from the Trace menu. You should get a

window like that in figure T11. Make sure that the METHOD is

set to CAnalyzer and the state is set to OFF. Ensure that the

AutoArm box is ticked. This allows tracing to start and stop as

the target CPU starts and stops.

Start the target and let it run for a few seconds before

stopping it again. There should be a blue bar in the

used

box

to indicate the number of trace records captured. This should

number in the tens or hundreds of thousand for a few

seconds of run time. If it is less than a hundred or so you may

need to check the resistor positioning as there appears to be

no meaningful trace data.

Once you have some trace data captured, click the List

button and see the program flow information. The

window will look like figure T12. Click the

More

or

Less

buttons to filter the amount of information displayed in

the window.

The trace data can be searched. Click the

Find

button

and enter the text “sieve” into the address/expression

box. Then click the

Find All

button. This will show a

window that looks like figure T13 with all occurrences of

calls to the function

sieve

in the trace buffer. Clicking on

any of these will cause the trace listing window to jump to

that point in the buffer so you can see the program flow

around that event.

The

ti.back

column in the search results window shows

the time between function calls. It should average out at

around 72.5us.

By default there is no data trace on the Cortex-M so data reads and writes will not be traced and cannot be

searched for. However, if the DWT on your device supports it you can use a data breakpoint (up to four of

them are allowed for in the Cortex-M specification but the actual number is core specific) to cause a data

trace event to be injected into the trace stream. Care should be taken when doing this as data trace

packets cannot be as easily compressed as the program flow trace packets and you may get an internal

trace FIFO overflow and some data will be lost.

Figure T11: Trace Configuration

Figure T12: Program flow trace

Figure T13: Search Results

10

Embedded Artists LPC4357 Guide

16 October 2013

Trace Examples

All of the previous tutorials have been using the JTAG or SWD interface. The next batch will look at using

the off-chip trace or ETM. The example scripts configure the trace port and pins but the board still needs to

be modified as described on page 4 so that the trace signals are available for the µTrace to capture.

Basic Trace Collection

Select Configuration from the Trace menu. You should get a

window like that in figure T11. Make sure that the METHOD is

set to CAnalyzer and the state is set to OFF. Ensure that the

AutoArm box is ticked. This allows tracing to start and stop as

the target CPU starts and stops.

Start the target and let it run for a few seconds before

stopping it again. There should be a blue bar in the

used

box

to indicate the number of trace records captured. This should

number in the tens or hundreds of thousand for a few

seconds of run time. If it is less than a hundred or so you may

need to check the resistor positioning as there appears to be

no meaningful trace data.

Once you have some trace data captured, click the List

button and see the program flow information. The

window will look like figure T12. Click the

More

or

Less

buttons to filter the amount of information displayed in

the window.

The trace data can be searched. Click the

Find

button

and enter the text “sieve” into the address/expression

box. Then click the

Find All

button. This will show a

window that looks like figure T13 with all occurrences of

calls to the function

sieve

in the trace buffer. Clicking on

any of these will cause the trace listing window to jump to

that point in the buffer so you can see the program flow

around that event.

The

ti.back

column in the search results window shows

the time between function calls. It should average out at

around 72.5us.

By default there is no data trace on the Cortex-M so data reads and writes will not be traced and cannot be

searched for. However, if the DWT on your device supports it you can use a data breakpoint (up to four of

them are allowed for in the Cortex-M specification but the actual number is core specific) to cause a data

trace event to be injected into the trace stream. Care should be taken when doing this as data trace

packets cannot be as easily compressed as the program flow trace packets and you may get an internal

trace FIFO overflow and some data will be lost.

Figure T11: Trace Configuration

Figure T12: Program flow trace

Figure T13: Search Results

10

Embedded Artists LPC4357 Guide

16 October 2013

Trace Examples

All of the previous tutorials have been using the JTAG or SWD interface. The next batch will look at using

the off-chip trace or ETM. The example scripts configure the trace port and pins but the board still needs to

be modified as described on page 4 so that the trace signals are available for the µTrace to capture.

Basic Trace Collection

Select Configuration from the Trace menu. You should get a

window like that in figure T11. Make sure that the METHOD is

set to CAnalyzer and the state is set to OFF. Ensure that the

AutoArm box is ticked. This allows tracing to start and stop as

the target CPU starts and stops.

Start the target and let it run for a few seconds before

stopping it again. There should be a blue bar in the

used

box

to indicate the number of trace records captured. This should

number in the tens or hundreds of thousand for a few

seconds of run time. If it is less than a hundred or so you may

need to check the resistor positioning as there appears to be

no meaningful trace data.

Once you have some trace data captured, click the List

button and see the program flow information. The

window will look like figure T12. Click the

More

or

Less

buttons to filter the amount of information displayed in

the window.

The trace data can be searched. Click the

Find

button

and enter the text “sieve” into the address/expression

box. Then click the

Find All

button. This will show a

window that looks like figure T13 with all occurrences of

calls to the function

sieve

in the trace buffer. Clicking on

any of these will cause the trace listing window to jump to

that point in the buffer so you can see the program flow

around that event.

The

ti.back

column in the search results window shows

the time between function calls. It should average out at

around 72.5us.

By default there is no data trace on the Cortex-M so data reads and writes will not be traced and cannot be

searched for. However, if the DWT on your device supports it you can use a data breakpoint (up to four of

them are allowed for in the Cortex-M specification but the actual number is core specific) to cause a data

trace event to be injected into the trace stream. Care should be taken when doing this as data trace

packets cannot be as easily compressed as the program flow trace packets and you may get an internal

trace FIFO overflow and some data will be lost.

Figure T11: Trace Configuration

Figure T12: Program flow trace

Figure T13: Search Results

Summary of Contents for mTrace

Page 1: ... Embedded Artists LPC4357 development board 1 Embedded Artists LPC4357 Guide 16 October 2013 µTrace setup guide for Embedded Artists LPC4357 development board 1 Embedded Artists LPC4357 Guide 16 October 2013 µTrace setup guide for Embedded Artists LPC4357 development board ...

Page 2: ...rest of this document No changes were made from the default jumper settings Setup Procedures Unzip the archive EA_LPC4357 zip so that it over writes files in the T32SYS directory You may wish to take a backup of this directory beforehand Connect the CombiProbe header to Socket A on the µTrace Connect the CombiProbe header using the MIPI34 MIPI20T adapter to either Socket J1 on the SODIMM board see...

Page 3: ...bottom of the file just before the line that reads ENDDO add a line which reads do startup cmm For now click the LOAD button and browse for the basic_demo t32ini file which is located in T32SYS Eval Boards Embedded Artists LPC4357 directory This will populate some of the fields in the startup window Click the big start button to launch the demo The target will be initialised a small application wi...

Page 4: ...ked by starting TRACE32 and selecting About TRACE32 from the Help menu Figure 7 shows a multi core system with the license highlighted If your system does not have a multi core license please contact your local Lauterbach sales office Contact details can be found at http www lauterbach com sales Before launching the multi core example some changes need to be made to your config t32 file which is l...

Page 5: ...s Embedded Artists LPC4357 Click the big start button After the first core has been initialised and code loaded a second instance of TRACE32 will be started and connected to the Cortex M0 core The symbols will be loaded and you will end up with two instances of TRACE32 looking like Figure 8 These have been resized to make the image fit here The target has been configured so that each core can be s...

Page 6: ...trol of breakpoints select Set from the Break menu see Figure T3 Change the settings to match figure T3 and click OK Start the target running and it will halt at line 681 where the first write of 1 to variable flags 3 occurs Task aware conditional and counting breakpoints can all be set Click the advanced button to access these extra settings Discussion of these options is beyond the scope of this...

Page 7: ...can be dragged to a view or watch window Local and global variables can be shown by selecting the appropriate options from the View or Var menus Right clicking a variable opens up a menu with a number of options for viewing it A few are shown in figure T6 Variables can be displayed graphically in tables can be cast to other variable types Memory can be cast to a variable type for display and there...

Page 8: ...rf Configuration from the Perf menu An entire book could be written on this window alone so instead a few examples will be provided to get you started This is a sample based metric and may or may not be intrusive depending upon the core chosen If the DWT in the chosen core supports the PC Snoop mode the sampling will be made non intrusively This can be checked by opening the Data Watchpoint and Tr...

Page 9: ...te page of the documentation will be opened up in the Acrobat Reader Click and window and press F1 and help for that window will be displayed Additional help can be found on the Help menu including a search capability and a target manual which describes in more detail the debug capabilities of the family of cores you are working with No breakpoints non intrusive memory access dealing with watchdog...

Page 10: ...gram flow information The window will look like figure T12 Click the More or Less buttons to filter the amount of information displayed in the window The trace data can be searched Click the Find button and enter the text sieve into the address expression box Then click the Find All button This will show a window that looks like figure T13 with all occurrences of calls to the function sieve in the...

Page 11: ... available it is easy to get code coverage information Select Add Tracebuffer from the Cov menu This will add the contents of the current trace buffer to the existing code coverage database Like this multiple test runs can be aggregated Now select List functions from the Cov menu You should see a window like that in Figure T15 Any of the functions can be expanded by clicking on the icon to see ind...

Page 12: ...ome trace and then select CTS Settings from the Trace menu You will see a window like that shown in Figure T18 Change the state to ON This will take anything from a few seconds to several minutes to process depending upon how much trace data you have sampled and how fast your connection to the µTrace unit is When it has finished processing the buttons in any List windows will become yellow and som...

Page 13: ...w by clicking the Chart button Right clicking any line of code in the CTS List window or right clicking anywhere in the CTS Chart window will cause a menu to popup Select Set CTS and all windows will be updated to reflect the state of the target as reconstructed at that point in history Using this allows users to quickly zone in the actual cause of a bug rather than just trapping on the subsequent...

Reviews: