This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

fwrite does not result in call to retargetted _sys_write

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