7a5752a748
Enables the littlefs (v1 and v2) filesystems in the zephyr port. Example usage with the internal flash on the reel_board or the rv32m1_vega_ri5cy board: import os from zephyr import FlashArea bdev = FlashArea(FlashArea.STORAGE, 4096) os.VfsLfs2.mkfs(bdev) os.mount(bdev, '/flash') with open('/flash/hello.txt','w') as f: f.write('Hello world') print(open('/flash/hello.txt').read()) Things get a little trickier with the frdm_k64f due to the micropython application spilling into the default flash storage partition defined for this board. The zephyr build system doesn't enforce the flash partitioning when mcuboot is not enabled (which it is not for micropython). For now we can demonstrate that the littlefs filesystem works on frdm_k64f by constructing the FlashArea block device on the mcuboot scratch partition instead of the storage partition. Do this by replacing the FlashArea.STORAGE constant above with the value 4. |
||
---|---|---|
.. | ||
bare-arm | ||
cc3200 | ||
esp32 | ||
esp8266 | ||
javascript | ||
minimal | ||
nrf | ||
pic16bit | ||
powerpc | ||
qemu-arm | ||
samd | ||
stm32 | ||
teensy | ||
unix | ||
windows | ||
zephyr |