nRF5 SDK v16.0.0
Macros
Flash data storage module configuration

Macros

#define FDS_ENABLED
 Enable FDS module. More...
 
#define FDS_VIRTUAL_PAGES
 Number of virtual flash pages to use. More...
 
#define FDS_VIRTUAL_PAGE_SIZE
 The size of a virtual flash page. More...
 
#define FDS_VIRTUAL_PAGES_RESERVED
 The number of virtual flash pages that are used by other modules. More...
 
#define FDS_BACKEND
 FDS flash backend. More...
 
#define FDS_OP_QUEUE_SIZE
 Size of the internal queue. More...
 
#define FDS_CRC_CHECK_ON_READ
 Enable CRC checks. More...
 
#define FDS_CRC_CHECK_ON_WRITE
 Perform a CRC check on newly written records. More...
 
#define FDS_MAX_USERS
 Maximum number of callbacks that can be registered. More...
 

Detailed Description

Macro Definition Documentation

#define FDS_BACKEND

FDS flash backend.

NRF_FSTORAGE_SD uses the nrf_fstorage_sd backend implementation using the SoftDevice API. Use this if you have a SoftDevice present. NRF_FSTORAGE_NVMC uses the nrf_fstorage_nvmc implementation. Use this setting if you don't use the SoftDevice.

Following options are available:

  • 1 - NRF_FSTORAGE_NVMC
  • 2 - NRF_FSTORAGE_SD
Note
This is an NRF_CONFIG macro.
#define FDS_CRC_CHECK_ON_READ

Enable CRC checks.

Save a record's CRC when it is written to flash and check it when the record is opened. Records with an incorrect CRC can still be 'seen' by the user using FDS functions, but they cannot be opened. Additionally, they will not be garbage collected until they are deleted.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define FDS_CRC_CHECK_ON_WRITE

Perform a CRC check on newly written records.

Perform a CRC check on newly written records. This setting can be used to make sure that the record data was not altered while being written to flash.

Following options are available:

  • 1 - Enabled
  • 0 - Disabled
Note
This is an NRF_CONFIG macro.
#define FDS_ENABLED

Enable FDS module.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define FDS_MAX_USERS

Maximum number of callbacks that can be registered.

Note
This is an NRF_CONFIG macro.
#define FDS_OP_QUEUE_SIZE

Size of the internal queue.

Increase this value if you frequently get synchronous FDS_ERR_NO_SPACE_IN_QUEUES errors.

Note
This is an NRF_CONFIG macro.
#define FDS_VIRTUAL_PAGE_SIZE

The size of a virtual flash page.

Expressed in number of 4-byte words. By default, a virtual page is the same size as a physical page. The size of a virtual page must be a multiple of the size of a physical page.

Following options are available:

  • 256 - 256 (Applicable devices only)
  • 512 - 512 (Applicable devices only)
  • 1024 - 1024
  • 2048 - 2048
Note
This is an NRF_CONFIG macro.
#define FDS_VIRTUAL_PAGES

Number of virtual flash pages to use.

One of the virtual pages is reserved by the system for garbage collection. Therefore, the minimum is two virtual pages: one page to store data and one page to be used by the system for garbage collection. The total amount of flash memory that is used by FDS amounts to FDS_VIRTUAL_PAGES * FDS_VIRTUAL_PAGE_SIZE * 4 bytes.

Note
This is an NRF_CONFIG macro.
#define FDS_VIRTUAL_PAGES_RESERVED

The number of virtual flash pages that are used by other modules.

FDS module stores its data in the last pages of the flash memory. By setting this value, you can move flash end address used by the FDS. As a result the reserved space can be used by other modules.

Note
This is an NRF_CONFIG macro.

Documentation feedback | Developer Zone | Subscribe | Updated