You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Flavio Castro Alves Filho <fl...@gmail.com> on 2021/04/28 12:03:27 UTC

Replacing SmartFS to LittleFS

Hello,

Today my application uses SmartFS associated with MX25L SPI Dataflash.

I intend to replace the SmartFS to LittleFS.

In the filesystem section of menuconfig, I can disable
CONFIG_FS_SMARTFS and enable CONFIG_FS_SMARTFS.

But when I go to "Device Drivers" --> "Memory Technology Device (MTD)
Support", there is an option CONFIG_MTD_SMART.

Is there any equivalent configuration for LittleFS?

After enabling the LittleFS, is there anything that must be done at
the board code to enable it?

Best Regards,

Flavio


-- 
Flavio de Castro Alves Filho

flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves

Re: Replacing SmartFS to LittleFS

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
Hello Xiang,

> >
> Yes, if you just want to create an empty littlefs partition, littlefs
> driver can do it without the userspace tool assistance.
> Either run the mount command from nsh:
> mount -t littlefs -o autoformat /dev/mtd /mnt
> Or call mount function from board_initialize like this:
> mount("/dev/mtd", "/mnt", "littlefs", 0, "autoformat");
>

I believe that is enough for me.

Thank you very much.

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves

Re: Replacing SmartFS to LittleFS

Posted by Xiang Xiao <xi...@gmail.com>.
On Thu, Apr 29, 2021 at 8:12 AM Flavio Castro Alves Filho <
flavio.alves@gmail.com> wrote:

> Hello Xiang,
>
> Thank you for your quick response.
>
> How do I manage the format of a littlefs 'disk' from programming (not
> nutshell) ?
>
>
If you want to generate the initial littlefs image in host environment like
genromfs, you can try this tool:
https://github.com/earlephilhower/mklittlefs


> I am looking for something similar to 'mksmatfs' function.
>
> Or only the flash_eraseall function is enough? Or should I add the "-o
> autoformat" option on the last parameter of the mount() function?
>
>
Yes, if you just want to create an empty littlefs partition, littlefs
driver can do it without the userspace tool assistance.
Either run the mount command from nsh:
mount -t littlefs -o autoformat /dev/mtd /mnt
Or call mount function from board_initialize like this:
mount("/dev/mtd", "/mnt", "littlefs", 0, "autoformat");


> Best regards,
>
> Flavio
>
>
> Em qua., 28 de abr. de 2021 às 09:33, Xiang Xiao
> <xi...@gmail.com> escreveu:
> >
> > LittleFS can talk directly with the standard MTD driver, so you just
> need:
> >
> >    1. Call register_mtddriver in your board file
> >    2. Run mount from nsh like this:
> >
> >            mount -t littlefs -o autoformat /dev/mtd /mnt
> >
> >
> > On Wed, Apr 28, 2021 at 8:03 PM Flavio Castro Alves Filho <
> > flavio.alves@gmail.com> wrote:
> >
> > > Hello,
> > >
> > > Today my application uses SmartFS associated with MX25L SPI Dataflash.
> > >
> > > I intend to replace the SmartFS to LittleFS.
> > >
> > > In the filesystem section of menuconfig, I can disable
> > > CONFIG_FS_SMARTFS and enable CONFIG_FS_SMARTFS.
> > >
> > > But when I go to "Device Drivers" --> "Memory Technology Device (MTD)
> > > Support", there is an option CONFIG_MTD_SMART.
> > >
> > > Is there any equivalent configuration for LittleFS?
> > >
> > > After enabling the LittleFS, is there anything that must be done at
> > > the board code to enable it?
> > >
> > > Best Regards,
> > >
> > > Flavio
> > >
> > >
> > > --
> > > Flavio de Castro Alves Filho
> > >
> > > flavio.alves@gmail.com
> > > Twitter: http://twitter.com/#!/fraviofii
> > > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> > >
>
>
>
> --
> Flavio de Castro Alves Filho
>
> flavio.alves@gmail.com
> Twitter: http://twitter.com/#!/fraviofii
> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>

Re: Replacing SmartFS to LittleFS

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
Hello Xiang,

Thank you for your quick response.

How do I manage the format of a littlefs 'disk' from programming (not
nutshell) ?

I am looking for something similar to 'mksmatfs' function.

Or only the flash_eraseall function is enough? Or should I add the "-o
autoformat" option on the last parameter of the mount() function?

Best regards,

Flavio


Em qua., 28 de abr. de 2021 às 09:33, Xiang Xiao
<xi...@gmail.com> escreveu:
>
> LittleFS can talk directly with the standard MTD driver, so you just need:
>
>    1. Call register_mtddriver in your board file
>    2. Run mount from nsh like this:
>
>            mount -t littlefs -o autoformat /dev/mtd /mnt
>
>
> On Wed, Apr 28, 2021 at 8:03 PM Flavio Castro Alves Filho <
> flavio.alves@gmail.com> wrote:
>
> > Hello,
> >
> > Today my application uses SmartFS associated with MX25L SPI Dataflash.
> >
> > I intend to replace the SmartFS to LittleFS.
> >
> > In the filesystem section of menuconfig, I can disable
> > CONFIG_FS_SMARTFS and enable CONFIG_FS_SMARTFS.
> >
> > But when I go to "Device Drivers" --> "Memory Technology Device (MTD)
> > Support", there is an option CONFIG_MTD_SMART.
> >
> > Is there any equivalent configuration for LittleFS?
> >
> > After enabling the LittleFS, is there anything that must be done at
> > the board code to enable it?
> >
> > Best Regards,
> >
> > Flavio
> >
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.alves@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >



-- 
Flavio de Castro Alves Filho

flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves

Re: Replacing SmartFS to LittleFS

Posted by Xiang Xiao <xi...@gmail.com>.
LittleFS can talk directly with the standard MTD driver, so you just need:

   1. Call register_mtddriver in your board file
   2. Run mount from nsh like this:

           mount -t littlefs -o autoformat /dev/mtd /mnt


On Wed, Apr 28, 2021 at 8:03 PM Flavio Castro Alves Filho <
flavio.alves@gmail.com> wrote:

> Hello,
>
> Today my application uses SmartFS associated with MX25L SPI Dataflash.
>
> I intend to replace the SmartFS to LittleFS.
>
> In the filesystem section of menuconfig, I can disable
> CONFIG_FS_SMARTFS and enable CONFIG_FS_SMARTFS.
>
> But when I go to "Device Drivers" --> "Memory Technology Device (MTD)
> Support", there is an option CONFIG_MTD_SMART.
>
> Is there any equivalent configuration for LittleFS?
>
> After enabling the LittleFS, is there anything that must be done at
> the board code to enable it?
>
> Best Regards,
>
> Flavio
>
>
> --
> Flavio de Castro Alves Filho
>
> flavio.alves@gmail.com
> Twitter: http://twitter.com/#!/fraviofii
> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>