{"action":"created","issue":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6391","repository_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6391/labels{/name}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6391/comments","events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6391/events","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6391","id":300398393,"number":6391,"title":"NVS: Non Volatile Storage solution for zephyr","user":{"login":"Laczen","id":579004,"avatar_url":"https://avatars1.githubusercontent.com/u/579004?v=4","gravatar_id":"","url":"https://api.github.com/users/Laczen","html_url":"https://github.com/Laczen","followers_url":"https://api.github.com/users/Laczen/followers","following_url":"https://api.github.com/users/Laczen/following{/other_user}","gists_url":"https://api.github.com/users/Laczen/gists{/gist_id}","starred_url":"https://api.github.com/users/Laczen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Laczen/subscriptions","organizations_url":"https://api.github.com/users/Laczen/orgs","repos_url":"https://api.github.com/users/Laczen/repos","events_url":"https://api.github.com/users/Laczen/events{/privacy}","received_events_url":"https://api.github.com/users/Laczen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2018-02-26T21:14:37Z","updated_at":"2018-04-09T15:04:48Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6391","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6391","diff_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6391.diff","patch_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6391.patch"},"body":"There are only limited solutions for storage of configuration settings and state saves in zephyr. There is fatfs, nffs and fcb. The first two solutions are large and less suited for storage on internal flash because they do not do wear levelling. FCB also has its disadvantages as the API is complex and it is less suited to store state saves (e.g. state of a light switch over reboots) of a zephyr device.\r\n\r\nNVS is a library that provides a solution for the combined storage of configuration settings and states in an area of internal or external flash. The data is stored as identifier-value pairs. This allows configuration settings to be stored (and rewritten) as one identifier-value pair and states as another identifier-value pair. Identifier-value pairs are \"overwritten\" by a new write. Then there are multiple identifier-value pairs in flash, the latest of which is considered as the valid pair. When a flash sector is full the library makes sure that before erasing a sector the latest identifier-value pair is copied to the new sector (and this for all identifiers in use). The library also allows the history of an identifier-value pair to be searched.\r\n\r\nNVS has the following advantages over existings solutions:\r\n\r\n- Low ram usage: a NVS file system only uses 48 bytes of ram\r\n- Low flash usage: the library typically only uses about 2400 bytes of flash\r\n- Provides a solution for combined storage of states and configuration settings\r\n- Security: writes are limited to the area that is selected for NVS\r\n- Ensures data integrity using a CRC check\r\n- A sample of how to use NVS is provided in samples/subsys/nvs.\r\n\r\nTypical use cases:\r\n\r\n- State storage (e.g. state of light switch, but also bluetooth mesh iv_index and sequence counter)\r\n- Configuration settings\r\n- Log storage: identifiers can be used to differentiate between log subsystems, the history can be reviewed and for each log subsystem there will be at least the latest log line.\r\n\r\nSigned-off-by: Laczen JMS <laczenjms@gmail.com>"},"comment":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/comments/379784408","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6391#issuecomment-379784408","issue_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6391","id":379784408,"user":{"login":"Laczen","id":579004,"avatar_url":"https://avatars1.githubusercontent.com/u/579004?v=4","gravatar_id":"","url":"https://api.github.com/users/Laczen","html_url":"https://github.com/Laczen","followers_url":"https://api.github.com/users/Laczen/followers","following_url":"https://api.github.com/users/Laczen/following{/other_user}","gists_url":"https://api.github.com/users/Laczen/gists{/gist_id}","starred_url":"https://api.github.com/users/Laczen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Laczen/subscriptions","organizations_url":"https://api.github.com/users/Laczen/orgs","repos_url":"https://api.github.com/users/Laczen/repos","events_url":"https://api.github.com/users/Laczen/events{/privacy}","received_events_url":"https://api.github.com/users/Laczen/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T15:04:48Z","updated_at":"2018-04-09T15:04:48Z","author_association":"NONE","body":"@carlescufi I will address the review comments and tests, at the moment I am involved in other projects."}}
{"actor":{"display_login":"Laczen"}}