Comments (2)
I'm trying to make exactly the same scenario work: prepare filesystem on a Linux host, flash it to Raspberry PI Pico and use it there in read-write mode.
Hitting exactly the same issue as OP with erase
function not being called before prog
. My guess is that littlefs consideres these blocks "erased" since bits in the filesystem control structures tell it that it is so. These bits are set by the FUSE implementation same as they would have been in the embedded one, when FS image is flashed into the Pico, all sectors are written to after erase and therefore are not really erased on the device.
Simple solution I'm going to try later today is just set block size to the same value as prog size and always erase 4k chunks before prog. This is going to be highly inefficient but should work.
A better solution would be to add a capability for LFS binary to set all 'erased' flags to false via a command line switch. I'll see if I can put together a pull request.
from littlefs-fuse.
After reading littlefs documentation and some experiments I retract my previous comment.
- littlefs doesn't store information about erased blocks in the metadata. It infers which blocks are unused by scanning the filesystem to find all the used ones. So there are no bits to set.
- my problems with writing to the filesystem were due to
flash_range_erase
andflash_range_prog
being unsafe to use when interrupts are enabled (namely USB interrupts when USB stdio is enabled). See this for details: raspberrypi/pico-examples#34
After fixing the interrupt issue I was able to create littlefs image via littlefs-fuse, flash this image to Raspberry PI Pico, read files in the image and modify them. This worked as well when prog and read sizes were set to 256 bytes and block size to 4k.
from littlefs-fuse.
Related Issues (20)
- Build not working HOT 3
- 2gb limit HOT 6
- Mount by custom channel
- MbedOS lfs and littlefs-fuse - corrupted dir pair at 0 1 HOT 5
- You might be interested in this HOT 2
- Usage question HOT 2
- littlefs fuse wrong lfsfuse_bd implementation HOT 1
- [Question] Image created for uC
- LiitleFs made with Arduino-ESP-mklittlefs will not show any file HOT 1
- Cannot see directory content in Midnight Commander
- New releases? HOT 7
- Read zero bytes on newly truncated file
- Ubuntu package HOT 2
- Assertion on minimum block size < 128 bytes HOT 1
- Add option to mount without upgrading disk version
- Block-size needs to be specified even for --stat
- Get stuck when the block size is 1MByte HOT 1
- Compilation error on recent Fedora system HOT 1
- compilation error: test.c interfering HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from littlefs-fuse.