MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.
-
Upload
sherman-walton -
Category
Documents
-
view
224 -
download
0
Transcript of MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.
![Page 1: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/1.jpg)
MSP432™ MCUs TrainingPart 14: Serial Wire Output Trace
1
![Page 2: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/2.jpg)
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
2
![Page 3: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/3.jpg)
ARM CoreSight Components
3
![Page 4: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/4.jpg)
MSP432 Cortex-M4F Components
4
![Page 5: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/5.jpg)
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
5
![Page 6: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/6.jpg)
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
6
![Page 7: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/7.jpg)
IDE Implementations
7
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
![Page 8: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/8.jpg)
CCS Usecases• Statistical Function Profiling
– 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
8
![Page 9: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/9.jpg)
CCS Usecases• Statistical Function Profiling
– 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 9
![Page 10: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/10.jpg)
Out of Box Experience Demo
10
![Page 11: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/11.jpg)
Out of Box Experience Demo
11
![Page 12: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/12.jpg)
Out of Box Experience Demo
12
![Page 13: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/13.jpg)
Out of Box Experience Demo
13
![Page 14: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/14.jpg)
Statistical Function Profiling• Leave the default configuration• Start the program• Let the red LED blink 10 times• Suspend the program
14
![Page 15: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/15.jpg)
Data Variable Trace• Set the variable address to “&taps”• Start the program• Push SW1 as many times as you want• Suspend the program
15
![Page 16: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/16.jpg)
Interrupt Profiling• No configuration necessary• Start the program• Let the red LED blink 10 times• Suspend the program
16
![Page 17: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/17.jpg)
Interrupt Profiling• No configuration necessary• Start the program• Toggle switches randomly and quickly• Suspend the program
17
![Page 18: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/18.jpg)
Custom Core Trace• Include the ITM library
• Insert the following code
18
![Page 19: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/19.jpg)
Custom Core Trace• No configuration necessary• Start the program• Wait a few seconds• Suspend the program
19
![Page 20: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/20.jpg)
Configuring Custom Core Trace• Custom Core Trace Advanced Settings• Create new triggers• Use hardware counters
and triggers to makeevents happen
20
![Page 21: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/21.jpg)
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 time21
![Page 22: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.](https://reader035.fdocuments.in/reader035/viewer/2022081506/56649f425503460f94c61454/html5/thumbnails/22.jpg)
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: http://www.ti.com/lit/pdf/slaa674– ARM Application Note: http://www.keil.com/uvision/db_anl.asp– IAR Application Note: http://
supp.iar.com/FilesPublic/UPDINFO/005405/arm/doc/EWARM_UserGuide_AddOn1.ENU.pdf 22