Re: Settings subsystem


Puzdrowski, Andrzej
 

So while loading settings subsystem loads all available in storage kay-value pairs. Guaranteed are that it will load the most recently values as the last and  then h_commit handler will be executed.

Settings doesn’t implement any cash for value-pair while loading.

For FCB-backend there is a try patch which intended to mitigate inconvenience described above: https://github.com/zephyrproject-rtos/zephyr/pull/11574

 

So can you check whether what you expected was loaded just in next step?

 

 

 

From: devel@... [mailto:devel@...] On Behalf Of robert.konc@...
Sent: Tuesday, December 04, 2018 11:57 AM
To: devel@...
Subject: [Zephyr-devel] Settings subsystem

 

I'm using settings to save application data.
But after one setting was writen more than once and application is restarted I get after call settings_load() first value and not last one.
For writing I use settings_save_one().

This is part of flash where settings are stored.

îîÿÀ.ÿ...SENP/SEN/RNG=200000.000000ú.SENP/SEN/SENS=0.003000).SENP/SEN/OFFS=0.000000..SENP/RNG/MIN=-100000.000000ã.SENP/RNG/ZERO=0.000000*.SENP/RNG/MAX=10000.000000}.SENP/FLT/TIME=5000l.SENP/FLT/CUTF=50æ.SENP/SEN/OFFS=-0.000055ü.SENP/SEN/OFFS=-0.000054ûÿÿÿÿÿ

Settings key "SENP/SEN/OFFS" is writen twice. But when I call settings_load() I get "0.000000" instead "-0.000054".

Here is also Hex valuje.

EE EE FF C0 01 FF 00 00  1A 53 45 4E 50 2F 53 45

4E 2F 52 4E 47 3D 32 30  30 30 30 30 2E 30 30 30

30 30 30 FA 16 53 45 4E  50 2F 53 45 4E 2F 53 45

4E 53 3D 30 2E 30 30 33  30 30 30 29 16 53 45 4E

50 2F 53 45 4E 2F 4F 46  46 53 3D 30 2E 30 30 30

30 30 30 91 1B 53 45 4E  50 2F 52 4E 47 2F 4D 49

4E 3D 2D 31 30 30 30 30  30 2E 30 30 30 30 30 30

E3 16 53 45 4E 50 2F 52  4E 47 2F 5A 45 52 4F 3D

30 2E 30 30 30 30 30 30  2A 19 53 45 4E 50 2F 52

4E 47 2F 4D 41 58 3D 31  30 30 30 30 2E 30 30 30

30 30 30 7D 12 53 45 4E  50 2F 46 4C 54 2F 54 49

4D 45 3D 35 30 30 30 6C  10 53 45 4E 50 2F 46 4C

54 2F 43 55 54 46 3D 35  30 E6 17 53 45 4E 50 2F

53 45 4E 2F 4F 46 46 53  3D 2D 30 2E 30 30 30 30

35 35 FC 17 53 45 4E 50  2F 53 45 4E 2F 4F 46 46

53 3D 2D 30 2E 30 30 30  30 35 34 FB FF FF FF FF


Regards,
Robert

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