I am trying to set up a w25q128 using SPI with a nrf5340 on a custom board and had a few questions. I have used DevAcademy as a reference as I do eventually want to set up MCUBoot but right now I want to get the fiile system and settings up and running.
- Is there any change to the need for pm_static.yml when using toolchains 2.9.x or 3.x?
- Is there a reason why one would use the boot, slot0, and slot1 partitions for mcuboot on external flash vs internal flash? Could I use the 1MB of internal flash for this?
- Do I need to create a seperate partition when using the Zephyr settings infrastructure?
- Are the instructions to use pm manager until things are set applicable when using littlefs? Doesn't that also cause me to "freeze" the partitions (see reference below)?
- Does SRAM needs to be configured as well?
- I have seen multiple entries for secure and non-secure, do I need to create paritions for each? When does one get used vs another?
I've watched this Nordic video on DFU/FOTA which was great and I hope you do more of these. The use of pm manager and memory report to show the memory:
In it he recommends using dynamic partitioning for development and then freeze the partitioning. I've also listened to Zephyr 101 - Device Settings Using nRF9160 Feather External Flash which is also very helpful but would like to drill deeper into some of the specific topics I'm interested in and would like more coverage of the basics as well. For example:
When I have this code:
//start filesystem config #define PARTITION_NODE DT_NODELABEL(lfs) FS_FSTAB_DECLARE_ENTRY(PARTITION_NODE); struct fs_mount_t *mp = &FS_FSTAB_ENTRY(PARTITION_NODE);
It references a fstab entry which in another example I have looks like this:
fstab { compatible = "zephyr,fstab"; lfs: lfs { compatible = "zephyr,fstab,littlefs"; mount-point = "/lfs"; partition = <&littlefs_storage>; automount; read-size = <16>; prog-size = <16>; cache-size = <64>; lookahead-size = <32>; block-cycles = <512>; }; };
I believe that also has to be references in the device tree as well. In the case of the dk I am trying to adapt to my custom board that would look like:
&mx25r64 { partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; littlefs_storage: partition@0 { label = "littlefs_storage"; reg = <0x00000000 0x00200000>; }; lvgl_raw_partition: partition@200000 { label = "lvgl_raw_partition"; reg = <0x00200000 0x00200000>; }; settings_partition: partition@400000 { label = "settings_partition"; reg = <0x400000 0x100000 >; }; }; };
I don't really need all those partitions, but the example I was using had them. I don't know if I need to keep settings in a different partition from the littlefs_storage or not. I guess this is the part I need to mirror in the pm_static.yml, is that correct? Do I only need to have a subset of the entries from the pm_static.yml in here? Do the values (such as reg) need to match those in the pm_static.yml?
I've had even very seasoned Zephry/Nordic people mention "It's not super easy to get it up and running, took me some fiddling around until I got it to work...", so it may be worth while to cover. I've seen
I have seen the comments in here which brings up the quetion of trust zone and sram.
I see the documentation for partition manager and
Regarding posts I've read:
- Partition conflict when enabling littlefs in both mcuboot and app simultaneously? Helpful post but I think I need some basic structured information as well.
- Is it supported to configure one LittleFS partition on external SPI flash and another in internal FLASH? This has good examples of the pm_static.yml but is trying to solve a different problem and is not intended to be an explanation.
I've looked in git and seen:
- sdk-nrf which seems to also include sram entries