I am trying to save some data in flash.
it works, but it corrupts the Bluetooth thread .
If I call my_settings_init(), then bt_enable(NULL) never returns.
in prj.conf I added:
--------------------------------------------------------
# config using settings store and load:
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
# in file my.overlay the storage allocated is 8 pages = 32K (8 x 0x1000)
CONFIG_SETTINGS_NVS_SECTOR_COUNT=8
------------------------------------------------------------------------
the my.overlay is as so:
&flash0 { partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; storage_partition: partition@78000 { label = "storage"; reg = <0x00078000 0x00008000>; // Allocate 32K for settings storage }; }; };
added in Cmakelist.txt:
set(DTC_OVERLAY_FILE "my.overlay")
BT working is no setting system is used, setting working but currups BT.
What is wrong?
Thanks
void read_settings(void) { settings_load(); } int my_settings_init(void) { int err = settings_subsys_init(); if (err) { LOG_INF("Can't init settings subsys (%d)\n", err); return err; } err = settings_register(&my_conf); if (err) { LOG_INF("Can't register my settings handler (%d)\n", err); return err; } /* Load settings from persistent storage */ read_settings(); return 0; }