nRF52811: settings_save_one() returns -2 / -116 while storing device name and BLE passkey issue (Settings + NVS backend)

Hi Team,

I am working on an nRF52811-based BLE application using nRF Connect SDK (Zephyr) and facing an issue while trying to store the device name in flash using the Settings subsystem with NVS backend.

The API call:

settings_save_one("device/name",device_name,strlen(device_name) + 1);

is failing and returning the following error codes:

-2 (ENOENT)
-116 (ENOTSUP)
As a result, the device name is not being saved to flash memory.

Observed Behavior
settings_subsys_init() → returns 0
settings_load() → returns 0
settings_save_one() → returns -2 / -116
Flash write operation does not occur
In proj.conf

CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y
CONFIG_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_FLASH_PAGE_LAYOUT=y
(Additional settings were tested such as CONFIG_SETTINGS_RUNTIME=y and CONFIG_SETTINGS_NVS_SECTOR_COUNT=2, but enabling them causes build errors.)

I have attached:

nrf52811_custom.dts
prj.conf
for review.

Kindly help clarify the following:

Is any additional configuration required for Settings + NVS backend initialization on nRF52811?
Are there any known limitations of the Settings subsystem or NVS on nRF52811 (flash size / partition constraints)?
Could this issue be related to incorrect flash partitioning or missing backend registration?
Why does settings_save_one() return -116 (ENOTSUP) in this configuration?


Issue 2: BLE Passkey / pairing issue:

please give the procedure for passkey.

passkey related questions:

What is the correct configuration for passkey authentication (Just Works vs Passkey Entry) in nRF52811 using NCS?
Are there any required settings for enabling:
CONFIG_BT_SMP
CONFIG_BT_BONDING
CONFIG_BT_FIXED_PASSKEY / I/O capabilities?
Could this issue be related to missing security level configuration or SMP setup?
Is there any limitation of passkey authentication on nRF52811 in Zephyr/NCS?
nrf52811_custom.dts570246.prj.conf

Parents
  • Hi

    Please check out the Security in BLE communication of the DevAcademy course that takes you through how to set up pairing on your device here: https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-5-bluetooth-le-security-fundamentals/ 

    Does settings_save_one() return both error codes after one another or one more often than the other? -116 points to a connection timed out according to my error list, while -2 points to there being no such entry/data. You can see the subsys/settings sample for a sample where the settings_save_one() function is used: ...\zephyr\samples\subsys\settings\src\main.c 

    What device are you trying to pair the nRF52811 to here exactly? Please note that since the nRF52811 is very limited in terms of Flash and RAM it is not suited as a central device, so I'm assuming you only use the nRF52811 as a peripheral

    Best regards,

    Simon

  • Hi Team,

    Thank you for the reply.

    We are using the nRF52811 chip in peripheral mode only.

    Initially, settings_save_one() returns -2. After configuring flash, the function then returns -116.

    From our understanding:

    • -2 indicates no such entry/data.
    • -116 indicates a connection timed out error.

    Could you please help clarify why settings_save_one() transitions from -2 to -116 after flash configuration, and whether this points to an issue with flash/NVS configuration or timeout during settings storage?

    Thank you.

Reply
  • Hi Team,

    Thank you for the reply.

    We are using the nRF52811 chip in peripheral mode only.

    Initially, settings_save_one() returns -2. After configuring flash, the function then returns -116.

    From our understanding:

    • -2 indicates no such entry/data.
    • -116 indicates a connection timed out error.

    Could you please help clarify why settings_save_one() transitions from -2 to -116 after flash configuration, and whether this points to an issue with flash/NVS configuration or timeout during settings storage?

    Thank you.

Children
No Data
Related