Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4919

SDK • Need help with SDK and newlib.

$
0
0
Hello everyone,

I'm trying to fill in the stub functions in newlib and the SDK so that I can define custom I/O streams.

I thought I knew what was what but it seems I've missed something vital.

When I do a printf I don't see anything on the output, I've got my code here. the Printf call is writing to my output so I know something is working

Code:

int _write(int fd, void* buf, size_t cnt) {  Printf("_WRITE %u:%s, %d\n\r");  if (fd == STDIN_FILENO) { return EOF; }  if (fd == STDOUT_FILENO || fd == STDERR_FILENO) {     for (size_t i = 0; i < cnt; i++) {        Decode_Character(((char *)buf)[i]);    }    return cnt;   }  fd -= 2;  if (PT_FilePool[fd] == NULL) return set_errno(EBADF);  size_t ret = 0;    FRESULT fr = f_write (PT_FilePool[fd], buf, cnt, &ret);  if ( fr != FR_OK ) return fatfs_error(fr);  return ret;}
what more is needed to make printf call write?

in my code I've added these lines to hopefully see some

Code:

    stdio_init_all();    printf("Hello World!\n\r");    puts("Ready");

Statistics: Posted by DarkElvenAngel — Tue Dec 10, 2024 12:36 am



Viewing all articles
Browse latest Browse all 4919

Trending Articles