gmx, I agree you are correct for code calling and using littlefs: lfs_file_sync() or lfs_file_close() are how to ensure data is written to the device.
my exploration is of how to support littlefs, as a library on top of the sdk.
I believe littlefs provides four hooks (read, write, erase, flush) that must be implemented in terms of sdk functions.
It's been done before: https://github.com/lurk101/pico-littlefs
When I looked, that repo appeared to pre-date the addition of 'flush' to the littlefs set of hooks, and also the SDK helper 'flash_safe_execute()', which looks useful for multicore awareness.
So, my question could be rephrased: When implementing support for littlefs read, erase, write and flush, does 'flush' need to call flash_flush_cache'. Having now had this discussion, I think the answer is no, so thank you for your help.
my exploration is of how to support littlefs, as a library on top of the sdk.
I believe littlefs provides four hooks (read, write, erase, flush) that must be implemented in terms of sdk functions.
It's been done before: https://github.com/lurk101/pico-littlefs
When I looked, that repo appeared to pre-date the addition of 'flush' to the littlefs set of hooks, and also the SDK helper 'flash_safe_execute()', which looks useful for multicore awareness.
So, my question could be rephrased: When implementing support for littlefs read, erase, write and flush, does 'flush' need to call flash_flush_cache'. Having now had this discussion, I think the answer is no, so thank you for your help.
Statistics: Posted by John McAleely — Fri Feb 14, 2025 11:37 am