Datasheet

Copyright © 2013 ARM Ltd. All rights reserved
CAN: Controller Area Network Lab using ST STM32 Cortex-M processors. www.keil.com
24
Data Tracing: displaying the data writes…
The ARM CoreSight technology with the STM32 family also includes data tracing – and of course, it is in real-time.
1. Open Debug/Debug Settings and select the Trace tab. Select “on Data R/W sample”. Click OK.
2. Select OK when a window opens asking to stop the program and take new values.
3. Find the global variables val_Tx and val_Rx in CanDemo.c.
4. Right click on val_Tx and select Add val_Tx to… and then select Logic Analyzer. Repeat for val_Rx.
TIP: You can add up to four variables for display in the LA.
5. A Logic Analyzer window like the one shown below will open. Adjust the window height if necessary.
6. Click on Setup and highlight val_Tx. Set Display Range Max: to 0x0F. Repeat for val_Rx. Click on Close.
7. Click on Out or In until Range: equals 0.5 s or so.
8. Click Run.
Shown here is an
example display:
9. Select the four boxes on the
right and move the cursor over
the waveform. You can stop the
data selection with the Update
Screen: STOP icon. This leaves
the program running.
10. You should be able to determine
the time between each CAN message. With a scope, I got 191 msec.
11. Click on the arrow beside the Trace icon and select Trace Records.
Trace Records below will open.
12. Right click in this window and unselect ITM Events. You could also unselect ITM 0 in the Trace Config window.
13. What we are seeing in the Trace Records columns:
Address: The physical address of the variables val_Tx (0x2000002C) and val_Rx (0x20000030).
Data: The data values being read or written.
PC: the address of the instruction responsible for the read or write cycle. This was activated by the setting “on Data
R/W Sample”.
Cycles and Time: when the operations occurred. Time(s) comes from the box t1: in the main µVision window.
The X in DLY indicates a delay in the timestamp.
TIP: It is not possible to send everything out
the SWV. Overflows are common and normal
with SWV and it is good practice to limit what
information you ask to be sent out. A
ULINKpro using the 4 bit Trace Port has a
greater bandwidth to display SWV frames.
Limit how many boxes you check to the
necessities. Overflows are indicated in the Ovf
column in the Trace Records window. µVision
recovers gracefully from these overflows.
TIP: Right click in the Trace Records window
and you can filter out those types of records
you do not want to see. It is better if you
unselect them in the Trace Config window to not send them in the first place.
Filtering in the Trace Records does stop the time consumed outputting these frames: it merely prevents them being displayed.
Note: Currently only Data Write frames are displayed. Data Read frames are not displayed to reduce the traffic on the SWO
pin. This might be added soon to µVision.