<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I have raised the following github issue to Espressif:<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><a href="https://github.com/espressif/esp-idf/issues/2730" class="">https://github.com/espressif/esp-idf/issues/2730</a></div><div class=""><br class=""></div><div class=""><h2 style="box-sizing: border-box; margin-bottom: 16px; line-height: 1.25; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(234, 236, 239); padding-bottom: 0.3em; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); margin-top: 0px !important;" class="">Environment</h2><ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><li style="box-sizing: border-box; margin-left: 0px;" class="">Development Kit: none</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">Kit version (for WroverKit/PicoKit/DevKitC): none</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">Module or chip used: ESP32-WROVER 16MB</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">IDF version (run <code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 11.9px; background-color: rgba(27, 31, 35, 0.05); border-radius: 3px; margin: 0px; padding: 0.2em 0.4em;" class="">git describe --tags</code> to find it): v3.2-beta1-208-g0d7f2d77c</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">Build System: make</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">Compiler version (run <code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 11.9px; background-color: rgba(27, 31, 35, 0.05); border-radius: 3px; margin: 0px; padding: 0.2em 0.4em;" class="">xtensa-esp32-elf-gcc --version</code> to find it): (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">Operating System: macOS</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">Power Supply: USB</li></ul><h2 style="box-sizing: border-box; margin-bottom: 16px; margin-top: 24px; line-height: 1.25; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(234, 236, 239); padding-bottom: 0.3em; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Problem Description</h2><p style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">TLDR: Between May and July 2018 a change was made to esp idf master that is causing corruption on FAT filesystems mounted on SPI flash.</p><p style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Our project uses a partitions.csv as follows:</p><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 11.9px; margin-bottom: 16px; margin-top: 0px; overflow-wrap: normal; background-color: rgb(246, 248, 250); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; line-height: 1.45; overflow: auto; padding: 16px; color: rgb(36, 41, 46); font-variant-ligatures: normal; orphans: 2; widows: 2;" class=""><code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 11.9px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; margin: 0px; padding: 0px; border: 0px; word-break: normal; display: inline; line-height: inherit; overflow: visible; overflow-wrap: normal; background-position: initial initial; background-repeat: initial initial;" class=""># Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 4M
ota_0, app, ota_0, , 4M
ota_1, app, ota_1, , 4M
store, data, fat, , 1M
</code></pre><p style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">The 'store' partition is formatted as FAT, as follows:</p><div class="highlight highlight-source-c++" style="box-sizing: border-box; margin-bottom: 16px; background-color: rgb(255, 255, 255); color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; overflow: visible !important;"><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 11.9px; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; background-color: rgb(246, 248, 250); border-radius: 3px; line-height: 1.45; overflow: auto; padding: 16px; word-break: normal;" class=""><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">esp_vfs_fat_mount_config_t</span> m_store_fat;
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">wl_handle_t</span> m_store_wlh;
<span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193);">memset</span>(&m_store_fat,<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">0</span>,<span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">sizeof</span>(<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">esp_vfs_fat_sdmmc_mount_config_t</span>));
m_store_fat.format_if_mount_failed = <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">true</span>;
m_store_fat.max_files = <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">5</span>;
<span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193);">esp_vfs_fat_spiflash_mount</span>(<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);"><span class="pl-pds" style="box-sizing: border-box;">"</span>/store<span class="pl-pds" style="box-sizing: border-box;">"</span></span>, <span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);"><span class="pl-pds" style="box-sizing: border-box;">"</span>store<span class="pl-pds" style="box-sizing: border-box;">"</span></span>, &m_store_fat, &m_store_wlh);</pre></div><p style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">We have previously used a clone of esp idf master, dated around May 22 2018, without issues. The partition is very reliable.</p><p style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">However, on Jul 6 2018, we updated our clone to use the latest esp idf master at that time. Shortly afterwards, users started to report that their 'store' filesystem contents were corrupted. We rolled back.</p><p style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">We have now tried again (updating on Oct 20 2018 to v3.2-beta1-208-g0d7f2d77c) and immediately had the same issue. Random corruption of FAT filesystem in SPI flash.</p><h3 style="box-sizing: border-box; margin-bottom: 16px; margin-top: 24px; font-size: 1.25em; line-height: 1.25; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Expected Behavior</h3><p style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">No corruption of FAT filesystem.</p><h3 style="box-sizing: border-box; margin-bottom: 16px; margin-top: 24px; font-size: 1.25em; line-height: 1.25; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Actual Behavior</h3><p style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Corruption of FAT filesystem.</p><h3 style="box-sizing: border-box; margin-bottom: 16px; margin-top: 24px; font-size: 1.25em; line-height: 1.25; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Steps to reproduce</h3><ol style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><li style="box-sizing: border-box; margin-left: 0px;" class="">Create a partition in SPI flash, and mount FAT filesystem</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">Read and write to files on FAT filesystem</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">Reboot</li><li style="box-sizing: border-box; margin-top: 0.25em; margin-left: 0px;" class="">Observe random corruption and unmountable filesystem</li></ol><h3 style="box-sizing: border-box; margin-bottom: 16px; margin-top: 24px; font-size: 1.25em; line-height: 1.25; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Code to reproduce this issue</h3><div class="highlight highlight-source-c++" style="box-sizing: border-box; margin-bottom: 16px; background-color: rgb(255, 255, 255); color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; overflow: visible !important;"><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 11.9px; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; background-color: rgb(246, 248, 250); border-radius: 3px; line-height: 1.45; overflow: auto; padding: 16px; word-break: normal;" class=""><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">esp_vfs_fat_mount_config_t</span> m_store_fat;
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">wl_handle_t</span> m_store_wlh;
<span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193);">memset</span>(&m_store_fat,<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">0</span>,<span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">sizeof</span>(<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">esp_vfs_fat_sdmmc_mount_config_t</span>));
m_store_fat.format_if_mount_failed = <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">true</span>;
m_store_fat.max_files = <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">5</span>;
<span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193);">esp_vfs_fat_spiflash_mount</span>(<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);"><span class="pl-pds" style="box-sizing: border-box;">"</span>/store<span class="pl-pds" style="box-sizing: border-box;">"</span></span>, <span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);"><span class="pl-pds" style="box-sizing: border-box;">"</span>store<span class="pl-pds" style="box-sizing: border-box;">"</span></span>, &m_store_fat, &m_store_wlh);</pre></div><h2 style="box-sizing: border-box; margin-bottom: 16px; margin-top: 24px; line-height: 1.25; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(234, 236, 239); padding-bottom: 0.3em; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Debug Logs</h2><p style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">n/a</p><h2 style="box-sizing: border-box; margin-bottom: 16px; margin-top: 24px; line-height: 1.25; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(234, 236, 239); padding-bottom: 0.3em; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Other items if possible</h2><div style="box-sizing: border-box; margin-top: 0px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;" class="">Please advise if you need anything further.</div></div></blockquote><div class=""><div><br class=""></div><div>I think the timeline is correct (the issue is in esp idf master some time between May and July 2018), but please let me know if you know differently (or update the github issue with your comments).</div><div><br class=""></div><div>Regards, Mark</div><div><br class=""><blockquote type="cite" class=""><div class="">On 23 Nov 2018, at 6:19 AM, Michael Balzer <<a href="mailto:dexter@expeedo.de" class="">dexter@expeedo.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">esp-idf and OVMS branches are back to the working version.<br class=""><br class="">In case you also lost your config: I also just fixed a bug on restoring into an empty /store partition.<br class=""><br class="">Regards,<br class="">Michael<br class=""><br class=""><br class="">Am 22.11.18 um 22:34 schrieb Michael Balzer:<br class=""><blockquote type="cite" class="">See <a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/pull/165" class="">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/pull/165</a><br class=""><br class="">I'll reset both master branches now.<br class=""><br class="">If you're about to pull, please wait until I've reverted the branches.<br class=""><br class="">Regards,<br class="">Michael<br class=""><br class=""></blockquote><br class="">-- <br class="">Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal<br class="">Fon 02333 / 833 5735 * Handy 0176 / 206 989 26<br class=""><br class="">_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.openvehicles.com" class="">OvmsDev@lists.openvehicles.com</a><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></div></div></blockquote></div><br class=""></div></body></html>