Skip to content

settings: settings_save_one() doesn't always seem to store data, even if it returns success #14840

@jhedberg

Description

@jhedberg

I have the following configuration:

  • tests/bluetooth/shell
  • BOARD=nrf52840_mdk

I was playing around with adding and removing identities, and noticed that deleting identities didn't work. On the settings level this maps to the keys bt/id and bt/irk. First one is multiples of seven bytes (sizeof(bt_addr_le_t)) and the second is multiples of 16 bytes (sizeof(IRK)).

What it looks like is that if the new value for key is bigger than the previous value then it gets stored and later recovered (through settings_load) just fine, however if the new value is smaller than the previous (e.g. the identity deletion case) then the new value is not stored. I also noticed that I could work around this by inserting an "empty" entry before the next one, e.g. calling settings_save_one(NULL, 0) before the actual value.

Metadata

Metadata

Assignees

Labels

area: SettingsSettings subsystembugThe issue is a bug, or the PR is fixing a bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions