cc3200文件操作问题
各位TI工程师:
你好!
我现在从服务器上接收500k左右的文件,写入FLASH中,但是在写入69k左右的时候报错,无法再写入了,文件系统操作对写入大小有限制吗?
望解答,感谢!
写文件函数:
long FL_FileWrite(FileInfo *_iFile,_u32 *token,long *filehandle,_u8 state)
{
long lRetVal = -1;
switch(state)
{
case FILE_CREATE:
lRetVal = sl_FsOpen((unsigned char *)RecvieSeverFileName,FS_MODE_OPEN_CREATE(1024*512,_FS_FILE_OPEN_FLAG_COMMIT|_FS_FILE_PUBLIC_WRITE),
token,
filehandle);
if(lRetVal < 0)
{
lRetVal = sl_FsClose(*filehandle, 0, 0, 0);
ASSERT_ON_ERROR(lRetVal);
}
else
{
lRetVal = sl_FsClose(*filehandle, 0, 0, 0);
if (SL_RET_CODE_OK != lRetVal)
{
ASSERT_ON_ERROR(FILE_CLOSE_ERROR);
}
_iFile->fileLeng = 0;
}
break;
case FILE_OPEN:
lRetVal = sl_FsOpen((unsigned char *)RecvieSeverFileName,FS_MODE_OPEN_WRITE,token,filehandle);
if(lRetVal < 0)
{
lRetVal = sl_FsClose(*filehandle, 0, 0, 0);
ASSERT_ON_ERROR(FILE_OPEN_WRITE_FAILED);
}
case FILE_WRITE:
lRetVal = sl_FsWrite(*filehandle,(unsigned int)_iFile->fileLeng, (unsigned char *)_iFile->Buffer,_iFile->fileBlock);
if (lRetVal < 0)
{
lRetVal = sl_FsClose(*filehandle, 0, 0, 0);
ASSERT_ON_ERROR(FILE_WRITE_FAILED);
}
break;
case FILE_CLOSE:
lRetVal = sl_FsClose(*filehandle, 0, 0, 0);
if (SL_RET_CODE_OK != lRetVal)
{
ASSERT_ON_ERROR(FILE_CLOSE_ERROR);
}
break;
default:
break;
}
return SUCCESS;
}
找到问题了