The code in question is here: https://sourceforge.net/p/openocd/code/ci/master/tree/src/target/semihosting_common.c#l1122 I would be good to check other syscalls as well.
SEMIHOSTING_SYS_REMOVE does not take `arm semihosting_basedir` into account
I did some investigation on the CH32V series. It seems that they have their own custom protocol completely unrelated to ARM SWD. I have seen it referred to as RVSWD. To complicate things even further, their CH32V003 uses a different single wire transport protocol.
I did some investigation on the CH32V series. It seems that they have their own custom protocol completely unrelated to ARM SWD. I have seen it referred to as RVSWD. To complicate things even further, their CH32V003 uses a different single transport protocol.
I believe this can be fixed by removing making sure the server look does not read the data from the semihosting redirection socket.
Semihosting message redirection TCP server gets the input data flushed before it can be used