HI
I am completely new to keil MCB 4300 !!
im trying to run the USB Host Mass Storage example using j link . but nothing is shown in my debug(printf) viewer !! i tried couple of solutions like this link :
www.keil.com/.../jlink_trace_itm_viewer.htm
but i get the error that says : stdin stdout multiply defined .........
can anyone help me please ?
You need a #pragma to stop in including library stuff in the linker,
/**************************************************************************/ /* Implementation of putchar (also used by printf function to output data) */ int SendChar(int ch) /* Write character to Serial Port */ { ITM_SendChar(ch); // From core_cm4.c return(ch); } /**************************************************************************/ #include <rt_misc.h> #pragma import(__use_no_semihosting_swi) struct __FILE { int handle; /* Add whatever you need here */ }; FILE __stdout; int fputc (int ch, FILE *f) { return (SendChar(ch)); } int ferror (FILE *f) { /* Your implementation of ferror */ return EOF; } void _ttywrch (int ch) { SendChar(ch); } void _sys_exit (int return_code) { for (;;); } /**************************************************************************/
You'll need to #include <stdio.h> and make sure you have the trace clock matching the system clock. There are other retargeting examples, you might want to check those and the documentation.
Sorry to ask this question !!
where should i add this code ? i added the code to mssstorage.c and i got one warning and one error!!
warning : implicit declaration of function itm_sendchar is not valid in c99.
error :.\Output\MassStorage.axf: Error: L6200E: Symbol __stdout multiply defined (by stdio_streams.o and massstorage.o).
could you please help me ?