Skip to content

Commit

Permalink
feat: NFFS BSP: added BSP defaults for NFFS
Browse files Browse the repository at this point in the history
* The BSP now includes default NFFS settings that are known to work
* The NFFS area size and address offset definitions have been moved from
the sample applications to the BSP CMakeLists.txt
* Closes zephyrproject-rtos#13
  • Loading branch information
Alexander Preißner committed May 28, 2018
1 parent ac2f39b commit afd3553
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 11 deletions.
5 changes: 5 additions & 0 deletions boards/arm/akita_gen2_devboard/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
zephyr_library()
zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${PROJECT_SOURCE_DIR}/drivers)

zephyr_compile_definitions(
-DFLASH_AREA_NFFS_OFFSET=0
-DFLASH_AREA_NFFS_SIZE=8192
)
26 changes: 25 additions & 1 deletion boards/arm/akita_gen2_devboard/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,31 @@ if FLASH
config SPI_FLASH_W25QXXXX_SPI_SLAVE
default 0

endif # SPI_FLASH_W25QXXXX
endif # FLASH


if FILE_SYSTEM_NFFS

config FS_NFFS_FLASH_DEV_NAME
default "W25QXXXX"
config FS_NFFS_NUM_INODES
default 100
config FS_NFFS_NUM_BLOCKS
default 100
config FS_NFFS_NUM_FILES
default 4
config FS_NFFS_NUM_DIRS
default 4
config FS_NFFS_NUM_CACHE_INODES
default 1
config FS_NFFS_NUM_CACHE_BLOCKS
default 1
config NFFS_FILESYSTEM_MAX_AREAS
default 8
config NFFS_FILESYSTEM_MAX_BLOCK_SIZE
default 256

endif # FILE_SYSTEM_NFFS


if FXOS8700
Expand Down
5 changes: 0 additions & 5 deletions samples/json/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(NONE)

zephyr_compile_definitions(
-DFLASH_AREA_NFFS_OFFSET=0
-DFLASH_AREA_NFFS_SIZE=8192
)

target_link_libraries(app NFFS)
FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
1 change: 1 addition & 0 deletions samples/json/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ CONFIG_FLASH=y
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_JSON_LIBRARY=y
CONFIG_MAIN_STACK_SIZE=2048
5 changes: 0 additions & 5 deletions samples/nffs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(NONE)

zephyr_compile_definitions(
-DFLASH_AREA_NFFS_OFFSET=0
-DFLASH_AREA_NFFS_SIZE=8192
)

target_link_libraries(app NFFS)
FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
1 change: 1 addition & 0 deletions samples/nffs/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CONFIG_FLASH=y
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_SPI=y
CONFIG_MAIN_STACK_SIZE=2048

0 comments on commit afd3553

Please sign in to comment.