User manual
Table Of Contents
- 1. Introduction
- 2. Raisonance tools for ARM overview
- 3. How to register the new Raisonance tools for ARM
- 4. Creating a project
- 5. Debugging with the simulator
- 6. Debugging with hardware tools
- 6.1 Selecting hardware debugging tools
- 6.2 RLink-ARM programming and debugging features
- 6.3 JTAGjet programming and debugging features
- 6.4 Cortex Serial Wire Viewer (SWV) debugging features (Open4 RLink only)
- 6.4.1 Introduction
- 6.4.2 Hardware requirements
- 6.4.3 Configure Ride7 to use the SWV
- 6.4.4 Modify your application to use SWV software traces
- 6.4.5 Configure Ride7 to use SWV software traces
- 6.4.6 Configuring Ride7 to use the SWV hardware traces
- 6.4.7 Configuring Ride7 to use the SWV watchpoint traces
- 6.4.8 Start / Stop the trace
- 6.4.9 Visualizing SWV traces with Ride7
- 7. Raisonance solutions for ARM upgrades
- 8. Conformity
- 9. Glossary
- 10. Index
- 11. History

Raisonance Tools for ARM 6. Debugging with hardware tools
This panel configures the Serial Wire Output:
• Check the Enable option if you want to use the SWO for SWV traces.
• Enter the CPU clock frequency of your target in kHz (72 MHz in this
example). This information is necessary for the RLink to set the speed of the
SWO asynchronous communication port.
• If you leave Auto checked, the system sets the maximum speed to 4.50
MHz (default value of SWO Clock). To change it, uncheck Auto, and enter
the desired value in the SWO Clock field. SWO clock must be a sub-
multiple of CPU clock, so this value may be adjusted by the system.
Note: Be careful that the CPU clock set in the configuration dialog box equals the real CPU clock of your
target, or else the data will not be correctly interpreted.
6.4.4 Modify your application to use SWV software traces
Before sending data to the debugger through the SWO, you must add some code to your application.
Use the ITM_SendChar function (provided by the CMSIS library for printf-style output) to send a
character string to the ITM channel n° 0.
Example 1:
while(*str)
{
ITM_SendChar(*str);
str++;
}
Example 2:
You can also send data of different types (byte, half word or word) to the channel of your choice (0 to
31) using the function as described below:
// Write to the SWO through a specific ITM port
WriteITM(uint32_t val, uint32_t port)
{
if ( (CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA) // Trace enable ?
&& (ITM->TCR & ITM_TCR_ITMENA) // ITM enable ?
&& (ITM->TER & (1UL << port)) ) // ITM port enable ?
{
while (ITM->PORT[port].u32 == 0); // ITM port free ?
// ITM->PORT[port].u32 = val; // Write 32 bits value
// ITM->PORT[port].u16 = (u16) val; // Write 16 bits value
ITM->PORT[port].u8 = (u8) val; // Write 8 bits value
}
}
This function verifies if the trace, ITM modules and the desired channel are enabled. It then waits for
the channel release and sends 8-, 16- or 32-bit values.
Note: Two ITM communication channels are used by CMSIS to output the following information:
- ITM channel 0: for printf-style output via the debug interface,
- ITM channel 31: reserved for RTOS kernel awareness debugging.
- 33 -