Printf debugging
AN4989
74/118
AN4989 Rev 3
Figure 52. IAR™ EWARM SWO Clock setting
Once configured, IAR™ EWARM properly sets TRACE_IOEN and TRACE_MODE and
configures the related GPIO.
SWO printf occurrences are visible in Terminal I/O windows.
Port Stimulus 0 is used by printf and scanf. It is not configurable.
Keil
®
MDK-Arm µVISION:
In MDK-Arm it is required to redirect printf to SWO by some piece of code following same
model as for UART (Refer to
Section 7.2: Printf via UART on page 69
)
#include "stdio.h"
int fputc(int ch, FILE *f)
{
ITM_SendChar(ch);
return(ch);
}
Keil
®
must be properly configured for the SWO communication to be properly set. An
example is given in
In
Projet Option
->
Debug
->
Probe Settings
->
Trace Pane:
1.
Tick Trace Enable
2. Enter correct Core Clock
3. Enable ITM Stimulus Port 0