Just to update and close this conversation with a better understanding of
my problem
and providing solution:

I basically had 2 problems:

1.
When calling *smart_initialize() *and *nx_mount()* , I had "no low level
format" error.
To fix that, I needed to force format using the following command:
*mksmartfs -f /dev/smartn* where n is the minor number used in the
*smart_initialize()* function.
Then, I reset the board and mount was ok.
Note: if you don't force (use -f) it won't work.

2.
Some of the intermittent I/O errors I had that I was not able to describe,
because it happened
to some files but not to others, was a very simple isse: it was related to
the filename's size.
Which default is 16.

Some configs you should select/configure when using SMART FS:

CONFIG_FS_SMARTFS=y
CONFIG_MTD_SMART=y
CONFIG_NAME_MAX=64
CONFIG_SMARTFS_MAXNAMLEN=64


Em seg., 9 de ago. de 2021 às 10:38, Sara da Cunha Monteiro de Souza <
saramonteirosouz...@gmail.com> escreveu:

> Hi Ken,
>
> Thank you. I'll appreciate to know the results of your tests.
> I am also performing more tests than this one and I am experiencing issues
> that I still
> don't know if it is related to SMART FS, or some NuttX module or even the
> chip I am using.
> The issues are intermittent, what makes it harder to identify the cause.
>
> Em sex., 6 de ago. de 2021 às 15:21, Ken Pettit <petti...@gmail.com>
> escreveu:
>
>> Hi Sara,
>>
>> I'm not sure SmartFS was ever tested with this particular sequence where
>> the volume is erase and then re-mounted to a different location.  If I
>> get a chance this weekend, I will take a look at it since you have a
>> very specific test sequence.
>>
>> Ken
>>
>> On 8/5/21 3:48 PM, Sara da Cunha Monteiro de Souza wrote:
>> > Hi all,
>> > I am facing some issues when enabling SMART FS and I'd like to know if
>> > this is an expected behavior or maybe a bug on NuttX.
>> >
>> > First issue:
>> > - If I use the following sequence:
>> > 1. smart_initialize()
>> > 2. nx_mount()
>> > nx_mount throws errors like: sector not allocated and no low level
>> format.
>> >
>> > To fix it, all I need to do is to format it by calling mksmartfs
>> > /dev/smart0 and I can reset and have my mount point correctly mounted.
>> >
>> > Second issue:
>> >
>> > If I run flash_eraseall just like the following sequence it will throw
>> an
>> > I/O error when writing to a file in the recent created mount point.
>> >
>> > mksmartfs /dev/smart0 mount -t smartfs /dev/smart0 /temp echo "TESTE" >
>> > /temp/teste cat /temp/teste umount /temp flash_eraseall /dev/smart0
>> > mksmartfs /dev/smart0 mount -t smartfs /dev/smart0 /another_temp
>> > echo "TESTE" > /another_temp/teste
>> >
>> > P.S:
>> > The error happened on ESP32C3 DevKit and also on simulator.
>> >
>> > To reproduce the error, you basically need to enable the following
>> configs:
>> > CONFIG_FS_SMARTFS
>> > CONFIG_MTD_SMART
>> > CONFIG_SYSTEM_FLASH_ERASEALL
>> >
>> > Thanks, Sara.
>> >
>>
>>

Reply via email to