2014-02-23 01:25 AM
Can you advise
some
example that
would use the
SWO
port
for
output from the
program
in
UART
mode
?
Ideal
for
STM32F1
and
MDK
-ARM
2014-02-23 05:48 AM
Make sure to set up the trace mode with the correct processor frequency, and checked options
http://www.keil.com/download/files/labst.pdf
The following allows putchar/printf to function:#include <
stdio.h
>
#include <
rt_misc.h
>
#pragma import(__use_no_semihosting_swi)
struct __FILE { int handle; /* Add whatever you need here */ };
FILE __stdout;
FILE __stdin;
int fputc(int ch, FILE *f)
{
ITM_SendChar(ch);
return(ch);
}
int fgetc(FILE *f)
{
char ch;
ch = 1;
return((int)ch);
}
int ferror(FILE *f)
{
/* Your implementation of ferror */
return EOF;
}
void _ttywrch(int ch)
{
ITM_SendChar(ch);
}
void _sys_exit(int return_code)
{
label: goto label; /* endless loop */
}