Part Number:CC3220SF-LAUNCHXL
Dear Support:
I am using the CC3220SF LP with SDK v1.5 and running into a problem where on a file write to the filesystem, I am getting a offset out of range error when trying to perform a sl_FsWrite(...). The error value is below:
#define SL_ERROR_FS_OFFSET_OUT_OF_RANGE (-10337L)
Below is the code I use to write an array of data to the file:
FsOpenFlags = SL_FS_CREATE | SL_FS_CREATE_MAX_SIZE( 0x5000 ) | SL_FS_OVERWRITE;
hFile = sl_FsOpen( ( uint8_t * )"UserData.txt", FsOpenFlags, (_u32 *)&FLASHFileInfo.Token);
SizeOfHeader = sizeof( A2I200Header );
Status = ( int16_t )sl_FsWrite( ( int32_t )hFile, FileOffset, ( uint8_t * )UserDataPtr, BytesToTransfer );
I am only trying to write 4370 bytes of data to the file and I am doing it in 128 byte chunks. So BytesToTransfer is 128 and UserDataPtr moves through the buffer in RAM every 128 bytes and FileOffset gets incremented by 128 for each sl_FsWrite call. When it fails, FileOffset is at 3588. It is at 3588 instead of 3584, because I write 4 bytes of header information to the filesystem before I go into this loop to transfer the 4370 bytes of data. Do you know why I would be getting this error when my file offset is well below the max size I told it of 0x5000 with the FsOpenFlags? Please advise.
Thanks,
Tim