Semihosting
Semihosting provides an interface for the debugger to be able to execute system calls in the embedded application on the host machine. The debugger detects system calls, halts the debugged board, then executes the proper system call on the host, pass back the system call’s result for the board, and resumes the board’s execution. The debugger supports a limited amount of system calls, which are the following:
-
Close
-
Lseek
-
Read
-
Write
-
Unlink
-
Fstat
These system calls can be used by calling the appropriate system call function, or by using a library call to printf, fopen, fclose, etc..
Creating a new file
When creating/opening a file, the current active project path is considered, but the file name can be an absolute path too.

Reading/Writing
For writing, the debugger console can be used.

The same is true for reading, the input value is read from the console, and the debugger will wait until it gets the prompt from the user.

