-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to format spi flash as vfat #10445
Comments
no, vfat can't work with mtd directly (mtd is totally different storage from the tradition block device). You can either:
|
Thank you very much. Are there any reference examples for using other file systems on SPI flash, such as LittleFS or SmartFS? I have encountered some issues while using NXFFS. |
you can search the related config in nuttx/boards. |
@xiaoxiang781216 Hello, when I was testing the file system, I tried using littlefs and it worked fine. However, when I attempted to use smartfs and referred to some boards, I encountered some issues. Here are the steps I followed: CONFIG_MTD_SMART=y Next, I added the following code: if (ret < 0)
} When I entered "mksmartfs /dev/smart0," there was no error, but there was no "smart0" file generated in the "/dev/" directory. Consequently, the subsequent "mount" operation failed. Are there any additional configurations or steps that I may have overlooked? It is working properly now. The bug in my code was causing the issue. Sometimes there might be garbage files or incorrect content in the SPI flash, and in such cases, the "rm" command may fail to delete files. Is there any interface or command that can format the flash or erase the entire flash chip? I found a built-in command function and its corresponding command called "flash_eraseall" in the file system. Does this command also work for SPI flash? |
I think you need something like (where mnt_name is your choice)? ret = nx_mount("/dev/smart0", "/mnt/mnt_name", "smartfs", 0, autoformat); |
Yes, I have resolved the issue.。 |
Ok, away at moment so GitHub phone app sometimes slow to refresh. Sorry if I answered a question that didn't need answers! I only ever tried things like "ls -l > /mnt/flash" and that always worked as long as the memory was properly formatted and mounted. I tried vfat, littlefs, smartfs and nxffs. Settled on littlefs in the end. |
|
Should have been /mnt/flash/file.txt or similar of course. I think explicit paths may always be needed too? Or, at least, ./file.txt |
ok !Thank you once again. |
How can I format an SPI flash as a VFAT file system and manage it through the MTD interface? Are there any reference examples? Currently, I only see the method of formatting it as NXFFS and managing it through MTD.
The text was updated successfully, but these errors were encountered: