CONFIG_SB_NUM_VER_COUNTER_SLOTS

Number of monotonic counter slots used for the firmware version.

Type: int

Help

The number of monotonic counter slots available for the counter, i.e., the number of times the counter can be updated. The slots are 16 bits each. The number of slots is rounded up to the nearest even number to ensure that the total size of header and slots is aligned on a 32-bit word. Rationale for the default number (240): Assume one update a month for 10 years, then double that value just in case. This default fits comfortably within the “OTP” region of UICR. Regarding ranges: The actual maximum depends on the number of provisioned public keys, since they share the space. The same is true if other data is stored in the “OTP” region (on for example nRF91 and nRF53). This configuration should not be used in code. Instead, the header before the slots should be read at run-time.

Direct dependencies

SB_MONOTONIC_COUNTER && SECURE_BOOT

(Includes any dependencies from ifs and menus.)

Default

  • 240

Kconfig definition

At <nRF>/subsys/bootloader/Kconfig:130

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:9<BuildDir>/Kconfig/Kconfig.modules:1<nRF>/Kconfig.nrf:25<nRF>/subsys/Kconfig:8

Menu path: (Top) → Modules → Nordic nRF Connect → Bootloader → Use Secure Bootloader → Enable HW monotonic version counter

config SB_NUM_VER_COUNTER_SLOTS
    int "Number of monotonic counter slots used for the firmware version."
    range 1 300 if SOC_NRF5340_CPUAPP || SOC_NRF9160
    range 1 1800 if SOC_SERIES_NRF52X
    range 1 400 if SOC_SERIES_NRF51X
    default 240
    depends on SB_MONOTONIC_COUNTER && SECURE_BOOT
    help
      The number of monotonic counter slots available for the counter,
      i.e., the number of times the counter can be updated.
      The slots are 16 bits each. The number of slots is rounded up to the nearest even
      number to ensure that the total size of header and slots is aligned on a 32-bit word.
      Rationale for the default number (240): Assume one update a month for
      10 years, then double that value just in case. This default fits
      comfortably within the "OTP" region of UICR.
      Regarding ranges: The actual maximum depends on the number of
      provisioned public keys, since they share the space. The same is true if
      other data is stored in the "OTP" region (on for example nRF91 and nRF53).
      This configuration should not be used in code. Instead, the header before the
      slots should be read at run-time.

(The ‘depends on’ condition includes propagated dependencies from ifs and menus.)