Hi All,
HW:
nrf52840dk
SW:
ncs-v2.6.1
Issue:
I'd like to be able to create a directory in my project say `/storage_part` place some files in, and during the build process have it generate a pre-built storage partition that contains my files in it that I can flash into the board. Unfortunately I've not had much luck yet.
If you've ever worked on espressif, similar to there spiffs_create_partition_image() procedure. (esp-spiffs-generate docs)
Attempt:
I'm not sure how to do this, however, I know mklittlefs (github: mklittlefs) can generate littlefs images so I thought I'd take a stab at attempting to automate that.
I created a littlefs storage partition in flash0
dts:
configs:
Mounting code:
Originally I wanted to as part of build process automate so I started trying to get it to work in the CMakeLists.txt, I'm not a CMake guru though I couldn't get the merge part working well.
So I ended up taking the built lfs partition just doing the merge part manually like such
This flashes and runs fine however, the littlefs mounting runs into an issue where it says corrupted pair:
E: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1234: Corrupted dir pair at {0x1, 0x0} W: can't mount (LFS -84); formatting
It then reformats it and mounts fine but obviously wipes out any data I'm attempting to prebuild into it.
So few questions:
1) Is there an already existing framework for doing what I'm attempting that I haven't found
2) Am I on the right track or is there some special sauce in the nordic implementation for littlefs and mk can't generate a compatible image.
3) I'm not sure I'm merging them correctly, if I inspect the hex file output, I don't see the start of the littlefs partition at 0xb8000 which I'd expect to see, it's instead much earlier in the file. Is merging them not the right course to try?
Best Regards,
Wade