This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cc3220sf 使用fs.h中的sl_write无法将数据写到Flash中?

你好。我使用SDK中的filesystem例程,发现无法将数据写到Flash中。请问下操作是否有问题?代码如下:

char* DeviceFileName = "MyFile.txt";
unsigned long MaxSize = 63 * 1024; //62.5K is max file size
long DeviceFileHandle = -1;
_i32 RetVal; //negative retval is an error
unsigned long Offset = 0;
unsigned char InputBuffer[100];
_u32 MasterToken = 0;
// Create a file and write data. The file in this example is secured, without signature and with a fail safe commit
//create a secure file if not exists and open it for write.
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;
//Preferred in secure file that the Offset and the length will be aligned to 16 bytes.
RetVal = sl_FsWrite( DeviceFileHandle, Offset, (unsigned char *)"HelloWorld", strlen("HelloWorld"));
RetVal = sl_FsClose(DeviceFileHandle, NULL, NULL , 0);
上述这段代码是使用file:///C:/ti/simplelink_cc32xx_sdk_4_30_00_06/docs/wifi_host_driver_api/html/group___file_system.html 文档里面的实例代码的。并且返回的RetVal显示API运行成功,文件已经写入,但是当我打开Uflash在Files里面却看不到MyFile.txt这个文件夹。请问哪里出现了问题