Re: File system in zephyr flashed on Arduino 101

Thomas, Ramesh

On Tue, Mar 21, 2017 at 21:28:41, Anila Sri wrote:
Can anyone tell me where the file is stored I mean which part if the

On Mar 21, 2017 4:13 PM, "Anila Sri" <anilasri.y1995@...
<mailto:anilasri.y1995@...> > wrote:

I am using zephyr RTOS on Arduino 101. Ihave flashed the file
system code where in the data is written in a file using fs_write as
mentioned in the sample code. The changes I made are :
1. changed FS_SEEK_SET to FS_SEEK_END in fs_seek
2. and not deleting the file after writing
Not clear where you made these changes. Are you referring to the
sample app function test_file_write()?

The problem is that after executing the code the no. of free
blocks reduced from 1700+ to 200 . Now I am not able to retrieve the
blocks again even after deleting. Can anyone help
Not sure what is going on. Assuming the file system got corrupted,
you can try recreating it.

We currently do not have an external API/tool like "format" to recreate
the file system. There is a Jira story for that

For now you can make a temporary change in code to force recreation
of the file system.

In subsys/fs/fat_fs.c, in fs_init() function, comment out

res = f_mount(&fat_fs, "", 1);

and add a line

This will force entry into the if condition block that calls f_mkfs() which
will recreate the file system at the next boot. After one reboot, you
can undo the above changes.

Thanks and Regards,

Join to automatically receive all group messages.