460
Return value
Operation result is written to register R0 by the debugger.
== 0
O.K.
!= 0
Number of bytes to write left (in case not all bytes could be written)
19.4.7 Command SYS_READ (0x06)
Reads a given number of bytes from a file that has been previously opened via
SYS_OPEN . Exceptions: Handle 0-2 which specify stdin, stdout, stderr (in this order)
do not require to be opened with SYS_OPEN before used. This command behaves com-
patible to the ANSI C function fread() meaning that reading is started at the last
position of the read pointer on the host.
Register R1 holds a pointer to an address on the target, that specifies a 3-word (32-
bit each) buffer where additional information for the command can be found.
Word 0
Handle of the file to be read.
Word 1
Pointer to a buffer on the target where data from file is written to.
Word 2
Number of bytes to read
Return value
Operation result is written to register R0 by the debugger.
== 0
O.K.
Number of bytes to read left (in case not all bytes could be read). If identi-
!= 0
cal to the number of bytes to be read, read pointer was pointing to end-of-
file and no bytes have been read.
19.4.8 Command SYS_READC (0x07)
Reads a single character from the debug channel on the host (usually stdin).
Register R1 is set to 0.
Return value
Character that has been read is written to register R0.
19.4.9 Command SYS_ISTTY (0x09)
Checks if a given handle is an "interactive device" (stdin, stdout, ...).
Register R1 holds a pointer to an address on the target, that specifies a 1-word (32-
bit each) buffer where additional information for the command can be found.
Word 0
Handle of the file to be checked.
Return value
Operation result is written to register R0 by the debugger.
== 1
O.K., given handle is an interactive device.
== 0
O.K., given handle is not an interactive device.
Else
Error
J-Link / J-Trace (UM08001)
CHAPTER 19
© 2004-2017 SEGGER Microcontroller GmbH & Co. KG
Semihosting
Need help?
Do you have a question about the J-Link and is the answer not in the manual?
Questions and answers