Skip to content
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

Latest esp-idf (VFS V2?) cannot be mounted after reboot #7

Open
paulreimer opened this issue Aug 28, 2018 · 4 comments
Open

Latest esp-idf (VFS V2?) cannot be mounted after reboot #7

paulreimer opened this issue Aug 28, 2018 · 4 comments

Comments

@paulreimer
Copy link

paulreimer commented Aug 28, 2018

Noticed that esp-idf has made some updates to VFS, or at least this component now behaves differently with the latest esp-idf master.

The filesystem seems to work (all files read as expected) after a fresh erase_flash and then flashing the fatfs image to the partition offset. But it does not persist a reboot (e.g. it cannot be mounted after reset button is toggled, or after a software triggered reboot)

There is some new logging here on the first boot here:

I (105) wl_flash: updateV1_V2 Update from V1 to V2, crc=0x69c05153,
I (107) wl_flash: updateV1_V2 max_pos=29, pos=25, state.ver=1, state2.ver=1

Upon reboot I get the following error when mounting:

W (521) vfs_fat_spiflash: f_mount failed (13)

This makes me think esp-idf has changed upstream, and this repo should update the esp-idf components to be generating images in this new "V2" format? At least, in my case I do not need to support both formats -- preferably only the latest one.

@TobleMiner
Copy link

I'm running into this issue, too. There seems to be a v2 (espressif/esp-idf@a6d6c58#diff-56bcb985916387b5e0fcebb24c6b0c7c) of the wear leveling algorithm which is incompatible with the v1 wear leveling storage format. Although there is code to transition v1 wear leveling storage to v2 wear leveling storage it fails to update fat filesystems created via ESP32_mkfatfs to the new wear leveling format.

@TobleMiner
Copy link

TobleMiner commented Oct 6, 2018

@paulreimer I've created a new tool with a much cleaner code base at https://github.com/TobleMiner/mk_esp32fat . It works great with the latest esp-idf master branch. Please feel free to check it out.

The only donwside is that my tool does currently not support 512 byte sector size.

@paulreimer
Copy link
Author

paulreimer commented Nov 1, 2018

@TobleMiner regretfully I am using 512 byte sector size at this time. If you add support for that (or maybe there's another way I wouldn't need it -- for long file names / verified writes), please let me know!

@paulreimer
Copy link
Author

paulreimer commented Nov 1, 2018

I'll note that this recent esp-idf commit:
espressif/esp-idf@cd38970

Appears to have partially addressed this issue. Reboots on a valid V1 filesystem (after V2 conversion) are no longer an issue. If the filesystem boots the first time, it seems to upgrade V1->V2 and works on subsequent V2 reboots. Great!

But, now it seems a little flaky when flashing the FATFS the first time. I've had a couple times where it didn't flash successfully, and no initial mount happened (so before the V1->V2 conversion, I think). Re-flashing it seems to work, but I can't explain why it wouldn't work 100%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants