#include #include #define DEBUG_SIZE 100 int debug_putchar(char c, FILE *stream) { (void) stream; //unused volatile static char debug[DEBUG_SIZE]; static uint8_t ptr = 0; debug[ptr++] = c; if (c < 32 || ptr == DEBUG_SIZE) { ptr = 0; (void) debug; } return 0; } int main(void) { static FILE debug_out = FDEV_SETUP_STREAM(debug_putchar, NULL, _FDEV_SETUP_WRITE); stdout = &debug_out; stderr = &debug_out; printf("Hallo\n"); while (1) { } }