I have retargetted streamed io as per the following article.
infocenter.arm.com/.../index.jsp
I have added some simple test code as follows:
FILE * pFile; char buffer[] = { 'x' , 'y' , 'z' }; pFile = fopen ("Results.txt", "wb"); fwrite (buffer , sizeof(char), sizeof(buffer), pFile); fclose (pFile);
When this runs using breakpoints in the debugger I can see that my retargetted _sys_open and _sys_close are called as expected (following the calls to fopen and fclose above), however the call to fwrite does not result in a call to _sys_write and I can not understand why?
int _sys_write(FILEHANDLE fh, const unsigned char * buf, unsigned len, int mode) { return 0; }
Any help would be much appreciated.
Thanks, Andy
To potentially answer my own question...
Possibly the answer is that fwrite calls fputc rather than _sys_write?
http://www.keil.com/support/man/docs/armlib/armlib_chdheidg.htm
If so, when would _sys_write be called?