Hi guys,
First of all, I'm using a LPC1768 development board in combination with a JLink Debugger which supports ITM-Debugging over printf. I'm using Keil MDK 4.10.
Using a direct call of ITM_SendChar() works. The character is displayed in KEIL IDE.
For using this putchar function I have to implement fputc()
int fputc(int ch, FILE *f) { return (ITM_SendChar(ch)); }
If i call printf() my prgram doesn't work. The debugger tells me that is stops at <pre 0x00000E48 BEAB BKPT 0xAB0
Can you help me that printf() works?
Thanks in advance! Best regards from Austria Robert
A bit more retargeting is required (not just fputc).
Take a look at the example \ARM\Boards\Keil\MCB1700\Blinky in the MKD-ARM installation. It uses printf via ITM.
Thanks for help. I forgot to define stdout. stdin-debugging isn't possible over ITM. Is that right. So i don't need the declaration of stdin and implementation fgetc.
What do _ttywrch() and _sys_exit() do? I used ITM a year before and I rememeber that I don used them. I didn't use ferror() too.
regards Robert
You should retarget most of those functions to avoid semihosting.
_ttywrch(): http://www.keil.com/support/man/docs/armlib/armlib_cihefgih.htm _sys_exit(): http://www.keil.com/support/man/docs/armlib/armlib_cihcecgg.htm