Skip to content

Commit ab68022

Browse files
hakonfamSebastianBoe
authored andcommitted
[nrf noup] cmake: define pm.yml for nffs subsystem
This pm.yml defines a partition 'nffs_storage'. Signed-off-by: Håkon Øye Amundsen <[email protected]>
1 parent d03c8f3 commit ab68022

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

subsys/fs/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ if(CONFIG_FILE_SYSTEM)
1616
target_link_libraries_ifdef(CONFIG_FAT_FILESYSTEM_ELM FS INTERFACE ELMFAT)
1717
target_link_libraries_ifdef(CONFIG_FILE_SYSTEM_LITTLEFS FS INTERFACE LITTLEFS)
1818
target_link_libraries_ifdef(CONFIG_FILE_SYSTEM_NFFS FS INTERFACE NFFS)
19+
20+
add_partition_manager_config(pm.yml)
1921
endif()
2022

2123
add_subdirectory_ifdef(CONFIG_FCB ./fcb)

subsys/fs/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ endmenu
7575
menu "NFFS Settings"
7676
visible if FILE_SYSTEM_NFFS
7777

78+
# This config must be compatible with
79+
# nrf/subsys/partition_manager/Kconfig.template.partition_size
80+
config PM_PARTITION_SIZE_NFFS_STORAGE
81+
hex "Flash space reserved for nffs storage partition"
82+
default 0x6000
83+
help
84+
Flash space set aside for the nffs storage partition.
85+
7886
config FS_NFFS_FLASH_DEV_NAME
7987
string "Flash device name to be used"
8088

subsys/fs/nffs_fs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
#if USE_PARTITION_MANAGER
2525
#include <pm_config.h>
26-
#define NFFS_FLASH_AREA_STORAGE_OFFSET PM_MCUBOOT_STORAGE_ADDRESS
27-
#define NFFS_FLASH_AREA_STORAGE_SIZE PM_MCUBOOT_STORAGE_SIZE
26+
#define NFFS_FLASH_AREA_STORAGE_OFFSET PM_NFFS_STORAGE_ADDRESS
27+
#define NFFS_FLASH_AREA_STORAGE_SIZE PM_NFFS_STORAGE_SIZE
2828

2929
#else
3030
#include <generated_dts_board.h>

subsys/fs/pm.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <autoconf.h>
2+
3+
#ifdef CONFIG_FILE_SYSTEM_NFFS
4+
nffs_storage:
5+
placement: {after: [mcuboot_storage, app]}
6+
size: CONFIG_PM_PARTITION_SIZE_NFFS_STORAGE
7+
#endif

0 commit comments

Comments
 (0)