+ All Categories
Home > Documents > MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

Date post: 14-Dec-2015
Category:
Upload: sherman-walton
View: 224 times
Download: 0 times
Share this document with a friend
Popular Tags:
22
MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1
Transcript
Page 1: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

MSP432™ MCUs TrainingPart 14: Serial Wire Output Trace

1

Page 2: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

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.

ARM CoreSight Components

3

Page 4: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

MSP432 Cortex-M4F Components

4

Page 5: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

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.

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.

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.

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.

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.

Out of Box Experience Demo

10

Page 11: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

Out of Box Experience Demo

11

Page 12: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

Out of Box Experience Demo

12

Page 13: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

Out of Box Experience Demo

13

Page 14: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

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.

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.

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.

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.

Custom Core Trace• Include the ITM library

• Insert the following code

18

Page 19: MSP432™ MCUs Training Part 14: Serial Wire Output Trace 1.

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.

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.

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.

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


Recommended