Lines Matching +full:flash +full:- +full:id
4 * 32 bit integer) and also how to read them back from flash. The reading of
7 * and writing data it also shows how data can be deleted from flash.
10 * 1. A string representing an IP-address: stored at id=1, data="192.168.1.1"
11 * 2. A binary blob representing a key: stored at id=2, data=FF FE FD FC FB FA
13 * 3. A reboot counter (32bit): stored at id=3, data=reboot_counter
14 * 4. A string: stored at id=4, data="DATA" (used to illustrate deletion of
17 * At first boot the sample checks if the data is available in flash and adds
18 * the items if they are not in flash.
21 * flash.
23 * At the 10th reboot the string item with id=4 is deleted (or marked for
26 * At the 11th reboot the string item with id=4 can no longer be read with the
31 * use. The data with id=1, id=2 and id=3 is copied to the new sector. As a
37 * SPDX-License-Identifier: Apache-2.0
45 #include <zephyr/drivers/flash.h>
83 printk("Flash device %s is not ready\n", fs.flash_device->name); in main()
97 printk("Flash Init failed, rc=%d\n", rc); in main()
102 * read it from flash, since we don't know the size read the in main()
107 printk("Id: %d, Address: %s\n", ADDRESS_ID, buf); in main()
110 printk("No address found, adding %s at id %d\n", buf, in main()
114 /* KEY_ID is used to store a key, lets see if we can read it from flash in main()
118 printk("Id: %d, Key: ", KEY_ID); in main()
124 printk("No key found, adding it at id %d\n", KEY_ID); in main()
136 * if we can read it from flash in main()
140 printk("Id: %d, Reboot_counter: %d\n", in main()
143 printk("No Reboot counter found, adding it at id %d\n", in main()
149 * if we can read it from flash, since we don't know the size read the in main()
155 printk("Id: %d, Data: %s\n", in main()
164 printk("Id: %d not found, adding it\n", in main()
172 * it from flash in main()
177 printk("Id: %d, Longarray: ", LONG_ID); in main()
185 printk("Longarray not found, adding it as id %d\n", in main()
202 * Check the counter history in flash in main()
226 cnt--; in main()