Presentation is loading. Please wait.

Presentation is loading. Please wait.

MSP432™ MCUs Training Part 14: Serial Wire Output Trace

Similar presentations


Presentation on theme: "MSP432™ MCUs Training Part 14: Serial Wire Output Trace"— Presentation transcript:

1 MSP432™ MCUs Training Part 14: Serial Wire Output Trace
Welcome to the MSP432 MCU Training. This is Part 14 and we will take a look at Serial Wire Output (SWO) Trace.

2 What is Serial Wire Output (SWO) Trace?
A set of debugging tools based on ARM hardware components that allow users to trace the flow of data from a big picture perspective Not related to EnergyTrace+ Both use the PC for data Share the same COM port What is Serial Wire Output (SWO) Trace? SWO Trace is an ARM debugging tool that is provided because the MSP432 has an ARM Cortex-M4 processor. Not related to EnergyTrace+ in any way; only similarities are both use the PC for data, and they share the same COM port

3 ARM CoreSight Components
We can start by looking at ARM CoreSight components in general. CoreSight is what ARM calls their debugging modules. There are many different hardware module options, each with different capabilities.

4 MSP432 Cortex-M4F Components
Specifically, this is what the MSP432 block diagram looks like. The three key modules for SWO Trace are: Data Watchpoint and Trace Unit (DWT), Instrumentation Trace Macrocell (ITM), and Trace Port Interface Unit (TPIU). This diagram shows an Embedded Trace Macrocell (ETM), but the MSP432 processor does not actually have an ETM.

5 Data Watchpoint and Trace Unit (DWT)
Contains 3 configurable comparators: Hardware watchpoint PC sampler event trigger Data address sampler event trigger Counters including: Clock cycles (CYCCNT) Folded instructions Load Store Unit (LSU) Sleep cycles Interrupt overhead First, we can look at the DWT. The DWT contains many triggers and counters that provide data for other modules to use.

6 Instrumentation Trace Macrocell (ITM)
Generates packets of information Sends packets to Serial Wire Output (SWO) DWT creates the hardware-based packets Watchpoints for variables PC sampler event trigger Clock cycle counter Software packets generated by user via code Creates packets when data is sent to ITM ports ITM library can be used to send data to ports This leads into the ITM. The ITM generates hardware and software packets of information that are sent to the TPIU and outputted through the SWO. The DWT provides the data for the hardware packets, and the software packets are generated when information is written to or read from the ITM ports.

7 IDE Implementations Feature Keil uVision IAR Embedded Workbench
Texas Instruments Code Composer Studio Required Hardware Keil ULINK2, Keil ULINKpro, or Segger J-Link Segger J-Link, Segger J-Trace, or IAR i-Jet XDS110 (LaunchPad) or XDS200 Trace Functions Code Coverage Performance Analyzer Execution Profiler Logic Analyzer PC sampling Interrupt logs Data log events ITM Stimulus Ports Statistical Function Profiling Data Variable Trace Interrupt Profiling Custom Core Trace For Keil and IAR, mandatory external hardware is necessary to use SWO Trace. For CCS, you can just use the LaunchPad, which has an XDS110 on it. Alternatively, you can use an XDS200 external debugging probe. The SWO Trace features offered by each IDE are similar, just with different names. This presentation focuses on the CCS implementation, and how to use the CCS usecases.

8 CCS Usecases Statistical Function Profiling Data Variable Tracing
Periodically checks PC PC determines which function Data Variable Tracing Tracks reads/writes to memory location Interrupt Profiling Interrupts noticed by DWT Logged and outputted by ITM Custom Core Trace Tracks writes to ITM ports Can be configured with additional triggers The usecases in CCS are Statistical Function Profiling, Data Variable Tracing, Interrupt Profiling, and a unique, customizable option called Custom Core Trace. For Statistical Function Profiling, the DWT uses the PC Sample Event Trigger and Clock Cycle Counter to periodically sample the PC. From the PC, the system can detect which function the program is currently in. This information is sent to the ITM. For Data Variable Tracing, the DWT tracks reads and writes to a specific memory location and sends the data to the ITM. For Interrupt Profiling, the DWT uses the Interrupt Counter and Interrupt Overhead Counter to track interrupt enters and exits. The ITM logs this information and outputs it. Custom Core Trace at the most basic level tracks software writes to the ITM ports. It can be configured with the additional other DWT triggers, though.

9 CCS Usecases Statistical Function Profiling Data Variable Tracing
Shows functions called and frequency of each Which functions are more crucial Data Variable Tracing Big picture view of changes to a variable over time Interrupt Profiling Understand priorities and preempting of interrupts Observe when interrupts were entered and exited Custom Core Trace Similar to printf style debugging, so more user control Allows use of more than one of the other usecases at the same time What does this mean? Statistical Function Profiling tracks function calling and frequency, so you can see which functions are most crucial for the program. You can focus your efforts on those functions for lowering power usage and other things. Data Variable Tracing lets you see the large-scale view of what is going on to a variable or memory location. This lets you see if it is doing the right thing. Interrupt Profiling shows you when interrupts were entered or exited, and the priorities for preempting each other. This makes sure your priorities are set up correctly. Custom Core Trace is like printf style debugging, but with its customization options, you can run more than one of the other three usecases at the same time. You can also track more than one variable or memory location at the same time.

10 Out of Box Experience Demo
To demonstrate the four CCS usecases, we can use the Out of Box Experience project from MSPWare. Slides will be done via CCS screen capture, but they essentially walk users through the basic demonstration. Notes will resume on Slide 21.

11 Out of Box Experience Demo

12 Out of Box Experience Demo

13 Out of Box Experience Demo

14 Statistical Function Profiling
Leave the default configuration Start the program Let the red LED blink 10 times Suspend the program

15 Data Variable Trace Set the variable address to “&taps”
Start the program Push SW1 as many times as you want Suspend the program

16 Interrupt Profiling No configuration necessary Start the program
Let the red LED blink 10 times Suspend the program

17 Interrupt Profiling No configuration necessary Start the program
Toggle switches randomly and quickly Suspend the program

18 Custom Core Trace Include the ITM library Insert the following code

19 Custom Core Trace No configuration necessary Start the program
Wait a few seconds Suspend the program

20 Configuring Custom Core Trace
Custom Core Trace  Advanced Settings Create new triggers Use hardware counters and triggers to make events happen

21 Configuring Custom Core Trace
Replicate the three defined usecases with these trigger settings Allows user to use multiple defined usecases at the same time Can trace multiple variables at the same time To replicate the three defined usecases, so you can use them at the same time in Custom Core Trace, these are the default settings. For PC Trace, users can adjust the Clock Interval for how often they want the PC to be sampled. For Data Variable Trace, the Location needs to be set as either a hexadecimal memory location or a pointer to a variable. For Interrupt Profiling, no settings should be changed from what is shown in this image.

22 Summary SWO Trace allows you to maximize use of MSP432 hardware components Provides users with a big-picture view of software Easy to use with LaunchPad; no additional hardware required CCS offers: Three easy to use defined usecases Custom Core Trace for advanced configuration References: TI Application Note: ARM Application Note: IAR Application Note: In summary, SWO Trace is a powerful tool offered by ARM hardware that lets users see the large-scale view of what is going on. It is easy to use with the MSP432 LaunchPad, and offers three predefined, easy to use usecases, and Custom Core Trace, a powerful, configurable usecase.


Download ppt "MSP432™ MCUs Training Part 14: Serial Wire Output Trace"

Similar presentations


Ads by Google