Forum Discussion
Altera_Forum
Honored Contributor
21 years agobasics on jffs2
I would like to use jffs2 with ecos on the cycloneII NIOSII development board. I have included jffs2 into the ecos lib. Now I don't know what to do next - I have looked for some documentati...
Altera_Forum
Honored Contributor
21 years agoHi pxs,
> Now I don't know what to do next 1. create a jffs2 filesystem You can create a filesystem image with mkfs.jffs2 and download it to your jffs2 partition. As an alternative, you can simply erase your jffs2 partition. 2. mount the partition You can mount the partition in cycuser_start(). For example:void cyg_user_start(void)
{
...
# ifdef CYGPKG_IO_FILEIO
if (mount ("/dev/flash1", "/", "jffs2") == 0)
chdir ("/");# endif
...
} 3. use the standard routines For example:ret = mkdir ("newdir", S_IRWXU|S_IRWXG|S_IRWXO); /* Create a directory */
ret = rmdir ("olddir"); /* Remove a directory */
ret = rename ("oldname", "newname"); /* Rename a file */
/* ... and so on ... */ Hope this is helpful. Regards, --Scott