{"id":467674,"date":"2025-07-19T00:02:00","date_gmt":"2025-07-19T00:02:00","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=467674"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=467674","title":{"rendered":"<span>\u041f\u0443\u0441\u043a LittleFS (NVRAM \u0441 \u0437\u0430\u043f\u0440\u0435\u0442\u043e\u043c \u0434\u043e-\u0437\u0430\u043f\u0438\u0441\u0438 flash)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p>\u041b\u044e\u0431\u0430\u044f \u0432\u0435\u0449\u044c \u043b\u0443\u0447\u0448\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0451 \u0435\u0441\u0442\u044c NVRAM.  <\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5b3\/f04\/2b0\/5b3f042b08a91d7684fd3ecdce95b045.png\" width=\"745\" height=\"372\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/5b3\/f04\/2b0\/5b3f042b08a91d7684fd3ecdce95b045.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5b3\/f04\/2b0\/5b3f042b08a91d7684fd3ecdce95b045.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u041f\u0440\u043e\u043b\u043e\u0433<\/h3>\n<p>\u0412 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 MCU \u043f\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u0430\u043a \u0438 \u0432 \u043e\u0431\u044a\u0451\u043c\u0435 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c. <\/p>\n<p>\u0412\u043e\u0442 \u0432\u0430\u043c \u044f\u0440\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u041d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c NVRAM \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u0433\u0434\u0435 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b \u043f\u0430\u043c\u044f\u0442\u0438 (\u044d\u0442\u043e \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 FC7300x). \u0421\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e \u0447\u0435\u0441\u0442\u043d\u043e\u043c\u0443, \u043d\u0435 \u0432\u0441\u044f\u043a\u0438\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u041c\u041a \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 NVRAM. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c NVRAM \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0437\u0430\u043f\u0440\u0435\u0442\u0430 \u0434\u043e-\u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0443\u0436\u043d\u0430 \u043d\u0435 \u0445\u0438\u043b\u0430\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 (\u0434\u0432\u0443\u0445-\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438, \u0434\u0435\u0440\u0435\u0432\u044c\u044f, \u0434\u0435\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435).  <\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/p>\n<ul>\n<li>\n<p>\u041f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u0441\u0430\u043c\u043e\u043c\u0443. \u042d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u0417\u0430\u0442\u043e \u0432\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0433\u0438\u0431\u043a\u0443\u044e \u0442\u043e\u0432\u0430\u0440\u043d\u0443\u044e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438\u0437 Open-Source (third-party). \u042d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u041d\u043e \u0432\u044b \u0442\u0435\u0440\u044f\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c. <\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043d\u0438 \u043a\u0440\u0443\u0442\u0438, \u043d\u043e \u043f\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 third-party \u043a\u043e\u0434\u043e\u043c. \u0418 \u0432\u043e\u0442 \u043d\u0430\u0441\u0442\u0430\u043b \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0430<\/h3>\n<p>\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c NVRAM \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0439 flash \u043f\u0430\u043c\u044f\u0442\u044c. \u041e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043f\u0443\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b LittleFs \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. \u041f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c LittleFs. <\/p>\n<p><u>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a NVRAM<\/u><br \/>1&#8212;\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 <strong>\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u043d\u044b<\/strong> (\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u0432\u043e\u0439\u043a\u0438).<br \/>2&#8212;<strong>\u041d\u0435 <\/strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c <strong>\u0434\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c<\/strong> \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b Flash \u043f\u0430\u043c\u044f\u0442\u0438.<br \/>3&#8212;NVRAM \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c <strong>Lazy Write<\/strong>. \u041d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0442\u0430\u043c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c.<br \/>4&#8212;\u0415\u0441\u043b\u0438 <strong>\u0441\u0442\u0438\u0440\u0430\u0442\u044c <\/strong>flash, \u0442\u043e <strong>\u0441\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 <\/strong>\u043f\u043e 8k Byte<br \/>5&#8212;\u0415\u0441\u043b\u0438 <strong>\u043f\u0438\u0441\u0430\u0442\u044c <\/strong>flash, \u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e <strong>\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 <\/strong>128 \u0431\u0430\u0439\u0442.<br \/>6&#8212;<strong>\u041f\u0438\u0441\u0430\u0442\u044c \u043f\u043e \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u043e\u043c\u0443 <\/strong>\u0430\u0434\u0440\u0435\u0441\u0443 (128 byte)<br \/>7&#8212;<strong>\u0421\u0442\u0438\u0440\u0430\u0442\u044c \u043f\u043e \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u043e\u043c\u0443 <\/strong>\u0430\u0434\u0440\u0435\u0441\u0443 (8k Byte)<br \/>8&#8212;\u0421\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 <strong>\u0421\u0438<\/strong><br \/>9&#8212;<strong>\u0420\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435<\/strong>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Nor-Flash \u043f\u0430\u043c\u044f\u0442\u0438 (endurance optimization). \u041d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u043e\u0434\u043d\u043e \u043c\u0435\u0441\u0442\u043e<br \/>10&#8212;\u0414\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u0448\u0438\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e\u0433\u043e <strong>\u043f\u0440\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043f\u0438\u0442\u0430\u043d\u0438\u044f <\/strong>(power off tolerance).  <br \/>11&#8212;<strong>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 <\/strong>\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u0447\u0435\u043c\u0443 \u0431\u044b\u043b\u043e \u043b\u043e\u043c\u0430\u0442\u044c\u0441\u044f.<br \/>12&#8212;\u0424\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d <strong>\u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <\/strong>\u043f\u043e \u0438\u043c\u0435\u043d\u0438 (&lt;100ms)<br \/>13&#8212;\u0424\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d <strong>\u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f<\/strong> (&lt;100ms)<br \/>14&#8212;\u0424\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d\u00a0<strong>\u0431\u044b\u0441\u0442\u0440\u043e<\/strong>\u00a0<strong>\u0441\u0442\u0438\u0440\u0430\u0442\u044c\u0441\u044f<\/strong>  (&lt;100ms)<br \/>15&#8212;<strong>\u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c NVRAM. \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f. \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0442\u0430\u043a, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<h3>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0441\u043e\u0440\u0446\u044b LittleFs \u043d\u0430\u0434\u043e \u0447\u0435\u0442\u043a\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0432\u043e\u0442 \u044d\u0442\u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f.<\/p>\n<p><strong>\u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441\u00a0<\/strong>&#8212; \u0430\u0434\u0440\u0435\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043d\u0443\u043b\u044f. \u041f\u0435\u0440\u0438\u043e\u0434\u044b \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e &#8212; \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0434\u0432\u043e\u0439\u043a\u0438: 128 \u0438\u043b\u0438 8192.  <\/p>\n<p><strong>\u0421\u0435\u043a\u0442\u043e\u0440 \u043f\u0430\u043c\u044f\u0442\u0438<\/strong>\u00a0&#8212; \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 8kByte  <\/p>\n<p><strong>third-party<\/strong> &#8212; \u043a\u043e\u0434 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0441\u043a\u0430\u0447\u0430\u043b\u0438 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<p><strong>\u0411\u043b\u043e\u043a <\/strong>&#8212; \u044d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u0438 \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0442\u043e\u0440 flash \u043f\u0430\u043c\u044f\u0442\u0438. LittleFs \u0441\u0442\u0438\u0440\u0430\u0435\u0442 \u0431\u043b\u043e\u043a\u0430\u043c\u0438. \u0412 \u043c\u043e\u0451\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0431\u043b\u043e\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u0435\u043d 8kByte<\/p>\n<p><strong>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 <\/strong>&#8212; \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438. \u0412 \u043c\u043e\u0435\u043c \u043d\u044b\u043d\u0435\u0448\u043d\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0440\u0430\u0432\u043d\u0430 128 \u0431\u0430\u0439\u0442. \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0430\u043c\u044f\u0442\u0438\u00a0&#8212; \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 128\u0431\u0430\u0439\u0442.  <\/p>\n<p><strong>NVRAM <\/strong>&#8212; \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c (NV) \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c (RAM). \u041f\u043e \u0441\u0443\u0442\u0438 Key Val-Map(\u043a\u0430). \u0412 \u043d\u0435\u0439 \u043c\u043e\u0433\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u044b\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0432\u043e\u0438\u043c ID \u0447\u0438\u0441\u043b\u043e\u043c.  <\/p>\n<p><strong>dword\u00a0<\/strong>(double word)\u00a0\u2014 \u044d\u0442\u043e 4\u0445 \u0431\u0430\u0439\u0442\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f (32\u00a0\u0431\u0438\u0442).<\/p>\n<p><strong>word\u00a0\u2014\u00a0<\/strong>\u044d\u0442\u043e \u0434\u0432\u0443\u0445\u0431\u0430\u0439\u0442\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f (16\u00a0\u0431\u0438\u0442)<\/p>\n<p><strong>byte\u00a0<\/strong>\u2014 \u044d\u0442\u043e 8\u043c\u0438 \u0431\u0438\u0442\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f<\/p>\n<p><strong>\u0434\u0430\u043d\u043d\u044b\u0435 <\/strong>&#8212; \u043c\u0430\u0441\u0441\u0438\u0432 hex \u0431\u0430\u0439\u0442\u043e\u0432 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u043d\u043e\u0439<\/p>\n<p><strong>File<\/strong>\u00a0&#8212; \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c RAM, ROM (Flash), FRAM, EEPROM, SD \u043a\u0430\u0440\u0442\u044b, \u043a\u043e\u043c\u043f\u0430\u043a\u0442 \u0434\u0438\u0441\u043a\u0438, \u0434\u0438\u0441\u043a\u0435\u0442\u044b, \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u0430\u044f \u043b\u0435\u043d\u0442\u0430, \u0441\u0442\u0435\u043a\u043b\u043e. \u0414\u0430 \u0432\u0441\u0451 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e. \u0427\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439? \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043a \u044d\u0442\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e. \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u0422\u0430\u043a \u043f\u0440\u043e\u0449\u0435. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432, \u0442\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0440\u044f\u0434\u043e\u043c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0434\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u00a0<strong>\u0434\u043b\u0438\u043d\u0443<\/strong>\u00a0\u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. <\/p>\n<p><strong>Lazy write<\/strong> &#8212; \u044d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0436\u0435 \u0442\u0430\u043c \u043b\u0435\u0436\u0430\u0442, \u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 write \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 OK. \u042d\u0442\u043e \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0432 \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u0430 \u043e\u043d \u0443\u0436\u0435 \u0442\u0430\u043c \u0435\u0441\u0442\u044c, \u0442\u043e  \u0432\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u043d\u043e\u0432\u0430. <\/p>\n<p><strong>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u0430<\/strong><br \/>FatFs \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0430 \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u043a \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043f\u0438\u0442\u0430\u043d\u0438\u044f. B  FatFs \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0438\u0437\u043d\u043e\u0441\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 Flash \u043f\u0430\u043c\u044f\u0442\u0438. \u041e\u0431\u044b\u0447\u043d\u043e FatFs \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043d\u0430 SD \u043a\u0430\u0440\u0442\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0437\u043d\u043e\u0441\u0430 Flash \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0414\u0435\u0441\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u0431\u044b\u043b \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u0435\u043c \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u0432\u044b\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e NVRAM. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a. \u0421\u0445\u0435\u043c\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0432 \u043f\u043b\u0430\u0442\u0443 \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442 3 \u0438\u043b\u0438 6 GPIO \u043f\u0438\u043d\u043e\u0432 \u0438 \u0434\u0436\u0430\u043c\u043f\u0435\u0440\u0430\u043c\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 GPIO, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f 1\u04453\u04456=18 \u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0438\u043b\u043b\u0438\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0430 1 \u0431\u0438\u0442. \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0442\u0430\u043a, \u0434\u0430? NVRAM \u043d\u0430 \u0434\u0436\u0430\u043c\u043f\u0435\u0440\u0430\u0445 &#8212; \u044d\u0442\u043e \u044f\u0440\u0447\u0430\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043b\u044e\u0442\u043e\u0433\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0442\u0447\u0430\u044f\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u043c \u0436\u0435 \u0442\u0435\u043a\u0441\u0442\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b, \u043a\u0430\u043a \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e NVRAM c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0441\u0438\u043b\u0438\u044f\u043c\u0438.  <\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0431\u044b\u043b\u0438 \u0442\u0435\u043a\u0441\u0442\u044b \u043f\u0440\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 NVRAM. \u0412\u043e\u0442 \u043e\u043d\u0438<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"317\" width=\"317\">\n<p align=\"left\"><strong>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"280\" width=\"280\">\n<p align=\"left\"><strong>URL<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0422\u0438\u043f<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"317\" width=\"317\">\n<p align=\"left\">NVRAM \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<td data-colwidth=\"280\" width=\"280\">\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/706972\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/706972\/<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">on-chip<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"317\" width=\"317\">\n<p align=\"left\">NVRAM \u041f\u043e\u0432\u0435\u0440\u0445 off-chip SPI-NOR Flash  <\/p>\n<\/td>\n<td data-colwidth=\"280\" width=\"280\">\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/732442\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/732442\/<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">off-chip<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"317\" width=\"317\">\n<p align=\"left\">NVRAM \u0438\u0437 EEPROM<\/p>\n<\/td>\n<td data-colwidth=\"280\" width=\"280\">\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/815639\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/815639\/<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">on-chip<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 NVRAM \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438  <strong>\u0434\u043e-\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c<\/strong> \u0430\u0434\u0440\u0435\u0441\u0430 Flash \u043f\u0430\u043c\u044f\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0434\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043b\u044e\u043a\u0441\u0430 \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u0432 \u043f\u043e\u043c\u0438\u043d\u0435! \u0414\u0430&#8230; \u0412\u043e \u043d\u0430\u043a\u0430\u043d\u0443\u043d\u0435 \u043c\u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0441\u044f MCU \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0439 Flash \u043f\u0430\u043c\u044f\u0442\u044c\u044e. \u0415\u0441\u043b\u0438 \u0431\u044b \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f Flash \u044f \u0431\u044b \u0432\u044b\u0431\u0440\u0430\u043b \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u043e\u0442\u043b\u0430\u0436\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438 \u0434\u0435\u043b\u043e \u0441 \u043a\u043e\u043d\u0446\u043e\u043c. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u043e\u0434\u0432\u0438\u0433\u043b\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0448\u0438\u0440\u043e\u0447\u0430\u0439\u0448\u0435\u0433\u043e \u0438 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 open-source \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u0430\u043a <strong>LittleFs<\/strong>. \u0420\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u0441\u0432\u043e\u0438\u0442\u044c. <\/p>\n<h3>\u041b\u0438\u043a\u0431\u0435\u0437 \u043f\u043e LittleFs<\/h3>\n<p>Little Fs &#8212; \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c \u0421\u0438 (\u042199). \u041e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0442\u0440\u0435\u043c\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u0438 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c\u0438:<\/p>\n<p><strong>\u0423\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u043a \u0441\u0431\u043e\u044f\u043c \u043f\u0438\u0442\u0430\u043d\u0438\u044f<\/strong> \u2014 littlefs \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0441\u0431\u043e\u0435\u0432 \u043f\u0438\u0442\u0430\u043d\u0438\u044f. \u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043c\u0435\u044e\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u0443\u044e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u044e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e.  <strong>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043d\u043e\u0441\u0430 <\/strong>\u2014 littlefs \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0444\u043b\u044d\u0448-\u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043d\u043e\u0441\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, littlefs \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u0431\u043e\u0439\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0438 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c \u0438\u0445.  <strong>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u041e\u0417\u0423\/\u041f\u0417\u0423 <\/strong>\u2014 littlefs \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0451\u043c\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u041e\u0417\u0423 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u041e\u0417\u0423 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u043e\u0441\u0442\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0424\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438, \u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u0431\u0443\u0444\u0435\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043f\u043e\u0433\u043e\u043d\u044f\u0442\u044c LittleFs \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e Win \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0432\u043e\u0435\u043c LapTop-\u0435. \u041f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e\u0431\u044b Little FS \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u041f\u043e\u0441\u043b\u0435 block_cycles \u0440\u0430\u0437 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430, \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0430\u0434\u0430\u0435\u0442 \u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0431\u044b \u0442\u043e  \u043d\u0438 \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u044f \u0437\u0430\u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 <strong>offset<\/strong>. \u0417\u0430\u0442\u0435\u043c \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e LittleFs \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0438\u0448\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u0442 \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u043a\u0442\u043e\u0440\u0430. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e <strong>\u0434\u043e\u043c\u043d\u043e\u0436\u0438\u0442\u044c <\/strong>\u0431\u043b\u043e\u043a \u043d\u0435 \u043d\u0430 128 \u0431\u0430\u0439\u0442\u0430, \u0430 \u043d\u0430 8192 \u0431\u0430\u0439\u0442\u0430. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u0440\u0438\u0441\u0442\u0430\u043b\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0434\u043b\u044f \u041c\u041a FC7300. \u0412\u043e\u0442 \u043e\u043d.<\/p>\n<pre><code class=\"cpp\">#include \"little_fs_config.h\"  #include \"data_utils.h\" #include \"sw_nor_flash.h\" #include \"log.h\"  #define LITTLE_FS_NOR_FLASH_NUM 1 #define LITTLE_FS_BLOCK_SIZE  8192 #define LITTLE_FS_PAGE_SIZE  128 #define LITTLE_FS_CACHE_SIZE (LITTLE_FS_PAGE_SIZE)   #ifdef LFS_NO_MALLOC \/\/ Optional statically allocated read buffer. \/\/ Must be cache_size. \/\/ By default lfs_malloc is used to allocate this buffer. static uint8_t readBuffer[LITTLE_FS_CACHE_SIZE] = {0}; static uint8_t progBuffer[LITTLE_FS_CACHE_SIZE] = {0}; static uint8_t lookaheadBuffer[LITTLE_FS_PAGE_SIZE] = {0}; #endif  static int FlashToLittleFsRet(bool res) {     int ret = LFS_ERR_OK;     if (false == res) {         ret = LFS_ERR_CORRUPT;     }     return ret; }  static int user_provided_block_device_prog(const struct lfs_config* c,                                            lfs_block_t block,                                            lfs_off_t off,                                            const void* buffer,                                            lfs_size_t size) {     int ret = LFS_ERR_CORRUPT;     bool res = false;     LOG_NOTICE(LITTLE_FS, \"Write,Block:%u,OffSet:%u,Size:%u\",                 block, off, size);     uint32_t phy_address = 0;     phy_address = block * LITTLE_FS_BLOCK_SIZE + off;     res = sw_nor_flash_write(LITTLE_FS_NOR_FLASH_NUM,                              phy_address,                              (uint8_t*) buffer,                              size);     ret = FlashToLittleFsRet(res);     return ret; }  static int user_provided_block_device_read(const struct lfs_config* c,                                            lfs_block_t block,                                            lfs_off_t off,                                            void* buffer,                                            lfs_size_t size) {     int ret = 0;     LOG_DEBUG(LITTLE_FS, \"Read,Block:%u,OffSet:%u,Size:%u\",                block, off, size);     uint32_t phy_address = 0;     phy_address = block * LITTLE_FS_BLOCK_SIZE + off;     bool res = sw_nor_flash_read(LITTLE_FS_NOR_FLASH_NUM,                                  phy_address,                                  (uint8_t*) buffer,                                  (uint32_t) size);     ret = FlashToLittleFsRet(res);     return ret; }  static int user_provided_block_device_erase(const struct lfs_config* c,                                             lfs_block_t block) {     int ret = LFS_ERR_CORRUPT;     LOG_WARNING(LITTLE_FS, \"EraseBlock:%u\", block);     uint32_t phy_address = block * LITTLE_FS_BLOCK_SIZE;     bool res = sw_nor_flash_erase_mem(LITTLE_FS_NOR_FLASH_NUM,                                       phy_address,                                       LITTLE_FS_BLOCK_SIZE);     ret = FlashToLittleFsRet(res);     return ret; }  static int user_provided_block_device_sync(const struct lfs_config* c) {     int ret = LFS_ERR_OK;     LOG_INFO(LITTLE_FS, \"Sync\");     return ret; }  const LittleFsConfig_t LittleFsConfig[] = {         { .num = 1, .valid = true, .name = \"LittleFs1\",           .cfg = {                  \/\/ block device operations               .read = user_provided_block_device_read,               .prog = user_provided_block_device_prog,               .erase =                user_provided_block_device_erase,               .sync = user_provided_block_device_sync,         #ifdef LFS_NO_MALLOC               .read_buffer = readBuffer,               .prog_buffer = progBuffer,               .lookahead_buffer = lookaheadBuffer,         #endif               \/\/ block device configuration               .read_size = LITTLE_FS_PAGE_SIZE,               .prog_size = LITTLE_FS_PAGE_SIZE,               .cache_size = LITTLE_FS_CACHE_SIZE,               .lookahead_size = LITTLE_FS_PAGE_SIZE,               .block_cycles = 4,               .block_size = LITTLE_FS_BLOCK_SIZE,               .block_count = 4,         },     }, };  <\/code><\/pre>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0412\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043f\u043e\u043a. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a.<\/p>\n<pre><code class=\"cpp\">bool little_fs_list(uint8_t num, const char* const path) {     bool res = false;     LOG_INFO(LITTLE_FS, \"%u,path:[%s]\", num, path);      const table_col_t cols[] = { { 5, \"N\" }, { 17, \"name\" },     { 9, \"size\" }, { 5, \"type\" }, { 5, \"type\" },      };     LittleFsHandle_t *Node = LittleFsGetNode(num);     if(Node) {         uint32_t cnt = 0;         lfs_dir_t dir = { 0 };         int err = lfs_dir_open(&amp;Node-&gt;lfs, &amp;dir, path);         res = LittleFsRetToRes(err);         if(err) {             table_header(&amp;(curWriterPtr-&gt;stream), cols, ARRAY_SIZE(cols));             struct lfs_info FileInfo = { 0 };             bool loop = true;             while(loop) {                 int ret = lfs_dir_read(&amp;Node-&gt;lfs, &amp;dir, &amp;FileInfo);                 if(ret &lt; 0) {                     LOG_ERROR(LITTLE_FS, \"ReadDirErr\");                     loop = false;                     break;                 } else {                     LOG_DEBUG(LITTLE_FS, \"ReadOk %s\",                                LittleFsFileInfoToStr(&amp;FileInfo));                     cnt++;                 }                  if(0 == ret) {                     loop = false;                     break;                 }                  char temp[150] = { 0 };                 strcpy(temp, TSEP);                 snprintf(temp, sizeof(temp), \"%s %3u \" TSEP, temp, cnt);                 snprintf(temp, sizeof(temp), \"%s %15s \" TSEP, temp, FileInfo.name);                 snprintf(temp, sizeof(temp), \"%s %7u \" TSEP, temp, FileInfo.size);                 snprintf(temp, sizeof(temp), \"%s %3u \" TSEP, temp, FileInfo.type);                 snprintf(temp, sizeof(temp), \"%s %3s \" TSEP, temp, LittleFsTypeToStr(FileInfo.type));                 cli_printf(\"%s\"CRLF, temp);             }              table_row_bottom(&amp;(curWriterPtr-&gt;stream), cols, ARRAY_SIZE(cols));             err = lfs_dir_close(&amp;Node-&gt;lfs, &amp;dir);             if(err) {                 res = false;             }         }      }       return res; }<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f12\/36b\/3b0\/f1236b3b0fdb1754a0e1ccdce9973e09.png\" width=\"586\" height=\"328\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/f12\/36b\/3b0\/f1236b3b0fdb1754a0e1ccdce9973e09.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f12\/36b\/3b0\/f1236b3b0fdb1754a0e1ccdce9973e09.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u041f\u0443\u0441\u043a NVRAM<\/h3>\n<p>\u0424\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0432 \u044d\u043d\u0435\u0440\u0433\u043e-\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0443\u044e Flash \u043f\u0430\u043c\u044f\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041a\u0440\u0430\u0441\u043e\u0442\u0430! \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0451. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u043a\u0430\u043a-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c NVRAM. \u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d NVRAM?  \u0417\u0430\u0434\u0430\u0447\u0430 NVRAM \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<br \/>1\u2014\u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c <strong>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e,<\/strong> \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u0438 \u043f\u0443\u0441\u043a\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<br \/>2\u2014\u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043b\u0435\u0436\u0430\u0449\u0438\u0439 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 NVRAM \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c *<em>.nvram (\u0438\u043b\u0438 *<\/em>.nv). \u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 NVRAM \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0412\u043e\u0442 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0430\u0439\u043b ID_123.nvram &#8212; \u044d\u0442\u043e NVRAM \u0437\u0430\u043f\u0438\u0441\u044c \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 123. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443 ID \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <strong>NVRAM <\/strong>\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0412\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430. \u042d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 LookUp \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u043f\u043e\u0439\u043c\u0435\u0442\u0435 \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0432\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0438\u0437 LittleFs-\u0444\u0430\u0439\u043b\u0430.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\"><strong>ID<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\"><strong>\u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\"><strong>\u0440\u0430\u0437\u043c\u0435\u0440<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\"><strong>Units<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">60<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT32<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">MaxUpTime<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT32<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">reboot counter<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">enum<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">12<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT8<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Booloader command<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">N<\/p>\n<\/td>\n<td>\n<p align=\"left\">launch<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT32<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">Serial number<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">N<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">11<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT32<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">boot address<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">phy address<\/p>\n<\/td>\n<td>\n<p align=\"left\">0x0800_0000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT8<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Time Zone<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">N<\/p>\n<\/td>\n<td>\n<p align=\"left\">+10<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT32<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">core frequency<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">Hz<\/p>\n<\/td>\n<td>\n<p align=\"left\">250MHz<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">Array<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">6<\/p>\n<\/td>\n<td>\n<p align=\"left\">MAC address<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">array<\/p>\n<\/td>\n<td>\n<p align=\"left\">00:00:00:00:00:00<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT32<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">IP address<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">array<\/p>\n<\/td>\n<td>\n<p align=\"left\">192.168.1.1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">6<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">string<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">N<\/p>\n<\/td>\n<td>\n<p align=\"left\">SSID for WiFi<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">text<\/p>\n<\/td>\n<td>\n<p align=\"left\">pentagon<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">7<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">string<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">N<\/p>\n<\/td>\n<td>\n<p align=\"left\">WiFi password<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">text<\/p>\n<\/td>\n<td>\n<p align=\"left\">1234<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">71<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT32<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">WatchDog period<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">ms<\/p>\n<\/td>\n<td>\n<p align=\"left\">3000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">70<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT8<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">WatchDog  ctrl<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">on\/off<\/p>\n<\/td>\n<td>\n<p align=\"left\">on<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">8<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT32<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">App CRC32<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">N<\/p>\n<\/td>\n<td>\n<p align=\"left\">0x55555555<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"55\" width=\"55\">\n<p align=\"left\">9<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p align=\"left\">UINT32<\/p>\n<\/td>\n<td data-colwidth=\"74\" width=\"74\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">App LEN<\/p>\n<\/td>\n<td data-colwidth=\"115\" width=\"115\">\n<p align=\"left\">bytes<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u042d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0440\u0430\u0434\u0438\u043e \u0442\u0440\u0430\u043d\u0441\u0438\u0432\u0435\u0440\u0430\u043c\u0438 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 NVRAM \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u0438 \u0438 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438. \u0418\u043b\u0438 \u043a\u043b\u044e\u0447\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0422\u0443\u0442 \u0432\u0430\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 ID \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0445 \u043d\u0430\u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0421\u0438 (<strong>enum<\/strong>). <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fb9\/7a8\/979\/fb97a8979e15500da3d330f95a1a783e.png\" width=\"745\" height=\"372\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/fb9\/7a8\/979\/fb97a8979e15500da3d330f95a1a783e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fb9\/7a8\/979\/fb97a8979e15500da3d330f95a1a783e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412 \u043e\u0441\u043e\u0431\u043e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0438 \u0438\u043b\u0438 \u043f\u044f\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 NVRAM. \u041f\u0438\u0441\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435, \u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0447\u0442\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0432\u043f\u0430\u043b \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u043c \u0447\u0438\u0441\u043b\u0435 \u0440\u0430\u0437. \u042d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9C%D0%B0%D0%B6%D0%BE%D1%80%D0%B8%D1%82%D0%B0%D1%80%D0%BD%D1%8B%D0%B9_%D1%8D%D0%BB%D0%B5%D0%BC%D0%B5%D0%BD%D1%82\" rel=\"noopener noreferrer nofollow\">\u043c\u0430\u0436\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a>.<\/p>\n<h3>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043a\u043e\u0434\u0430 LittleFS \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440<\/h3>\n<p>\u0412\u043e\u0442 \u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043b\u0430\u0434\u0438\u043b NVRAM \u043d\u0430 LapTop-\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u043a\u043e\u043d\u0444\u0438\u0433 \u0438 \u044d\u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 MCU. <\/p>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0432\u043d\u0443\u0442\u0440\u0438 FC7300F8MDT 8 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 on-chip \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0440\u043e \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043a\u0435\u043d 8M \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u044b.  \u041f\u043e \u043c\u0435\u0440\u043a\u0430\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043e\u043a \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 8 MByte on-chip \u043f\u0430\u043c\u044f\u0442\u0438 &#8212; \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e. \u041c\u043e\u0436\u043d\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c\u00a0<strong>\u0446\u0438\u043a\u043b\u043e\u043f\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/strong>\u00a0\u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438. \u041f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0434\u0435\u043b\u043e, \u0447\u0442\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438) \u0432 \u0447\u0438\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u043e\u0442\u043a\u0430\u0437 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435, \u0436\u0443\u0440\u043d\u0430\u043b, \u0447\u0435\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c on-chip\u00a0<strong>NVRAM\u00a0<\/strong>\u0432\u043d\u0443\u0442\u0440\u0438 FC7300F8MDT.   <\/p>\n<p>\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Flash \u043f\u0430\u043c\u044f\u0442\u044c\u044e.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"137\" width=\"137\">\n<p align=\"left\"><strong>\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"177\" width=\"177\">\n<p align=\"left\"><strong>\u0418\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"137\" width=\"137\">\n<p align=\"left\">program<\/p>\n<\/td>\n<td data-colwidth=\"177\" width=\"177\">\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">128<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"137\" width=\"137\">\n<p align=\"left\">erase<\/p>\n<\/td>\n<td data-colwidth=\"177\" width=\"177\">\n<p align=\"left\">\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">8192<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"137\" width=\"137\">\n<p align=\"left\">read<\/p>\n<\/td>\n<td data-colwidth=\"177\" width=\"177\">\n<p align=\"left\">\u043d\u0435\u0442<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0427\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 on-chip Flash  <\/h3>\n<p>\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041d\u0430 \u043b\u044e\u0431\u044b\u0445 ARM Cortex \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c Flash \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e Flash \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f\u0442: &#171;Flash \u043f\u0430\u043c\u044f\u0442\u044c map-\u0438\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 \u043f\u0430\u043c\u044f\u0442\u0438.&#187;  <\/p>\n<h3>\u0417\u0430\u043f\u0438\u0441\u044c \u0432 on-chip Flash  <\/h3>\n<p>\u041c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 FC7300F8MDT \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f:<br \/>1&#8212;\u0437\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 128 \u0431\u0430\u0439\u0442<br \/>2&#8212;\u0437\u0430\u043f\u0438\u0441\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443<br \/>3&#8212;\u041d\u0435\u043b\u044c\u0437\u044f \u0434\u043e-\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u0415\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0445\u043e\u0442\u044c \u043e\u0434\u0438\u043d \u0431\u0438\u0442 \u0438\u0437 1024 \u0431\u0438\u0442 \u0432 \u043d\u0443\u043b\u0435, \u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430. \u041f\u043e\u0432\u0442\u043e\u0440\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443. \u041f\u0440\u043e\u0448\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043a\u0440\u044b\u0442\u044b 0xFF.<\/p>\n<p>\u0412 SDK \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f API \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u0441\u0435\u043a\u0442\u043e\u0440\u0430. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 7 \u0431\u0438\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"86\" width=\"86\">\n<p align=\"center\"><strong>page<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"center\"><strong>bin<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p align=\"center\"><strong>hex<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>dec<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"86\" width=\"86\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"right\">0b0000_0000_0000<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"86\" width=\"86\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"right\">0b0000_1000_0000<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p align=\"left\">0x80<\/p>\n<\/td>\n<td>\n<p align=\"left\">128<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"86\" width=\"86\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"right\">0b0001_0000_0000<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p align=\"left\">0x100<\/p>\n<\/td>\n<td>\n<p align=\"left\">256<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"86\" width=\"86\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"175\" width=\"175\">\n<p align=\"right\">0b0001_1000_0000<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p align=\"left\">0x180<\/p>\n<\/td>\n<td>\n<p align=\"left\">384<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u043d\u0435\u0435 128 \u0431\u0430\u0439\u0442, \u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435-\u0442\u043e \u0437\u0430\u043f\u0438\u0448\u0443\u0442\u0441\u044f, \u043d\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043b\u044c\u0448\u0435 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (128 \u0431\u0430\u0439\u0442) \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u00a0<strong>\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u0445<\/strong>. \u0415\u0441\u043b\u0438 \u0412\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 128\u0431\u0430\u0439\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 129 \u0431\u0430\u0439\u0442), \u0442\u043e \u0437\u0430\u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0435 128 \u0431\u0430\u0439\u0442, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b.   \u041f\u043e \u0444\u0430\u043a\u0442\u0443, \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (128 \u0431\u0430\u0439\u0442). \u0427\u0442\u043e \u0431\u044b \u0412\u044b \u043d\u0438 \u043f\u0438\u0441\u0430\u043b\u0438, \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c 128 \u0431\u0430\u0439\u0442. \u0414\u0430. \u0418\u043d\u0430\u0447\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0437\u0430\u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u0441\u0442\u0435\u043a\u0430.  <\/p>\n<h3>\u0421\u0442\u0438\u0440\u0430\u0442\u044c on-chip Flash<\/h3>\n<p>\u0421\u043e \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435\u043c Flash \u043d\u0430\u00a0<strong>FC7300F8MDT\u00a0<\/strong>\u0432\u0441\u0451 \u0441\u043e\u0432\u0441\u0435\u043c \u0432\u0435\u0441\u0435\u043b\u043e. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 API \u0438\u0437 SDK c\u0442\u0438\u0440\u0430\u0442\u044c DFLASH \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u043f\u043e\u00a0<strong>8kByte\u00a0<\/strong>(<strong>0x2000<\/strong>) \u0437\u0430 \u0440\u0430\u0437. \u041a\u043e\u0433\u0434\u0430 Flash \u043f\u0430\u043c\u044f\u0442\u044c \u0441\u0442\u0435\u0440\u0442\u0430, \u0442\u043e \u043e\u043d\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 0xFF, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0435 \u043e\u0434\u043d\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u044b.\u00a0<\/p>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0432\u0441\u0451 \u044d\u0442\u043e \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 LittleFs \u043a\u043e\u043d\u0444\u0438\u0433. <\/p>\n<pre><code class=\"cpp\">#include \"little_fs_config.h\"  #include \"data_utils.h\" #include \"flash_mcal.h\" #include \"little_fs.h\"  #define LITTLE_FS_NOR_FLASH_NUM 1 #define LITTLE_FS_BLOCK_SIZE  8192 #define LITTLE_FS_PAGE_SIZE  128  #ifdef LFS_NO_MALLOC static uint8_t StaticFileBuffer[LITTLE_FS_CACHE_SIZE] = {0}; static uint8_t readBuffer[LITTLE_FS_CACHE_SIZE] = {0}; static uint8_t progBuffer[LITTLE_FS_CACHE_SIZE] = {0}; static uint8_t lookaheadBuffer[LITTLE_FS_PAGE_SIZE] = {0}; #endif   static int flash_device_prog(const struct lfs_config* c,                                            lfs_block_t block,                                            lfs_off_t off,                                            const void* buffer,                                            lfs_size_t size) {     int ret = LFS_ERR_CORRUPT;     bool res = false;     LOG_NOTICE(LITTLE_FS, \"Write,Block:%u,OffSet:%u,Size:%u\", block, off, size);     LittleFsHandle_t* Node = LittleFsGetNode(1);     if(Node) {         uint32_t phy_address = 0;         phy_address = Node-&gt;base_address  + block * LITTLE_FS_BLOCK_SIZE + off;         res = flash_mcal_write(phy_address, (uint8_t*) buffer, size);         ret = FlashToLittleFsRet(res);     }     return ret; }  static int flash_block_device_read(const struct lfs_config* c,                                    lfs_block_t block,                                    lfs_off_t off,                                    void* buffer,                                    lfs_size_t size) {     int ret = 0;     LittleFsHandle_t* Node = LittleFsGetNode(1);     if(Node) {         LOG_PARN(LITTLE_FS, \"Read,Block:%u,OffSet:%u,Size:%u\", block, off, size);         uint32_t phy_address = 0;         phy_address =  Node-&gt;base_address   +block * LITTLE_FS_BLOCK_SIZE + off;         bool res = flash_mcal_read( phy_address,                                     (uint8_t*) buffer,                                     (uint32_t) size);         ret = FlashToLittleFsRet(res);     }     return ret; }  static int flash_block_device_erase(const struct lfs_config* c,                                     lfs_block_t block) {     int ret = LFS_ERR_CORRUPT;     LOG_WARNING(LITTLE_FS, \"EraseBlock:%u\", block);     LittleFsHandle_t* Node = LittleFsGetNode(1);     if(Node) {         uint32_t phy_address = Node-&gt;base_address + block * LITTLE_FS_BLOCK_SIZE;         bool res = flash_mcal_erase( phy_address,                                      LITTLE_FS_BLOCK_SIZE);         ret = FlashToLittleFsRet(res);     }     return ret; }  static int flash_block_device_sync(const struct lfs_config* c) {     int ret = LFS_ERR_OK;     LOG_DEBUG(LITTLE_FS, \"Sync\");     return ret; }  static struct lfs_attr attrs={         .type = 0,         .buffer = NULL,         .size = 0, };  const LittleFsConfig_t LittleFsConfig[] = {         {           .num = 1,           .base_address = DFLASH_START,           .valid = true,           .name = \"LittleFsForNVRAM\",           .file_config = {                .buffer= StaticFileBuffer,                .attrs = &amp;attrs,                .attr_count=0,           },           .cfg = {               .read = flash_block_device_read,               .prog = flash_device_prog,               .erase = flash_block_device_erase,               .sync = flash_block_device_sync,         #ifdef LFS_NO_MALLOC               .read_buffer = readBuffer,               .prog_buffer = progBuffer,               .lookahead_buffer = lookaheadBuffer,         #endif               .read_size = LITTLE_FS_PAGE_SIZE,               .prog_size = LITTLE_FS_PAGE_SIZE,               .cache_size = LITTLE_FS_CACHE_SIZE,               .lookahead_size = LITTLE_FS_PAGE_SIZE,               .block_cycles = 4,               .block_size = LITTLE_FS_BLOCK_SIZE,               .block_count = DFLASH_SIZE\/LITTLE_FS_BLOCK_SIZE,         },     }, };  LittleFsHandle_t LittleFsInstance[] = { { .num = 1, .valid = true, }, };  uint32_t little_fs_get_cnt(void) {     uint8_t cnt1 = 0;     uint8_t cnt2 = 0;     cnt1 = ARRAY_SIZE(LittleFsConfig);     cnt2 = ARRAY_SIZE(LittleFsInstance);     if (cnt2 == cnt1) {     }     return cnt1; } <\/code><\/pre>\n<h3>\u041e\u0442\u043b\u0430\u0434\u043a\u0430<\/h3>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c04\/a0c\/1d4\/c04a0c1d4796a8ae7bdc8416858206e5.png\" width=\"1894\" height=\"475\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c04\/a0c\/1d4\/c04a0c1d4796a8ae7bdc8416858206e5.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c04\/a0c\/1d4\/c04a0c1d4796a8ae7bdc8416858206e5.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u042d\u0442\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b8e\/d85\/aee\/b8ed85aee58f0d8ce0780a9547f15726.png\" width=\"1000\" height=\"325\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b8e\/d85\/aee\/b8ed85aee58f0d8ce0780a9547f15726.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b8e\/d85\/aee\/b8ed85aee58f0d8ce0780a9547f15726.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0414\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430 NVRAM<\/h3>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u044e \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 NVRAM \u043f\u0435\u0440\u0435\u0434 \u0432\u0430\u043c\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>1++\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0443\u0436\u0435 \u0432 Run-time \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 NVRAM.<br \/>2++\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0437\u044f\u0432 \u0435\u0435 \u0438\u0437 NVRAM<br \/>3++\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0435 \u0438\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e. <br \/>4++\u0412\u0430\u0448\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 NVRAM \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u043e\u0442\u043a\u0430\u0437<br \/>5++\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432 NVRAM \u043b\u043e\u0433\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u043e\u043c\u0435\u0442\u0440 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f.<br \/>6++\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 API. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u043e \u043b\u044e\u0431\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 (\u043a\u043b\u044e\u0447\u0443).<br \/>7++\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 NVRAM \u0432\u0430\u043c \u043d\u0435 \u043d\u0430\u0434\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u043c \u043d\u0430\u0445\u043b\u0451\u0441\u0442\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043b\u044f ID \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0430 \u0434\u043b\u044f \u0434\u043b\u0438\u043d\u043d\u044b \u043b\u044e\u0431\u043e\u0435 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e.<\/p>\n<h3>\u0414\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430 LittleFs <\/h3>\n<p>1++\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u0421\u0438. \u041b\u0435\u0433\u043a\u043e \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u0439 \u0421\u0438 \u043f\u0440\u043e\u0435\u043a\u0442.<br \/>2++Dynamic wear leveling.  <br \/>3++Power-loss resilience.  <\/p>\n<h3>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 LittleFs <\/h3>\n<p>1&#8212;\u041d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f c GCC \u043a\u043b\u044e\u0447\u043e\u043c <strong>-Werror=shadow.<\/strong>. \u042d\u0442\u043e \u0434\u0435\u0442\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f C\u0438- \u043a\u043e\u0434\u0430 \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043f\u0440\u043e\u0441\u043e\u0447\u0438\u043b\u0430\u0441\u044c \u0441 \u0441\u043e\u0440\u0446\u044b LittleFs. <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ce9\/eb2\/d19\/ce9eb2d1922db06800e551e696a7c526.png\" width=\"915\" height=\"720\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/ce9\/eb2\/d19\/ce9eb2d1922db06800e551e696a7c526.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ce9\/eb2\/d19\/ce9eb2d1922db06800e551e696a7c526.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>2&#8212;LittleFs \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0435\u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u043e\u0442 \u0436\u0435 int \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 2 \u0431\u0430\u0439\u0442\u0430 \u0438 4 \u0431\u0430\u0439\u0442\u0430.<\/p>\n<pre><code class=\"cpp\">#ifndef LFS_NO_MALLOC int lfs_file_open(lfs_t *lfs, lfs_file_t *file, const char *path, int flags) {     int err = LFS_LOCK(lfs-&gt;cfg);     if (err) {         return err;     }     LFS_TRACE(\"lfs_file_open(%p, %p, \\\"%s\\\", %x)\",             (void*)lfs, (void*)file, path, (unsigned)flags);     LFS_ASSERT(!lfs_mlist_isopen(lfs-&gt;mlist, (struct lfs_mlist*)file));      err = lfs_file_open_(lfs, file, path, flags);      LFS_TRACE(\"lfs_file_open -&gt; %d\", err);     LFS_UNLOCK(lfs-&gt;cfg);     return err; } #endif<\/code><\/pre>\n<p>3&#8212;LittleFs &#8212; \u044d\u0442\u043e open-source \u043a\u043e\u0434. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 101% \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 LittleFs \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c\u0443 \u0441\u0430\u043c\u043e\u0431\u044b\u0442\u043d\u043e\u043c\u0443 code-style.<\/p>\n<p>4&#8212;\u0423 LittleFS \u043d\u0435\u0442 <strong>Lazy Write<\/strong>. \u0412 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u043d\u0430 \u043a\u0443\u0445\u043e\u043d\u043d\u044b\u0439, \u0435\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 (\u0431\u0438\u0442 \u0432 \u0431\u0438\u0442), \u0442\u043e  Little FS \u0431\u0443\u0434\u0435\u0442 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c OK \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u0443\u0436\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0436\u0435\u0440\u0442\u0432\u0430\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u043f\u043e\u043b\u0435\u0439 Flash \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/78a\/aab\/add\/78aaabaddb2b3dead8d63c551042d476.png\" alt=\"\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b (((\" title=\"\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b (((\" width=\"908\" height=\"715\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/78a\/aab\/add\/78aaabaddb2b3dead8d63c551042d476.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/78a\/aab\/add\/78aaabaddb2b3dead8d63c551042d476.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b (((<\/figcaption><\/div>\n<\/figure>\n<p>5&#8212;LittleFs \u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u0437\u0430\u043a\u043b\u0438\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 assert-\u0435, \u043d\u0430\u0434\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043e\u0434 \u0441 \u043a\u043b\u044e\u0447\u043e\u043c -D<strong>LFS_NO_ASSERT.<\/strong><\/p>\n<p>6&#8212;\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0431\u043e\u0440\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 LittleFS \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f 30kByte Flash \u043f\u0430\u043c\u044f\u0442\u0438. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0441 \u043c\u0430\u043b\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 Flash.<\/p>\n<p>7&#8212;LittleFS \u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043b\u044f stm32 \u0442\u0430\u043a \u043a\u0430\u043a \u0443 STM32 \u0431\u043b\u043e\u043a\u0438 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0420\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u043e 16kByte.<\/p>\n<p>8&#8212;\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c LittleFS \u0444\u0430\u0439\u043b \u0434\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0435\u043a\u0432\u0435\u043d\u0446\u0438\u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u042d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0433\u0434\u0430 \u0412\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0412\u0430\u043c \u043d\u0430\u0434\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0432\u0430\u0440\u0446\u0435\u0432\u043e\u0433\u043e \u0440\u0435\u0437\u043e\u043d\u0430\u0442\u043e\u0440\u0430. \u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043f\u0438\u0440\u043e\u0436\u043a\u0438 \u0441 \u043a\u0430\u043f\u0443\u0441\u0442\u043e\u0439.<\/p>\n<h3>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f LitteFS<\/h3>\n<p>1&#8212;SIM \u043a\u0430\u0440\u0442\u044b. \u041c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 \u043d\u0430 SIM \u043a\u0430\u0440\u0442\u0435.<br \/>2&#8212;\u041f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u0432 LittleFS \u0444\u0430\u0439\u043b\u0438\u043a\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0446\u0435\u043b\u0443\u044e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0435\u0435 \u0432 bootloader-\u0430\u0445.<br \/>3&#8212;In-memory \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u043e\u0439 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u043d \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438\u043b\u0438 SPI-Flash ASIC.<br \/>4&#8212;\u041c\u043e\u0436\u043d\u043e \u0432 NVRAM \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0418 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<h3>\u0418\u0442\u043e\u0433\u0438<\/h3>\n<p>\u0423\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c <strong>LittleFS<\/strong>. \u0423\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c <strong>NVRAM <\/strong>\u043f\u043e\u0432\u0435\u0440\u0445 LittleFS.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0421\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0430 PC, \u0442\u0430\u043a \u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435.<\/p>\n<h3>\u0421\u043b\u043e\u0432\u0430\u0440\u044c<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"138\" width=\"138\">\n<p align=\"left\"><strong>\u0410\u043a\u0440\u043e\u043d\u0438\u043c<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"138\" width=\"138\">\n<p align=\"left\">FS<\/p>\n<\/td>\n<td>\n<p align=\"left\">File System<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"138\" width=\"138\">\n<p align=\"left\">RAM  (\u041e\u0417\u0423)<\/p>\n<\/td>\n<td>\n<p align=\"left\">Random-Access Memory  <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"138\" width=\"138\">\n<p align=\"left\">NVRAM<\/p>\n<\/td>\n<td>\n<p align=\"left\">Non-Volatile Random-Access Memory  <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"138\" width=\"138\">\n<p align=\"left\">ASIC<\/p>\n<\/td>\n<td>\n<p align=\"left\">Application-Specific Integrated Circuit<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"138\" width=\"138\">\n<p align=\"left\">BSD <\/p>\n<\/td>\n<td>\n<p align=\"left\"> Berkeley Software Distribution licenses <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"138\" width=\"138\">\n<p align=\"left\">API<\/p>\n<\/td>\n<td>\n<p align=\"left\">Application Programming Interface  <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"138\" width=\"138\">\n<p align=\"left\">COW  <\/p>\n<\/td>\n<td>\n<p align=\"left\"> copy-on-write<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>\u0421\u0441\u044b\u043b\u043a\u0438 <\/strong><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\"><strong>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>URL<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">littlefs technical specification<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/littlefs-project\/littlefs\/blob\/master\/SPEC.md\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/littlefs-project\/littlefs\/blob\/master\/SPEC.md<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">The design of littlefs<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/littlefs-project\/littlefs\/blob\/master\/DESIGN.md\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/littlefs-project\/littlefs\/blob\/master\/DESIGN.md<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">FatFs &#8212; Generic FAT Filesystem Module<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/elm-chan.org\/fsw\/ff\/00index_e.html\" rel=\"noopener noreferrer nofollow\">https:\/\/elm-chan.org\/fsw\/ff\/00index_e.html<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">\u0421\u043e\u0440\u0446\u044b LittleFs<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/littlefs-project\/littlefs\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/littlefs-project\/littlefs<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">\u041a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0433\u043e\u043d\u044f\u0442\u044c LittleFs \u043a\u0430\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432 Windows<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/aabzel\/Artifacts\/tree\/main\/little_fs_on_pc\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/aabzel\/Artifacts\/tree\/main\/little_fs_on_pc<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">LittleFS File System with MCU Internal FLASH Memory<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/mcuoneclipse.com\/2023\/07\/04\/littlefs-file-system-with-mcu-internal-flash-memory\/\" rel=\"noopener noreferrer nofollow\">LittleFS File System with MCU Internal FLASH Memory | MCU on Eclipse<\/a>  <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">\u041c\u0430\u0436\u043e\u0440\u0438\u0442\u0430\u0440\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9C%D0%B0%D0%B6%D0%BE%D1%80%D0%B8%D1%82%D0%B0%D1%80%D0%BD%D1%8B%D0%B9_%D1%8D%D0%BB%D0%B5%D0%BC%D0%B5%D0%BD%D1%82\" rel=\"noopener noreferrer nofollow\">https:\/\/ru.wikipedia.org\/wiki\/\u041c\u0430\u0436\u043e\u0440\u0438\u0442\u0430\u0440\u043d\u044b\u0439_\u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">\u0414\u0430\u0439\u0442\u0435 \u043c\u043d\u0435 15 \u043c\u0438\u043d\u0443\u0442, \u0438 \u044f \u0438\u0437\u043c\u0435\u043d\u044e \u0432\u0430\u0448 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 GDB <a class=\"mention\" href=\"\/users\/djivs\">@Djivs<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/824638\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/824638\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">LittleFS \u2013 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0430\u044f \u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u043d\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043b\u044f ARM \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 mbed os. \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442 <a href=\"https:\/\/habr.com\/ru\/users\/Sub_Dia\/\" rel=\"noopener noreferrer nofollow\">@Sub_Dia<\/a>  <\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/347348\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/347348\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">STM32 &#8212; LittleFS Flash File System Interfacing<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/merkles.com\/wiki\/index.php\/STM32_-_LittleFS_Flash_File_System_Interfacing\" rel=\"noopener noreferrer nofollow\">https:\/\/merkles.com\/wiki\/index.php\/STM32_-_LittleFS_Flash_File_System_Interfacing<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 ToolChain-a \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f MCU FlagChip FC7300F8MDT<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/742274\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/742274\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\">\u0412\u044b\u043f\u0443\u0441\u043a \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b LittleFS 2.10<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=62398\" rel=\"noopener noreferrer nofollow\">https:\/\/www.opennet.ru\/opennews\/art.shtml?num=62398<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"369\" width=\"369\">\n<p align=\"left\"><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1kPGSk1cYiuqVTVtPJ4ygkyZVwmDAK6NuMpNz0YGr1M4\/edit?gid=0#gid=0\" rel=\"noopener noreferrer nofollow\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1kPGSk1cYiuqVTVtPJ4ygkyZVwmDAK6NuMpNz0YGr1M4\/edit?gid=0#gid=0\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.google.com\/spreadsheets\/d\/1kPGSk1cYiuqVTVtPJ4ygkyZVwmDAK6NuMpNz0YGr1M4\/edit?gid=0#gid=0<\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>\u0412\u043e\u043f\u0440\u043e\u0441\u044b:<\/strong>  <\/p>\n<ol>\n<li>\n<p>\u041a\u0430\u043a <strong>\u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c <\/strong>\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430, \u0435\u0441\u043b\u0438 <strong>\u043d\u0435\u0442 <\/strong>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u043a\u043e\u0434\u0443 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u044b\u043c <strong>\u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u043e\u043c<\/strong>? <span class=\"habrahidden\">\u041d\u0430\u0434\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u043a\u043e\u0434 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<\/span><\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c NVRAM \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438\u00a0<strong>\u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0439\u00a0<\/strong>\u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 Flash? \u041a\u043e\u0433\u0434\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u00a0<strong>\u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e-\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c<\/strong>\u00a0\u0443\u0436\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 flash \u043f\u0430\u043c\u044f\u0442\u0438. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <span class=\"habrahidden\">LittleFS<\/span><\/p>\n<\/li>\n<li>\n<p>\u0423\u0432\u0438\u0434\u0438\u0442 \u043b\u0438 <strong>\u041f\u041a <\/strong>\u0444\u0430\u0439\u043b\u044b, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c LittleFs \u043d\u0430 SD \u043a\u0430\u0440\u0442\u0435?<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c \u043b\u0438 \u0432 LittleFs <strong>Lazy Write<\/strong>? <span class=\"habrahidden\">\u041d\u0435\u0442<\/span><\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u043d\u0430 <strong>Windows <\/strong>\u0438\u0437 micro-SD \u043a\u0430\u0440\u0442\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <strong>\u0441\u044b\u0440\u043e\u0439 \u0434\u0430\u043c\u043f <\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f? \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u043a\u0430\u044f-\u043d\u0438\u0431\u0443\u0434\u044c \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0441\u043a\u0430\u0436\u0435\u043c \u0442\u0430 \u0436\u0435 LittleFS.  <\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c LittleFS \u0444\u0430\u0439\u043b \u0434\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f? <span class=\"habrahidden\">\u041d\u0435\u0442<\/span><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/925372\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 LittleFS?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">33.33% <\/span><span class=\"tm-article-poll__answer-label\">\u0434\u0430<\/span><span class=\"tm-article-poll__answer-votes\">3<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 33.33%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">66.67% <\/span><span class=\"tm-article-poll__answer-label\">\u043d\u0435\u0442<\/span><span class=\"tm-article-poll__answer-votes\">6<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 66.67%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 9 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 3 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/925372\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0412\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 NVRAM?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">42.86% <\/span><span class=\"tm-article-poll__answer-label\">\u0434\u0430<\/span><span class=\"tm-article-poll__answer-votes\">3<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 42.86%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">57.14% <\/span><span class=\"tm-article-poll__answer-label\">\u043d\u0435\u0442<\/span><span class=\"tm-article-poll__answer-votes\">4<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 57.14%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 7 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 2 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/925372\/\"> https:\/\/habr.com\/ru\/articles\/925372\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p>\u041b\u044e\u0431\u0430\u044f \u0432\u0435\u0449\u044c \u043b\u0443\u0447\u0448\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0451 \u0435\u0441\u0442\u044c NVRAM.  <\/p>\n<\/blockquote>\n<figure class=\"full-width\"><\/figure>\n<h3>\u041f\u0440\u043e\u043b\u043e\u0433<\/h3>\n<p>\u0412 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 MCU \u043f\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u0430\u043a \u0438 \u0432 \u043e\u0431\u044a\u0451\u043c\u0435 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c. <\/p>\n<p>\u0412\u043e\u0442 \u0432\u0430\u043c \u044f\u0440\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u041d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c NVRAM \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u0433\u0434\u0435 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b \u043f\u0430\u043c\u044f\u0442\u0438 (\u044d\u0442\u043e \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 FC7300x). \u0421\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e \u0447\u0435\u0441\u0442\u043d\u043e\u043c\u0443, \u043d\u0435 \u0432\u0441\u044f\u043a\u0438\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u041c\u041a \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 NVRAM. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c NVRAM \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0437\u0430\u043f\u0440\u0435\u0442\u0430 \u0434\u043e-\u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0443\u0436\u043d\u0430 \u043d\u0435 \u0445\u0438\u043b\u0430\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 (\u0434\u0432\u0443\u0445-\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438, \u0434\u0435\u0440\u0435\u0432\u044c\u044f, \u0434\u0435\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435).  <\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/p>\n<ul>\n<li>\n<p>\u041f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u0441\u0430\u043c\u043e\u043c\u0443. \u042d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u0417\u0430\u0442\u043e \u0432\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0433\u0438\u0431\u043a\u0443\u044e \u0442\u043e\u0432\u0430\u0440\u043d\u0443\u044e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438\u0437 Open-Source (third-party). \u042d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u041d\u043e \u0432\u044b \u0442\u0435\u0440\u044f\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c. <\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u043d\u0438 \u043a\u0440\u0443\u0442\u0438, \u043d\u043e \u043f\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 third-party \u043a\u043e\u0434\u043e\u043c. \u0418 \u0432\u043e\u0442 \u043d\u0430\u0441\u0442\u0430\u043b \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0430<\/h3>\n<p>\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c NVRAM \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0439 flash \u043f\u0430\u043c\u044f\u0442\u044c. \u041e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043f\u0443\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b LittleFs \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. \u041f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c LittleFs. <\/p>\n<p><u>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a NVRAM<\/u><br \/>1&#8212;\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 <strong>\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u043d\u044b<\/strong> (\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u0432\u043e\u0439\u043a\u0438).<br \/>2&#8212;<strong>\u041d\u0435 <\/strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c <strong>\u0434\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c<\/strong> \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b Flash \u043f\u0430\u043c\u044f\u0442\u0438.<br \/>3&#8212;NVRAM \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c <strong>Lazy Write<\/strong>. \u041d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0442\u0430\u043c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c.<br \/>4&#8212;\u0415\u0441\u043b\u0438 <strong>\u0441\u0442\u0438\u0440\u0430\u0442\u044c <\/strong>flash, \u0442\u043e <strong>\u0441\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 <\/strong>\u043f\u043e 8k Byte<br \/>5&#8212;\u0415\u0441\u043b\u0438 <strong>\u043f\u0438\u0441\u0430\u0442\u044c <\/strong>flash, \u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e <strong>\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 <\/strong>128 \u0431\u0430\u0439\u0442.<br \/>6&#8212;<strong>\u041f\u0438\u0441\u0430\u0442\u044c \u043f\u043e \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u043e\u043c\u0443 <\/strong>\u0430\u0434\u0440\u0435\u0441\u0443 (128 byte)<br \/>7&#8212;<strong>\u0421\u0442\u0438\u0440\u0430\u0442\u044c \u043f\u043e \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u043e\u043c\u0443 <\/strong>\u0430\u0434\u0440\u0435\u0441\u0443 (8k Byte)<br \/>8&#8212;\u0421\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 <strong>\u0421\u0438<\/strong><br \/>9&#8212;<strong>\u0420\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435<\/strong>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Nor-Flash \u043f\u0430\u043c\u044f\u0442\u0438 (endurance optimization). \u041d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u043e\u0434\u043d\u043e \u043c\u0435\u0441\u0442\u043e<br \/>10&#8212;\u0414\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u0448\u0438\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e\u0433\u043e <strong>\u043f\u0440\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043f\u0438\u0442\u0430\u043d\u0438\u044f <\/strong>(power off tolerance).  <br \/>11&#8212;<strong>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 <\/strong>\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u0447\u0435\u043c\u0443 \u0431\u044b\u043b\u043e \u043b\u043e\u043c\u0430\u0442\u044c\u0441\u044f.<br \/>12&#8212;\u0424\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d <strong>\u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <\/strong>\u043f\u043e \u0438\u043c\u0435\u043d\u0438 (&lt;100ms)<br \/>13&#8212;\u0424\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d <strong>\u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f<\/strong> (&lt;100ms)<br \/>14&#8212;\u0424\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d\u00a0<strong>\u0431\u044b\u0441\u0442\u0440\u043e<\/strong>\u00a0<strong>\u0441\u0442\u0438\u0440\u0430\u0442\u044c\u0441\u044f<\/strong>  (&lt;100ms)<br \/>15&#8212;<strong>\u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c NVRAM. \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f. \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0442\u0430\u043a, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<h3>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0441\u043e\u0440\u0446\u044b LittleFs \u043d\u0430\u0434\u043e \u0447\u0435\u0442\u043a\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0432\u043e\u0442 \u044d\u0442\u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f.<\/p>\n<p><strong>\u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441\u00a0<\/strong>&#8212; \u0430\u0434\u0440\u0435\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043d\u0443\u043b\u044f. \u041f\u0435\u0440\u0438\u043e\u0434\u044b \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e &#8212; \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0434\u0432\u043e\u0439\u043a\u0438: 128 \u0438\u043b\u0438 8192.  <\/p>\n<p><strong>\u0421\u0435\u043a\u0442\u043e\u0440 \u043f\u0430\u043c\u044f\u0442\u0438<\/strong>\u00a0&#8212; \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 8kByte  <\/p>\n<p><strong>third-party<\/strong> &#8212; \u043a\u043e\u0434 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0441\u043a\u0430\u0447\u0430\u043b\u0438 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<p><strong>\u0411\u043b\u043e\u043a <\/strong>&#8212; \u044d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u0438 \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0442\u043e\u0440 flash \u043f\u0430\u043c\u044f\u0442\u0438. LittleFs \u0441\u0442\u0438\u0440\u0430\u0435\u0442 \u0431\u043b\u043e\u043a\u0430\u043c\u0438. \u0412 \u043c\u043e\u0451\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0431\u043b\u043e\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u0435\u043d 8kByte<\/p>\n<p><strong>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 <\/strong>&#8212; \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438. \u0412 \u043c\u043e\u0435\u043c \u043d\u044b\u043d\u0435\u0448\u043d\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0440\u0430\u0432\u043d\u0430 128 \u0431\u0430\u0439\u0442. \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0430\u043c\u044f\u0442\u0438\u00a0&#8212; \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 128\u0431\u0430\u0439\u0442.  <\/p>\n<p><strong>NVRAM <\/strong>&#8212; \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c (NV) \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c (RAM). \u041f\u043e \u0441\u0443\u0442\u0438 Key Val-Map(\u043a\u0430). \u0412 \u043d\u0435\u0439 \u043c\u043e\u0433\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u044b\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0432\u043e\u0438\u043c ID \u0447\u0438\u0441\u043b\u043e\u043c.  <\/p>\n<p><strong>dword\u00a0<\/strong>(double word)\u00a0\u2014 \u044d\u0442\u043e 4\u0445 \u0431\u0430\u0439\u0442\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f (32\u00a0\u0431\u0438\u0442).<\/p>\n<p><strong>word\u00a0\u2014\u00a0<\/strong>\u044d\u0442\u043e \u0434\u0432\u0443\u0445\u0431\u0430\u0439\u0442\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f (16\u00a0\u0431\u0438\u0442)<\/p>\n<p><strong>byte\u00a0<\/strong>\u2014 \u044d\u0442\u043e 8\u043c\u0438 \u0431\u0438\u0442\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f<\/p>\n<p><strong>\u0434\u0430\u043d\u043d\u044b\u0435 <\/strong>&#8212; \u043c\u0430\u0441\u0441\u0438\u0432 hex \u0431\u0430\u0439\u0442\u043e\u0432 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u043d\u043e\u0439<\/p>\n<p><strong>File<\/strong>\u00a0&#8212; \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c RAM, ROM (Flash), FRAM, EEPROM, SD \u043a\u0430\u0440\u0442\u044b, \u043a\u043e\u043c\u043f\u0430\u043a\u0442 \u0434\u0438\u0441\u043a\u0438, \u0434\u0438\u0441\u043a\u0435\u0442\u044b, \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u0430\u044f \u043b\u0435\u043d\u0442\u0430, \u0441\u0442\u0435\u043a\u043b\u043e. \u0414\u0430 \u0432\u0441\u0451 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e. \u0427\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439? \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043a \u044d\u0442\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e. \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u0422\u0430\u043a \u043f\u0440\u043e\u0449\u0435. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432, \u0442\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0440\u044f\u0434\u043e\u043c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0434\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u00a0<strong>\u0434\u043b\u0438\u043d\u0443<\/strong>\u00a0\u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. <\/p>\n<p><strong>Lazy write<\/strong> &#8212; \u044d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0436\u0435 \u0442\u0430\u043c \u043b\u0435\u0436\u0430\u0442, \u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 write \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 OK. \u042d\u0442\u043e \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0432 \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u0430 \u043e\u043d \u0443\u0436\u0435 \u0442\u0430\u043c \u0435\u0441\u0442\u044c, \u0442\u043e  \u0432\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u043d\u043e\u0432\u0430. <\/p>\n<p><strong>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u0430<\/strong><br \/>FatFs \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0430 \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u043a \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043f\u0438\u0442\u0430\u043d\u0438\u044f. B  FatFs \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0438\u0437\u043d\u043e\u0441\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 Flash \u043f\u0430\u043c\u044f\u0442\u0438. \u041e\u0431\u044b\u0447\u043d\u043e FatFs \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043d\u0430 SD \u043a\u0430\u0440\u0442\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0437\u043d\u043e\u0441\u0430 Flash \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0414\u0435\u0441\u044f\u0442\u044c \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u0431\u044b\u043b \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u0435\u043c \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u0432\u044b\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e NVRAM. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a. \u0421\u0445\u0435\u043c\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0432 \u043f\u043b\u0430\u0442\u0443 \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442 3 \u0438\u043b\u0438 6 GPIO \u043f\u0438\u043d\u043e\u0432 \u0438 \u0434\u0436\u0430\u043c\u043f\u0435\u0440\u0430\u043c\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 GPIO, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f 1\u04453\u04456=18 \u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0438\u043b\u043b\u0438\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0430 1 \u0431\u0438\u0442. \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0442\u0430\u043a, \u0434\u0430? NVRAM \u043d\u0430 \u0434\u0436\u0430\u043c\u043f\u0435\u0440\u0430\u0445 &#8212; \u044d\u0442\u043e \u044f\u0440\u0447\u0430\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043b\u044e\u0442\u043e\u0433\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0442\u0447\u0430\u044f\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u043c \u0436\u0435 \u0442\u0435\u043a\u0441\u0442\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b, \u043a\u0430\u043a \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e NVRAM c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0441\u0438\u043b\u0438\u044f\u043c\u0438.  <\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0431\u044b\u043b\u0438 \u0442\u0435\u043a\u0441\u0442\u044b \u043f\u0440\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 NVRAM. \u0412\u043e\u0442 \u043e\u043d\u0438<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"317\" width=\"317\">\n<p align=\"left\"><strong>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"280\" width=\"280\">\n<p align=\"left\"><strong>URL<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0422\u0438\u043f<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"317\" width=\"317\">\n<p align=\"left\">NVRAM \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<td data-colwidth=\"280\" width=\"280\">\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/706972\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/706972\/<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">on-chip<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"317\" width=\"317\">\n<p align=\"left\">NVRAM \u041f\u043e\u0432\u0435\u0440\u0445 off-chip SPI-NOR Flash  <\/p>\n<\/td>\n<td data-colwidth=\"280\" width=\"280\">\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/732442\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/732442\/<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">off-chip<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"317\" width=\"317\">\n<p align=\"left\">NVRAM \u0438\u0437 EEPROM<\/p>\n<\/td>\n<td data-colwidth=\"280\" width=\"280\">\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/815639\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/815639\/<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">on-chip<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 NVRAM \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438  <strong>\u0434\u043e-\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c<\/strong> \u0430\u0434\u0440\u0435\u0441\u0430 Flash \u043f\u0430\u043c\u044f\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0434\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043b\u044e\u043a\u0441\u0430 \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u0432 \u043f\u043e\u043c\u0438\u043d\u0435! \u0414\u0430&#8230; \u0412\u043e \u043d\u0430\u043a\u0430\u043d\u0443\u043d\u0435 \u043c\u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0441\u044f MCU \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0439 Flash \u043f\u0430\u043c\u044f\u0442\u044c\u044e. \u0415\u0441\u043b\u0438 \u0431\u044b \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f Flash \u044f \u0431\u044b \u0432\u044b\u0431\u0440\u0430\u043b \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u043e\u0442\u043b\u0430\u0436\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438 \u0434\u0435\u043b\u043e \u0441 \u043a\u043e\u043d\u0446\u043e\u043c. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u043e\u0434\u0432\u0438\u0433\u043b\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0448\u0438\u0440\u043e\u0447\u0430\u0439\u0448\u0435\u0433\u043e \u0438 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 open-source \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u0430\u043a <strong>LittleFs<\/strong>. \u0420\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u0441\u0432\u043e\u0438\u0442\u044c. <\/p>\n<h3>\u041b\u0438\u043a\u0431\u0435\u0437 \u043f\u043e LittleFs<\/h3>\n<p>Little Fs &#8212; \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c \u0421\u0438 (\u042199). \u041e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0442\u0440\u0435\u043c\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u0438 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c\u0438:<\/p>\n<p><strong>\u0423\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u043a \u0441\u0431\u043e\u044f\u043c \u043f\u0438\u0442\u0430\u043d\u0438\u044f<\/strong> \u2014 littlefs \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0441\u0431\u043e\u0435\u0432 \u043f\u0438\u0442\u0430\u043d\u0438\u044f. \u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043c\u0435\u044e\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u0443\u044e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u044e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e.  <strong>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043d\u043e\u0441\u0430 <\/strong>\u2014 littlefs \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0444\u043b\u044d\u0448-\u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043d\u043e\u0441\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, littlefs \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u0431\u043e\u0439\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0438 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c \u0438\u0445.  <strong>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u041e\u0417\u0423\/\u041f\u0417\u0423 <\/strong>\u2014 littlefs \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0451\u043c\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u041e\u0417\u0423 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u041e\u0417\u0423 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u043e\u0441\u0442\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0424\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438, \u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u0431\u0443\u0444\u0435\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043f\u043e\u0433\u043e\u043d\u044f\u0442\u044c LittleFs \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e Win \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0432\u043e\u0435\u043c LapTop-\u0435. \u041f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e\u0431\u044b Little FS \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u041f\u043e\u0441\u043b\u0435 block_cycles \u0440\u0430\u0437 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430, \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0430\u0434\u0430\u0435\u0442 \u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0431\u044b \u0442\u043e  \u043d\u0438 \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u044f \u0437\u0430\u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 <strong>offset<\/strong>. \u0417\u0430\u0442\u0435\u043c \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e LittleFs \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0438\u0448\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u0442 \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u043a\u0442\u043e\u0440\u0430. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e <strong>\u0434\u043e\u043c\u043d\u043e\u0436\u0438\u0442\u044c <\/strong>\u0431\u043b\u043e\u043a \u043d\u0435 \u043d\u0430 128 \u0431\u0430\u0439\u0442\u0430, \u0430 \u043d\u0430 8192 \u0431\u0430\u0439\u0442\u0430. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u0440\u0438\u0441\u0442\u0430\u043b\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0434\u043b\u044f \u041c\u041a FC7300. \u0412\u043e\u0442 \u043e\u043d.<\/p>\n<pre><code class=\"cpp\">#include \"little_fs_config.h\"  #include \"data_utils.h\" #include \"sw_nor_flash.h\" #include \"log.h\"  #define LITTLE_FS_NOR_FLASH_NUM 1 #define LITTLE_FS_BLOCK_SIZE  8192 #define LITTLE_FS_PAGE_SIZE  128 #define LITTLE_FS_CACHE_SIZE (LITTLE_FS_PAGE_SIZE)   #ifdef LFS_NO_MALLOC \/\/ Optional statically allocated read buffer. \/\/ Must be cache_size. \/\/ By default lfs_malloc is used to allocate this buffer. static uint8_t readBuffer[LITTLE_FS_CACHE_SIZE] = {0}; static uint8_t progBuffer[LITTLE_FS_CACHE_SIZE] = {0}; static uint8_t lookaheadBuffer[LITTLE_FS_PAGE_SIZE] = {0}; #endif  static int FlashToLittleFsRet(bool res) {     int ret = LFS_ERR_OK;     if (false == res) {         ret = LFS_ERR_CORRUPT;     }     return ret; }  static int user_provided_block_device_prog(const struct lfs_config* c,                                            lfs_block_t block,                                            lfs_off_t off,                                            const void* buffer,                                            lfs_size_t size) {     int ret = LFS_ERR_CORRUPT;     bool res = false;     LOG_NOTICE(LITTLE_FS, \"Write,Block:%u,OffSet:%u,Size:%u\",                 block, off, size);     uint32_t phy_address = 0;     phy_address = block * LITTLE_FS_BLOCK_SIZE + off;     res = sw_nor_flash_write(LITTLE_FS_NOR_FLASH_NUM,                              phy_address,                              (uint8_t*) buffer,                              size);     ret = FlashToLittleFsRet(res);     return ret; }  static int user_provided_block_device_read(const struct lfs_config* c,                                            lfs_block_t block,                                            lfs_off_t off,                                            void* buffer,                                            lfs_size_t size) {     int ret = 0;     LOG_DEBUG(LITTLE_FS, \"Read,Block:%u,OffSet:%u,Size:%u\",                block, off, size);     uint32_t phy_address = 0;     phy_address = block * LITTLE_FS_BLOCK_SIZE + off;     bool res = sw_nor_flash_read(LITTLE_FS_NOR_FLASH_NUM,                                  phy_address,                                  (uint8_t*) buffer,                                  (uint32_t) size);     ret = FlashToLittleFsRet(res);     return ret; }  static int user_provided_block_device_erase(const struct lfs_config* c,                                             lfs_block_t block) {     int ret = LFS_ERR_CORRUPT;     LOG_WARNING(LITTLE_FS, \"EraseBlock:%u\", block);     uint32_t phy_address = block * LITTLE_FS_BLOCK_SIZE;     bool res = sw_nor_flash_erase_mem(LITTLE_FS_NOR_FLASH_NUM,                              <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-467674","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/467674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=467674"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/467674\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=467674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=467674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=467674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}