---
** [tickets:#232] semihosting_fileio read return wrong number of read bytes**
**Status:** new
**Milestone:** 0.9.0
**Created:** Sun Apr 21, 2019 04:18 PM UTC by hogthrob
**Last Updated:** Sun Apr 21, 2019 04:18 PM UTC
**Owner:** nobody
The current implementation of read for semihosting_f
Sure. In order to understand this patch, you have to read the comments given on
first half of the SYS_READ in the same file somewhere above explaining the GDB
protocol return value for SYS_READ
The GDB remote semihosting protocol implements SYS_READ but returns the
(requested bytes - actually
Well, we both are right, sort of (you more, I less, the fix: absolutely):
https://github.com/db4ple/openocd/blob/0a87bac689a271c8e6fb97a48ee23e4d019a4438/src/target/semihosting_common.c#L789
You are right, it is not directly refering to the GDB protocol.
In fact my assumptions were wrong, t
I will not use Gerrit, as it exposes more personal information than I want it
to. It not even allows me to delete my account, should have checked this
before.
Sorry, but take my patch or leave it. It is just two lines.
---
** [tickets:#232] semihosting_fileio read return wrong number of
Hi Liviu,
I know. Thanks for the discussion in any case.
---
** [tickets:#232] semihosting_fileio read return wrong number of read bytes**
**Status:** new
**Milestone:** 0.9.0
**Created:** Sun Apr 21, 2019 04:18 PM UTC by hogthrob
**Last Updated:** Sun Apr 21, 2019 09:53 PM UTC
**Owner:** nobod
BTW, how to test semihosting via GDB is simple:
Assuming you have a STM32 semihosted application (in .elf) and openocd is
running:
arm-none-eabi-gdb
...
target remote :
monitor arm semihosting enable
monitor arm semihosting_fileio enable
load
continue
...
Now your file IO is done through