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.

CC3120: File System Is Locked Error is coming

Part Number: CC3120

CC3120 Flash is used to store file data which is used in communication.

To write the file have used below API and its respective comments of the simplelink stack.

- sl_FsOpen((_u8 *)file_name, SL_FS_CREATE| SL_FS_OVERWRITE | SL_FS_CREATE_MAX_SIZE( LEN_128KB ), NULL)

- sl_FsWrite(FileHandle, u32MovingOffset, u8buff, i32Length)

- sl_FsClose(FileHandle, NULL, NULL, 0)

- sl_FsDel((_u8 *)file_name,NULL)

For the first time it works but if i want to delete the same file and write the same "sl_FsOpen" returns the error code shown below.

#define SL_ERROR_FS_FILE_SYSTEM_IS_LOCKED                         (-10299L)

How to fix this error?

My application needs to delete the file and create new file with same name, but the interval is during firmware update each time this activity will be preformed. Due to the above error my Firmware update activity is stoped. And WiFi chip gets disconnected. I will have to remove the CC3120 from the device and replace the new chip due to the File System lock issue.

With regards,

Anuj Shah

  • Hi Anuj,

    I saw you sent me an Email privately so lets continue offline and close this thread.

    Just to reply so others could benefit:

    • a system gets locked mainly for security reasons. Any operation that violates security gets an internal counter to increase and when it gets to 3, the system gets locked. You can read about it on the NWP user guide, chapter 3.3.4.
    • For updating a file with the same filename, there is no need to delete it. As in your case, if you use the flag to create a file but also to overwrite it, then the file gets created if it does not exist and gets overwritten if it already exists. See the code snippet from the host driver below:

    CreateMode = ((OpenMode == (SL_FS_CREATE | SL_FS_OVERWRITE )) ? FS_MODE_OPEN_WRITE_CREATE_IF_NOT_EXIST : FS_MODE_OPEN_CREATE  );

    Regards,

    Shlomi