Without this patch, the following simple test would fail to run as expected. #include int main() { int n; printf("Enter a number\n"); scanf("%d", &n); printf("Entered number: %d\n", n); return 0; } If the patch looks good, could someone please commit it on behalf of me as I don't have commit rights. -- 8< -- Currently init_semihosting() assumes the return value from _open() call as the file descriptor handle and that is incorrect. The semihost _open() call returns the fdtable index returned by the __add_fdentry() for the file opened.