Datasheet
Copyright © 2013 ARM Ltd. All rights reserved
CAN: Controller Area Network Lab using ST STM32 Cortex-M processors. www.keil.com
18
Viewing the CAN Frames with the Logic Analyzer (LA):
µVision has a Logic Analyzer (LA). This feature is also available using Serial Wire Viewer (SWV) on a real processor or the
simulator. You will also get the LA working with the Discovery board. ST-LINK V2 supports SWV. V1 does not. All Keil
ULINKs and J-Link (black case V 6 and later) support SWV. This is a very powerful ARM CoreSight debugging feature.
1. Close the Trace Data window and remove all breakpoints. (Type Ctrl-B). Click on RUN.
2. You can configure the LA while the program is running or while it is stopped.
3. Can_Demo.c has two global variables val_Tx and val_Rx. Find where these are declared near line 28.
4. Right click on val_Tx and select Add val_Tx to… and select Logic Analyzer. This will also open the LA up.
5. Repeat for val_Rx. Both variables will now be visible in the LA as shown below. Adjust the LA window size.
6. Adjust the range: Click on Setup… and highlight each variable in turn and set Display Range: MAX: to 0xFF.
7. Click on Close to return to the main µVision window. Select File/Save All. (optional)
8. If the program is not running, click on RUN to start it.
9. Click on Analog sweep 0…3.3V in the Toolbox as shown here:
10. Click on Zoom All and/or IN and Out to get an appropriate screen as shown below.
11. The values of the CAN Data byte 1 are displayed as they change.
12. You can select Signal Info, Show Cycles, Amplitude and Cursor.
13. Click on Stop in Update Screen if desired. You can also stop the program if you prefer.
14. Select Signal Info, Show Cycles, Amplitude and Cursor.
15. Move your cursor over the waveform to see the effects and the information about timings provided shown below:
TIP: If you have more than one CAN
controller in your processor you can
operate these as parallel receivers. Divide
the messages up with the Acceptance
Filters. This will help capture all the
messages on a very busy bus without
losing any. Each CAN controller will
handle its share of the messages. This
effectively multiplies the number of FIFO
buffer memories which is an excellent
method of capturing all the CAN frames.