Persistent memory issue (NVS and FCB) - Zephyr V1.X versus V2 #ble #nrf52


frv
 

Hi all,

I have the following setup:
- nrf52 demo kit running a simple BLE peripheral application
- Raspberry Pi running a BLE central application

A secured connection is made (authentication based on fixed passkey) and paired information is made persistent (bonded).

I set in the peripheral's prj.conf file the following options:
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_FCB=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y

In V1.X this sometimes resulted in system crash when restarting the peripheral or when the connection was broken en reconnected for paired devices

When I built my project in V2.X with these options, I get ALWAYS a OS usage FAULT, Illegal load of EXC_RETURN into PC and results further in a FATAL ERROR and halts the system.

However when I use these options in V2.X:

CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

no more system crash. 

I'm wondering if the issue is related to Flash Circular Buffer support (https://docs.zephyrproject.org/1.13.0/reference/kconfig/CONFIG_FCB.html)
CONFIG_FCB=y
CONFIG_SETTINGS_FCB=y

In the peripheral sample applic distributed with V2.X CONFIG_SETTINGS_FCB is replaced by CONFIG_NVS

Best regards,
Frank

Join devel@lists.zephyrproject.org to automatically receive all group messages.