Tool/software:
Dear TI support team,
I hope this message finds you well. I am reaching out with a query regarding the file write operation on the CC3235SF. Specifically, I would like to know the maximum number of times a file can be rewritten.
For context, I am referring to the following code:
/**
* \return File handle on success. Negative error code on failure
*
* \sa sl_FsRead, sl_FsWrite, sl_FsClose
* \note Belongs to \ref basic_api
* \warning None
*
* \par Example
*
* - Creating a file and writing data to it
*/
char* DeviceFileName = "MyFile.txt";
unsigned long MaxSize = 63 * 1024; // 62.5KB is the max file size
long DeviceFileHandle = -1;
_i32 RetVal; // Negative return value indicates error
unsigned long Offset = 0;
unsigned char InputBuffer[100];
_u32 MasterToken = 0;
// Create a secure file if it doesn't exist and open it for writing
DeviceFileHandle = sl_FsOpen((unsigned char *)DeviceFileName,
SL_FS_CREATE | SL_FS_OVERWRITE | SL_FS_CREATE_SECURE | SL_FS_CREATE_NOSIGNATURE | SL_FS_CREATE_MAX_SIZE(MaxSize),
&MasterToken);
Offset = 0;
// It is preferred that the Offset and length be aligned to 16 bytes in secure files
RetVal = sl_FsWrite(DeviceFileHandle, Offset, (unsigned char *)"HelloWorld", strlen("HelloWorld"));
RetVal = sl_FsClose(DeviceFileHandle, NULL, NULL , 0);
// Open the same file for reading, using the Token obtained during creation
DeviceFileHandle = sl_FsOpen((unsigned char *)DeviceFileName, SL_FS_READ, &MasterToken);
Offset = 0;
RetVal = sl_FsRead(DeviceFileHandle, Offset, (unsigned char *)InputBuffer, strlen("HelloWorld"));
RetVal = sl_FsClose(DeviceFileHandle, NULL, NULL , 0);
Could you kindly clarify the limitations on the number of rewrites for a file created in this manner?
Thank you for your assistance, and I look forward to your response.