NCS mass littlefs

Hi,

I am trying to run the mass sample of NCS V2.6.0 (zephyr\samples\subsys\usb\mass).

I followed the README.rst,

- build  the sample with -DCONFIG_APP_MSC_STORAGE_FLASH_LITTLEFS=y,

- download it to the nrf52840DK, (the log looks OK )

\0*** Booting nRF Connect SDK v3.5.99-ncs1 ***
[00:00:00.253,265] <inf> flashdisk: Initialize device NAND
[00:00:00.253,265] <inf> flashdisk: offset 0, sector size 512, page size 4096, volume size 8192000
Area 0 at 0x0 on mx25r6435f@0 for 8192000 bytes
[00:00:00.257,537] <inf> littlefs: LittleFS version 2.5, disk version 2.0
[00:00:00.259,552] <inf> littlefs: FS at mx25r6435f@0:0x0 is 2000 0x1000-byte blocks with 512 cycle
[00:00:00.259,582] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
Mount /lfs: 0
/lfs: bsize = 16 ; frsize = 4096 ; blocks = 2000 ; bfree = 1998
/lfs opendir: 0
End of files
[00:00:00.311,401] <inf> main: The device is put in USB mass storage mode.


- connect the USB to the WIN10, and the WIN10 requests a format operation, after formatting, the mass storage works

The problem is that after the power-on reset, and connecting the USB to the WIN10 again, the WIN10 still requests a format operation.

if power-on reset with USB is connected, the log as below 

\0*** Booting nRF Connect SDK v3.5.99-ncs1 ***
[00:00:00.253,295] <inf> flashdisk: Initialize device NAND
[00:00:00.253,295] <inf> flashdisk: offset 0, sector size 512, page size 4096, volume size 8192000
Area 0 at 0x0 on mx25r6435f@0 for 8192000 bytes
[00:00:00.257,598] <inf> littlefs: LittleFS version 2.5, disk version 2.0
[00:00:00.259,582] <inf> littlefs: FS at mx25r6435f@0:0x0 is 2000 0x1000-byte blocks with 512 cycle
[00:00:00.259,613] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:00.275,695] <err> littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1234: Corrupted dir pair at {0x0, 0x1}
[00:00:00.275,726] <wrn> littlefs: can't mount (LFS -84); formatting
[00:00:00.356,445] <inf> littlefs: /lfs mounted
Mount /lfs: 0
/lfs: bsize = 16 ; frsize = 4096 ; blocks = 2000 ; bfree = 1998
/lfs opendir: 0
End of files
[00:00:00.407,989] <inf> main: The device is put in USB mass storage mode.

[00:00:00.718,933] <err> usb_device: Request buffer too small

Parents
  • Hi Jason,

    Could this be just Windows 10 not able to read a LittleFS partition, and tries to format it in some different way, and then the device application formats the partition as LittleFS again?

    One thing to check is look for what file system the partition is in after Windows 10 formats it.

    I recommend finding a LittleFS driver or explorer.

    Hieu

  • Hi Hieu,

    Thanks for your reply.  It is a surprise that Windows does not support the LittleFS by default. I didn't find any official driver for Windows.  Do you have a recommended  LittleFS driver or explorer?  I assume there is some driver, after installing such a driver, Windows can recognize the mass storage with LittleFS just like a normal disk, there is no need to open any special explorer/software. otherwise, the mass storage with LittleFS makes no sense for our product.

Reply
  • Hi Hieu,

    Thanks for your reply.  It is a surprise that Windows does not support the LittleFS by default. I didn't find any official driver for Windows.  Do you have a recommended  LittleFS driver or explorer?  I assume there is some driver, after installing such a driver, Windows can recognize the mass storage with LittleFS just like a normal disk, there is no need to open any special explorer/software. otherwise, the mass storage with LittleFS makes no sense for our product.

Children
Related