{"id":377773,"date":"2024-06-01T15:08:16","date_gmt":"2024-06-01T15:08:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=377773"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=377773","title":{"rendered":"<span>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 X\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u041a\u043e\u0434\u0430 \u041f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 (\u041c\u0430\u0441\u0441\u0438\u0432-\u041d\u0430\u0448\u0435 \u0412\u0441\u0451)<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e01\/a28\/740\/e01a28740b2cbaf38b2481a6aecccd93.png\" width=\"789\" height=\"469\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e01\/a28\/740\/e01a28740b2cbaf38b2481a6aecccd93.png\"\/><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u044e\u043a\u0430\u0445 \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u041c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0437\u0430 12 \u043b\u0435\u0442 \u044f \u0432\u0438\u0434\u0435\u043b \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0438 \u0442\u043e \u043b\u0438\u0448\u044c \u043e\u0442 \u0447\u0430\u0441\u0442\u0438. \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438&#8230;<\/p>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440<\/p>\n<p><\/strong>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043e\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043d\u0430 100% \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435.  \u0422\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438, \u043a\u0430\u043a \u043d\u0438 \u043a\u0440\u0443\u0442\u0438, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0434\u043e \u044d\u0442\u0430\u043f\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0414\u0430, \u044d\u0442\u043e \u0442\u0430\u043a&#8230; <\/p>\n<p>\u0412\u043e\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 &#8212; \u044d\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u043e \u044d\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442. <a href=\"https:\/\/habr.com\/ru\/articles\/798213\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/798213\/<\/a>. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b.  \u041f\u043b\u044e\u0441 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u043f\u0440\u044f\u043c\u043e \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 (Make, CMake \u0438 \u0442.\u043f.).<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0432\u0441\u0451 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445: \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430, \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430, \u0441\u0442\u0440\u043e\u043a\u0438. \u041a \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u0430\u0431\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e  \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043d\u043d\u044b \u043c\u0430\u043a\u0440\u043e\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0432 \u0441\u0432\u0430\u043b\u043a\u0443. \u042d\u0442\u043e \u043d\u0435 \u043d\u0430\u0448 \u043f\u0443\u0442\u044c. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0439\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0451\u043c \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0441\u0442\u0430\u043b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u0412\u043e\u0442 \u043a\u0430\u043a \u0442\u0443\u0442 \u043a\u043e\u043d\u0444\u0438\u0433 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">#include \"led_mono_config.h\"  #ifndef HAS_LED #error \"Add HAS_LED\" #endif \/*HAS_LED*\/  #include \"data_utils.h\"  const LedMonoConfig_t LedMonoConfig[] = {     {         .num = 1, .period_ms = 500,         .phase_ms = 500,        .duty = 10,         .pad = {.port = PORT_D, .pin = 15},         .name = \"Green\",        .mode = LED_MODE_BAM,         .active = GPIO_LVL_LOW,        .valid = true,     },     {         .num = 2,        .period_ms = 1000,        .phase_ms = 0,         .duty = 10,        .pad = {.port = PORT_D, .pin = 13},         .name = \"Red\",        .mode = LED_MODE_OFF,         .active = GPIO_LVL_LOW,        .valid = true,     },     {         .num = 3,        .period_ms = 1000,         .phase_ms = 0,        .duty = 10,         .pad = {.port = PORT_D, .pin = 14},         .name = \"Yellow\",        .mode = LED_MODE_PWM,         .active = GPIO_LVL_LOW,        .valid = true,     }, };  LedMonoHandle_t LedMonoInstance[] = {     { .num = 1, .valid = true,   },     { .num = 2, .valid = true,   },     { .num = 3, .valid = true,   }, };  uint32_t led_mono_get_cnt(void) {     uint32_t cnt = 0;     uint32_t cnt1 = 0;     uint32_t cnt2 = 0;     cnt1 = ARRAY_SIZE(LedMonoInstance);     cnt2 = ARRAY_SIZE(LedMonoConfig);     if(cnt1 == cnt2) {         cnt = cnt1;     }     return cnt; } <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0434\u043d\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438. \u041e\u0434\u0438\u043d \u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e.<\/p>\n<p>\u042d\u0442\u043e \u0435\u0449\u0451 \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u0443\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e *.map  \u0444\u0430\u0439\u043b \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435  \u0432 *.bin \u0444\u0430\u0439\u043b\u0435, \u0433\u0434\u0435 \u043b\u0435\u0436\u0438\u0442 \u044d\u0442\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430. \u0418 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u043e\u0439. <\/p>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438<\/strong><\/p>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f? \u042d\u0442\u043e \u0432\u0435\u0434\u044c \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0421\u0438-\u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0422\u043e \u0435\u0441\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0421\u0438-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0422\u043e\u043b\u044c\u043a\u043e \u0438 \u0432\u0441\u0435\u0433\u043e&#8230; \u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0442\u043e\u0433\u0434\u0430 \u043d\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439? \u0414\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e&#8230; \u0412\u043e\u0442.<\/p>\n<pre><code class=\"cpp\">#ifdef HAS_MICROCONTROLLER #include \"board_config.h\" #define BOARD_INIT                                                                                                     \\     { .init_function = board_init, .name = \"board\", }, #else \/*HAS_MICROCONTROLLER*\/ #define BOARD_INIT #endif \/*HAS_MICROCONTROLLER*\/  \/*Order matters!*\/ define INIT_FUNCTIONS \\     MCAL_INIT         \\     HW_INIT           \\     INTERFACES_INIT   \\     PROTOCOLS_INIT    \\     CONTROL_INIT      \\     STORAGE_SW_INIT   \\     SW_INIT           \\     UNIT_TEST_INIT    \\     ASICS_INIT        \\     BOARD_INIT  \/*Order matter!*\/ const SystemInitInstance_t SystemInitInstance[] = {INIT_FUNCTIONS};<\/code><\/pre>\n<p> \u0412\u044b\u0438\u0433\u0440\u044b\u0448 \u0442\u0443\u0442 \u0442\u0440\u043e\u0439\u043d\u043e\u0439: <\/p>\n<p>1&#8212;\u0412\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. <\/p>\n<p>2&#8212;\u041f\u0440\u044f\u0434\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. <\/p>\n<p>3&#8212;\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0431\u0449\u0438\u0439 \u043f\u0440\u043e\u043b\u043e\u0433 \u0438 \u044d\u043f\u0438\u043b\u043e\u0433-\u043a\u043e\u0434. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0435\u0447\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430 \u0438\u043b\u0438 \u0441\u0431\u0440\u043e\u0441 \u0441\u0442\u043e\u0440\u043e\u0436\u0435\u0432\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430. <\/p>\n<p>\u041f\u043e\u0442\u043e\u043c, \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u043e \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0432 UART \u0438\u043b\u0438 \u0432 SD \u043a\u0430\u0440\u0442\u0443. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f9c\/2d9\/8ea\/f9c2d98eaa3b0f3e3ddde91d7e6decf7.png\" width=\"864\" height=\"281\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f9c\/2d9\/8ea\/f9c2d98eaa3b0f3e3ddde91d7e6decf7.png\"\/><\/figure>\n<p>\u041b\u043e\u0433 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 \u0438\u043b\u0438 \u0431\u0440\u0430\u043a \u0432 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u0443\u0440\u0435 PCB (\u0436\u0435\u043b\u0435\u0437\u0435) \u0435\u0449\u0435 \u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0443\u043f\u0435\u0440\u0446\u0438\u043a\u043b\u0430.<\/p>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0441\u0443\u043f\u0435\u0440\u0446\u0438\u043a\u043b\u0430<\/strong><\/p>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0435\u0441\u0442\u044c \u0441\u0443\u043f\u0435\u0440\u0446\u0438\u043a\u043b. \u041b\u0438\u0431\u043e \u043e\u043d \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d \u044f\u0432\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 main(), \u043b\u0438\u0431\u043e \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 bare-bone \u043f\u043e\u0442\u043e\u043a\u0430 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c RTOS. \u0422\u0443\u0442 \u0442\u043e\u0436\u0435, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0443\u043f\u0435\u0440\u0446\u0438\u043a\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <strong>limiter<\/strong> \u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c, \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0451 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c. \u041d\u0435 \u0447\u0430\u0449\u0435 \u0447\u0435\u043c, \u0441\u043a\u0430\u0436\u0435\u043c, 500ms.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"left\"><strong>\u2116<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"415\" width=\"415\">\n<p align=\"left\"><strong>\u043f\u043e\u043b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0442\u0438\u043f<\/strong> <strong>\u0434\u0430\u043d\u043d\u044b\u0445<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"415\" width=\"415\">\n<p align=\"left\">\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0421\u0438-\u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0430\u0434\u0440\u0435\u0441 \u0432 Flash<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"415\" width=\"415\">\n<p align=\"left\">\u0438\u043c\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"415\" width=\"415\">\n<p align=\"left\">\u043f\u0435\u0440\u0438\u043e\u0434 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0421\u0438-\u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u0440\u043e \u044d\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442. \u041d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>\u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0417\u0430\u0434\u0430\u0447 \u0434\u043b\u044f \u041c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430<\/strong> <a href=\"https:\/\/habr.com\/ru\/articles\/757000\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/757000\/<\/a><\/p>\n<pre><code class=\"cpp\"> #ifdef HAS_BOARD_PROC #include \"board_at_start_f437.h\" #define BOARD_TASK {.name=\"board\",   \\      .period_us=BOARD_POLL_PERIOD_US,      \\     .limiter.function=board_proc,}, #else #define BOARD_TASK #endif \/**\/  #define TASK_LIST_ALL     \\     ASICS_TASK            \\     APPLICATIONS_TASKS    \\     BOARD_TASK            \\     MCAL_TASKS            \\     TASK_CORE             \\     COMPUTING_TASKS       \\     CONNECTIVITY_TASKS    \\     CONTROL_TASKS         \\     SENSITIVITY_TASKS     \\     STORAGE_TASKS  TaskConfig_t TaskInstance[] = {     TASK_LIST_ALL };<\/code><\/pre>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 NVRAM<\/strong><\/p>\n<p>\u041b\u044e\u0431\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c. \u041f\u0440\u043e \u044d\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442: NVRAM \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 <a href=\"https:\/\/habr.com\/ru\/articles\/706972\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/706972\/<\/a> \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e NVRAM \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0430\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u0430\u043a <\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\"><strong>\u2116<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\"><strong>\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e NVRAM \u0437\u0430\u043f\u0438\u0441\u0438<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u0440\u0430\u0437\u043c\u0435\u0440<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0431\u0430\u0439\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u0438\u043c\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 (\u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u0430\u0434\u0440\u0435\u0441 \u0432 NVRAM<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e (0&lt;=)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043a SW \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 (\u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043d\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430.<\/p>\n<pre><code class=\"cpp\"> const ParamItem_t ParamArray[] = {     FLASH_FS_PARAMS     PARAMS_GNSS     IWDG_PARAMS     PARAMS_PASTILDA     PARAMS_SDIO     PARAMS_TIME     PARAMS_BOOTLOADER     {.facility=BOOT, .id=PAR_ID_BOOT_CMD, .len=1, .type=TYPE_UINT8, .name=\"BootCmd\"}, \/*num*\/     {.facility=BOOT, .id=PAR_ID_REBOOT_CNT, .len=2, .type=TYPE_UINT16, .name=\"ReBootCnt\"}, \/*num*\/     {.facility=SYS, .id=PAR_ID_SERIAL_NUM, .len=4, .type=TYPE_UINT32, .name=\"SerialNum\"},  \/**\/ }; <\/code><\/pre>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438<\/strong><\/p>\n<p>\u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430\u0445 \u0435\u0441\u0442\u044c UART \u0434\u043b\u044f printf() \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u0438\u043c, \u043a\u0430\u0436\u0434\u0430\u044f \u0432\u0437\u0440\u043e\u0441\u043b\u0430\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438 \u043f\u0435\u0447\u0430\u0442\u0438 \u043b\u043e\u0433\u0430 (\u0432 UART \u0438\u043b\u0438 SD \u043a\u0430\u0440\u0442\u0443) \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0442\u0430\u0432\u0438\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0447\u0438\u0441\u043b\u0443 \u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d.<\/p>\n<pre><code class=\"cpp\">const static FacilityInfo_t FacilityInfo[] = {  #ifdef HAS_AES     { .facility = AES, .name = \"AES\", }, #endif \/*HAS_AES*\/  #ifdef HAS_AD9833     { .facility = AD9833, .name = \"AD9833\", }, #endif \/*HAS_AD9833*\/  #ifdef HAS_NOR_FLASH     { .facility = NOR_FLASH, .name = \"NorFlash\", }, #endif \/*HAS_NOR_FLASH*\/   #ifdef HAS_NVRAM     { .facility = NVRAM, .name = \"NvRam\", }, #endif \/*HAS_NVRAM*\/    .... };<\/code><\/pre>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u0438\u043c \u0442\u043e\u043a\u0435\u043d\u0430\u043c \u0432 \u044d\u0442\u043e\u043c \u043b\u043e\u0433\u0435 \u044f\u0432\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0432 \u043b\u043e\u0433\u0435. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/905\/908\/8e5\/9059088e57c623570b60905f98461be3.png\" width=\"990\" height=\"685\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/905\/908\/8e5\/9059088e57c623570b60905f98461be3.png\"\/><\/figure>\n<p>\u0423\u0434\u043e\u0431\u043d\u043e? \u041e\u0447\u0435\u043d\u044c!<\/p>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f CLI<\/strong><\/p>\n<p>\u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0437\u0440\u043e\u0441\u043b\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0435\u0441\u0442\u044c UART-CLI. \u0414\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 UART-CLI. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 CLI \u0442\u043e\u0436\u0435 \u0441\u043a\u043b\u0430\u0434\u0438\u0440\u0443\u0435\u043c \u0448\u0442\u0430\u0431\u0435\u043b\u044f\u043c\u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0442\u0435\u043a\u0441\u0442\u0435: \u041f\u043e\u0447\u0435\u043c\u0443 \u041d\u0430\u043c \u041d\u0443\u0436\u0435\u043d UART-Shell? <a href=\"https:\/\/habr.com\/ru\/articles\/694408\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/694408\/<\/a><\/p>\n<pre><code class=\"cpp\">#define CLI_CMD(LONG_CMD, SHORT_CMD, FUNC)                                 \\     { .short_name = SHORT_CMD, .long_name = LONG_CMD, .handler = FUNC }      bool nau8814_i2c_ping_command(int32_t argc, char* argv[]); bool nau8814_reg_map_command(int32_t argc, char* argv[]);  #define NAU8814_COMMANDS          \\                        \\                  NAU8814_DAC_COMMANDS                 \\                                NAU8814_ADC_COMMANDS                    \\                             CLI_CMD(\"nau8814_ping\", \"nap\", nau8814_i2c_ping_command ),  \\           CLI_CMD(\"nau8814_map\", \"nrm\", nau8814_reg_map_command ),          #define CLI_COMMANDS      \\                                                   ASICS_COMMANDS          \\                                            APPLICATIONS_COMMANDS   \\                                         CONTROL_COMMANDS        \\                                      CONNECTIVITY_COMMANDS   \\                                   COMPUTING_COMMANDS      \\                                MCAL_COMMANDS           \\                             MULTIMEDIA_COMMANDS     \\                          PROTOTYPE_COMMANDS      \\                       STORAGE_COMMANDS        \\                                                   SENSITIVITY_COMMANDS    const CliCmdInfo_t CliCommands[] = {CLI_COMMANDS}; <\/code><\/pre>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437 CLI \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0443 \u043d\u0435\u0451 \u043d\u0430 \u0431\u043e\u0440\u0442\u0443. \u0421\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0442\u0435\u0441\u0442\u043e\u043c \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<pre><code class=\"cpp\"> bool test_c_types(void) {     LOG_INFO(TEST, \"%s()..\", __FUNCTION__);     bool res = true;       EXPECT_EQ(4, sizeof(long));     EXPECT_EQ(4, sizeof(1UL));     EXPECT_EQ(4, sizeof(1L));     EXPECT_EQ(4, sizeof(size_t));     EXPECT_EQ(4, sizeof(1l));       EXPECT_EQ(4, sizeof(1));     EXPECT_EQ(4, sizeof(-1));     EXPECT_EQ(4, sizeof(0b1));     EXPECT_EQ(4, sizeof(1U));     EXPECT_EQ(4, sizeof(1u));     EXPECT_EQ(4, sizeof(1.f));       LOG_INFO(TEST, \"%s() Ok\", __FUNCTION__);     return res; }  #define TEST_SUIT_SW                                                  \\     {\"array_init\", test_array_init},                                  \\     {\"bit_fields\", test_bit_fields},                                  \\     {\"c_types\", test_c_types},                                        \\     {\"memset\", test_memset},                                          \\     {\"memcpy\", test_memcpy},                                          \\     {\"bit_shift\", test_bit_shift},                                    \\     {\"int_overflow\", test_int_overflow},                              \\     {\"sprintf_minus\", test_sprintf_minus},                            \\     {\"endian\", test_endian},                                            \/*Compile time assemble array *\/ const UnitTestHandle_t TestArray[] = { #ifdef HAS_SW_TESTS     TEST_SUIT_SW #endif \/*HAS_SW_TESTS*\/  #ifdef HAS_HW_TESTS     TEST_SUIT_HW #endif \/*HAS_HW_TESTS*\/  }; <\/code><\/pre>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u043b\u044f RTOS<\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c RTOS, \u0442\u043e \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0435\u043a\u0430 \u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a \u043f\u043e\u0442\u043e\u043a\u0443 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435. \u0418 \u0442\u0430\u043a \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u0434\u0432\u0430, \u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430. <\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0442\u0443\u0442.<\/p>\n<pre><code class=\"cpp\">#include \"FreeRTOSConfig.h\"  #include \"free_rtos_drv.h\" #include \"data_utils.h\" #ifdef HAS_KEEPASS #include \"keepass.h\" #endif \/*HAS_KEEPASS*\/  const RtosTaskConfig_t RtosTaskConfig[] = {     { .num=1, .TaskCode=bare_bone, .name=\"BareBone\",        .stack_depth_byte=2048, .priority=PRIORITY_LOW, .valid=true,},        { .num=2, .TaskCode=default_task, .name=\"DefTask\",        .stack_depth_byte=256, .priority=PRIORITY_LOW, .valid=true,},    #ifdef HAS_KEEPASS     { .num=3, .TaskCode=keepass_proc_task, .name=\"KeePass\",        .stack_depth_byte=1024, .priority=PRIORITY_LOW, .valid=true,}, #endif \/*HAS_KEEPASS*\/ };  RtosTaskHandle_t RtosTaskInstance[] = {     { .num=1, .valid=true,  },     { .num=2, .valid=true,  }, #ifdef HAS_KEEPASS     { .num=3, .valid=true,  }, #endif };  uint32_t rtos_task_get_cnt(void){     uint32_t  cnt  = 0 ;     uint32_t  cnt1  = 0 ;     uint32_t  cnt2  = 0 ;     cnt1 = ARRAY_SIZE(RtosTaskConfig);     cnt2 = ARRAY_SIZE(RtosTaskInstance);     if(cnt1==cnt2) {         cnt = cnt1;     }     return cnt; } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u043e \u0432\u0441\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435.<\/p>\n<p><strong>\u0418\u0442\u043e\u0433\u0438<\/strong><\/p>\n<p>\u041f\u043e\u0434\u0432\u043e\u0434\u044f \u0447\u0435\u0440\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u044d\u0442\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443. <\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\"><strong>\u2116<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"374\" width=\"374\">\n<p align=\"left\"><strong>\u043c\u0430\u0441\u0441\u0438\u0432<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 SW \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"374\" width=\"374\">\n<p align=\"left\">\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"374\" width=\"374\">\n<p align=\"left\">\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u0443\u043f\u0435\u0440\u0446\u0438\u043a\u043b\u0430\\\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"374\" width=\"374\">\n<p align=\"left\">\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b NVRAM<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"374\" width=\"374\">\n<p align=\"left\">\u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0438 \u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"374\" width=\"374\">\n<p align=\"left\">\u043a\u043e\u043c\u0430\u043d\u0434\u044b CLI<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">6<\/p>\n<\/td>\n<td data-colwidth=\"374\" width=\"374\">\n<p align=\"left\">\u043f\u043e\u0442\u043e\u043a\u043e\u0432 RTOS<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"56\" width=\"56\">\n<p align=\"left\">7<\/p>\n<\/td>\n<td data-colwidth=\"374\" width=\"374\">\n<p align=\"left\">\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.. \u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0432\u0441\u0435\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <strong>\u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430<\/strong>! \u0414\u0430&#8230; \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0441\u0431\u043e\u0440\u043a\u0438. \u0421\u043a\u0440\u0438\u043f\u0442\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u041f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u0434. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u0434.  Easy!<\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432 RunTime  \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432, \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b \u0438 \u043f\u0440\u043e\u0447\u0435\u0435. <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0438 \u0432\u043e\u0432\u0441\u0435 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043b\u044e\u0431\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043a\u0430\u043a \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 &#8212; \u044d\u0442\u043e \u043d\u0435 \u0447\u0442\u043e \u0438\u043d\u043e\u0435 \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 assembler \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0432 ROM \u043f\u0430\u043c\u044f\u0442\u0438. \u0410 \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 &#8212; \u044d\u0442\u043e \u044d\u0434\u0430\u043a\u0430\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0446\u0435\u043f\u043e\u0447\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u0434\u043d\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u0437 ROM, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u0442 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u0412\u043e\u0442 \u0442\u0430\u043a, \u0433\u043e\u0441\u043f\u043e\u0434\u0430&#8230;<\/p>\n<p>\u0412 \u0441\u0443\u0445\u043e\u043c \u043e\u0441\u0442\u0430\u0442\u043a\u0435, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0443 \u0412\u0430\u0441 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430, \u043a\u0430\u043a \u043a\u0440\u0438\u0441\u0442\u0430\u043b\u043b \u0440\u0430\u0441\u0442\u0451\u0442 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u0423 \u0432\u0430\u0441 \u043e\u0434\u043d\u0430 \u0442\u043e\u0447\u043a\u0430 \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u0434\u043b\u044f \u0442\u0435\u0445\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p><strong>\u0421\u043b\u043e\u0432\u0430\u0440\u044c<\/strong><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"146\" width=\"146\">\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=\"146\" width=\"146\">\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=\"146\" width=\"146\">\n<p align=\"left\">CLI<\/p>\n<\/td>\n<td>\n<p align=\"left\">Command line interface<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"146\" width=\"146\">\n<p align=\"left\">UART<\/p>\n<\/td>\n<td>\n<p align=\"left\">Universal Asynchronous Receiver-Transmitter<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"146\" width=\"146\">\n<p align=\"left\">RTOS<\/p>\n<\/td>\n<td>\n<p align=\"left\">real-time operating system<\/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=\"50\" width=\"50\">\n<p align=\"left\"><strong>#<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\"><strong>\u043d\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=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\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>\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<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">NVRAM \u041f\u043e\u0432\u0435\u0440\u0445 off-chip SPI-NOR Flash<\/p>\n<\/td>\n<td>\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<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">\u041f\u043e\u0447\u0435\u043c\u0443 \u041d\u0430\u043c \u041d\u0443\u0436\u0435\u043d UART-Shell?<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/694408\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/694408\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f Make \u0421\u0431\u043e\u0440\u043e\u043a<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/798213\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/798213\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">11 A\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0425\u043e\u0440\u043e\u0448\u0435\u0433\u043e Firmware<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/655641\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/655641\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">6<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">51 \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u0425\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0421-\u043a\u043e\u0434\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/679256\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/679256\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">7<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">16 \u0421\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u041e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 FirmWare<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/681280\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/681280\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">8<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0425\u043e\u0440\u043e\u0448\u043e \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/683762\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/683762\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">9<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">\u0427\u0442\u043e \u0414\u043e\u043b\u0436\u043d\u043e \u0411\u044b\u0442\u044c \u0432 \u041a\u0430\u0436\u0434\u043e\u043c FirmWare P\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/689542\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/689542\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">10<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043e\u0434 \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/723054\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/723054\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">11<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">\u041c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0435 \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Embedded<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/698092\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/698092\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">12<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">\u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0417\u0430\u0434\u0430\u0447 \u0434\u043b\u044f \u041c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/757000\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/757000\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">13<\/p>\n<\/td>\n<td data-colwidth=\"353\" width=\"353\">\n<p align=\"left\">23 \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0425\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/habr.com\/ru\/articles\/754216\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/754216\/<\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\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\/816589\/&#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\u0435\u043b\u0430\u0435\u0442\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438?<\/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\">16.67% <\/span><span class=\"tm-article-poll__answer-label\">\u0434\u0430<\/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\" style=\"width: 16.67%\"><\/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\">83.33% <\/span><span class=\"tm-article-poll__answer-label\">\u043d\u0435\u0442<\/span><span class=\"tm-article-poll__answer-votes\">20<\/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: 83.33%\"><\/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 24 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.    \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<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\/816589\/\"> https:\/\/habr.com\/ru\/articles\/816589\/<\/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<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u044e\u043a\u0430\u0445 \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u041c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0437\u0430 12 \u043b\u0435\u0442 \u044f \u0432\u0438\u0434\u0435\u043b \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0438 \u0442\u043e \u043b\u0438\u0448\u044c \u043e\u0442 \u0447\u0430\u0441\u0442\u0438. \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438&#8230;<\/p>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440<\/p>\n<p><\/strong>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043e\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043d\u0430 100% \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435.  \u0422\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438, \u043a\u0430\u043a \u043d\u0438 \u043a\u0440\u0443\u0442\u0438, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0434\u043e \u044d\u0442\u0430\u043f\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0414\u0430, \u044d\u0442\u043e \u0442\u0430\u043a&#8230; <\/p>\n<p>\u0412\u043e\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 &#8212; \u044d\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u043e \u044d\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442. <a href=\"https:\/\/habr.com\/ru\/articles\/798213\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/798213\/<\/a>. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b.  \u041f\u043b\u044e\u0441 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u043f\u0440\u044f\u043c\u043e \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 (Make, CMake \u0438 \u0442.\u043f.).<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0432\u0441\u0451 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445: \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430, \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430, \u0441\u0442\u0440\u043e\u043a\u0438. \u041a \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u0430\u0431\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e  \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043d\u043d\u044b \u043c\u0430\u043a\u0440\u043e\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0432 \u0441\u0432\u0430\u043b\u043a\u0443. \u042d\u0442\u043e \u043d\u0435 \u043d\u0430\u0448 \u043f\u0443\u0442\u044c. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0439\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0451\u043c \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0441\u0442\u0430\u043b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u0412\u043e\u0442 \u043a\u0430\u043a \u0442\u0443\u0442 \u043a\u043e\u043d\u0444\u0438\u0433 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">#include \"led_mono_config.h\"  #ifndef HAS_LED #error \"Add HAS_LED\" #endif \/*HAS_LED*\/  #include \"data_utils.h\"  const LedMonoConfig_t LedMonoConfig[] = {     {         .num = 1, .period_ms = 500,         .phase_ms = 500,        .duty = 10,         .pad = {.port = PORT_D, .pin = 15},         .name = \"Green\",        .mode = LED_MODE_BAM,         .active = GPIO_LVL_LOW,        .valid = true,     },     {         .num = 2,        .period_ms = 1000,        .phase_ms = 0,         .duty = 10,        .pad = {.port = PORT_D, .pin = 13},         .name = \"Red\",        .mode = LED_MODE_OFF,         .active = GPIO_LVL_LOW,        .valid = true,     },     {         .num = 3,        .period_ms = 1000,         .phase_ms = 0,        .duty = 10,         .pad = {.port = PORT_D, .pin = 14},         .name = \"Yellow\",        .mode = LED_MODE_PWM,         .active = GPIO_LVL_LOW,        .valid = true,     }, };  LedMonoHandle_t LedMonoInstance[] = {     { .num = 1, .valid = true,   },     { .num = 2, .valid = true,   },     { .num = 3, .valid = true,   }, };  uint32_t led_mono_get_cnt(void) {     uint32_t cnt = 0;     uint32_t cnt1 = 0;     uint32_t cnt2 = 0;     cnt1 = ARRAY_SIZE(LedMonoInstance);     cnt2 = ARRAY_SIZE(LedMonoConfig);     if(cnt1 == cnt2) {         cnt = cnt1;     }     return cnt; } <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0434\u043d\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438. \u041e\u0434\u0438\u043d \u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e.<\/p>\n<p>\u042d\u0442\u043e \u0435\u0449\u0451 \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u0443\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e *.map  \u0444\u0430\u0439\u043b \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435  \u0432 *.bin \u0444\u0430\u0439\u043b\u0435, \u0433\u0434\u0435 \u043b\u0435\u0436\u0438\u0442 \u044d\u0442\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430. \u0418 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u043e\u0439. <\/p>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438<\/strong><\/p>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f? \u042d\u0442\u043e \u0432\u0435\u0434\u044c \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0421\u0438-\u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0422\u043e \u0435\u0441\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0421\u0438-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0422\u043e\u043b\u044c\u043a\u043e \u0438 \u0432\u0441\u0435\u0433\u043e&#8230; \u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0442\u043e\u0433\u0434\u0430 \u043d\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439? \u0414\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e&#8230; \u0412\u043e\u0442.<\/p>\n<pre><code class=\"cpp\">#ifdef HAS_MICROCONTROLLER #include \"board_config.h\" #define BOARD_INIT                                                                                                     \\     { .init_function = board_init, .name = \"board\", }, #else \/*HAS_MICROCONTROLLER*\/ #define BOARD_INIT #endif \/*HAS_MICROCONTROLLER*\/  \/*Order matters!*\/ define INIT_FUNCTIONS \\     MCAL_INIT         \\     HW_INIT           \\     INTERFACES_INIT   \\     PROTOCOLS_INIT    \\     CONTROL_INIT      \\     STORAGE_SW_INIT   \\     SW_INIT           \\     UNIT_TEST_INIT    \\     ASICS_INIT        \\     BOARD_INIT  \/*Order matter!*\/ const SystemInitInstance_t SystemInitInstance[] = {INIT_FUNCTIONS};<\/code><\/pre>\n<p> \u0412\u044b\u0438\u0433\u0440\u044b\u0448 \u0442\u0443\u0442 \u0442\u0440\u043e\u0439\u043d\u043e\u0439: <\/p>\n<p>1&#8212;\u0412\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. <\/p>\n<p>2&#8212;\u041f\u0440\u044f\u0434\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. <\/p>\n<p>3&#8212;\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0431\u0449\u0438\u0439 \u043f\u0440\u043e\u043b\u043e\u0433 \u0438 \u044d\u043f\u0438\u043b\u043e\u0433-\u043a\u043e\u0434. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0435\u0447\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430 \u0438\u043b\u0438 \u0441\u0431\u0440\u043e\u0441 \u0441\u0442\u043e\u0440\u043e\u0436\u0435\u0432\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430. <\/p>\n<p>\u041f\u043e\u0442\u043e\u043c, \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u043e \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0432 UART \u0438\u043b\u0438 \u0432 SD \u043a\u0430\u0440\u0442\u0443. <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041b\u043e\u0433 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 \u0438\u043b\u0438 \u0431\u0440\u0430\u043a \u0432 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u0443\u0440\u0435 PCB (\u0436\u0435\u043b\u0435\u0437\u0435) \u0435\u0449\u0435 \u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0443\u043f\u0435\u0440\u0446\u0438\u043a\u043b\u0430.<\/p>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0441\u0443\u043f\u0435\u0440\u0446\u0438\u043a\u043b\u0430<\/strong><\/p>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0435\u0441\u0442\u044c \u0441\u0443\u043f\u0435\u0440\u0446\u0438\u043a\u043b. \u041b\u0438\u0431\u043e \u043e\u043d \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d \u044f\u0432\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 main(), \u043b\u0438\u0431\u043e \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 bare-bone \u043f\u043e\u0442\u043e\u043a\u0430 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c RTOS. \u0422\u0443\u0442 \u0442\u043e\u0436\u0435, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0443\u043f\u0435\u0440\u0446\u0438\u043a\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <strong>limiter<\/strong> \u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c, \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0451 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c. \u041d\u0435 \u0447\u0430\u0449\u0435 \u0447\u0435\u043c, \u0441\u043a\u0430\u0436\u0435\u043c, 500ms.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"left\"><strong>\u2116<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"415\" width=\"415\">\n<p align=\"left\"><strong>\u043f\u043e\u043b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0442\u0438\u043f<\/strong> <strong>\u0434\u0430\u043d\u043d\u044b\u0445<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"415\" width=\"415\">\n<p align=\"left\">\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0421\u0438-\u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0430\u0434\u0440\u0435\u0441 \u0432 Flash<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"415\" width=\"415\">\n<p align=\"left\">\u0438\u043c\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0442\u0435\u043a\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"415\" width=\"415\">\n<p align=\"left\">\u043f\u0435\u0440\u0438\u043e\u0434 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0421\u0438-\u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u0440\u043e \u044d\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442. \u041d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>\u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0417\u0430\u0434\u0430\u0447 \u0434\u043b\u044f \u041c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430<\/strong> <a href=\"https:\/\/habr.com\/ru\/articles\/757000\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/757000\/<\/a><\/p>\n<pre><code class=\"cpp\"> #ifdef HAS_BOARD_PROC #include \"board_at_start_f437.h\" #define BOARD_TASK {.name=\"board\",   \\      .period_us=BOARD_POLL_PERIOD_US,      \\     .limiter.function=board_proc,}, #else #define BOARD_TASK #endif \/**\/  #define TASK_LIST_ALL     \\     ASICS_TASK            \\     APPLICATIONS_TASKS    \\     BOARD_TASK            \\     MCAL_TASKS            \\     TASK_CORE             \\     COMPUTING_TASKS       \\     CONNECTIVITY_TASKS    \\     CONTROL_TASKS         \\     SENSITIVITY_TASKS     \\     STORAGE_TASKS  TaskConfig_t TaskInstance[] = {     TASK_LIST_ALL };<\/code><\/pre>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 NVRAM<\/strong><\/p>\n<p>\u041b\u044e\u0431\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c. \u041f\u0440\u043e \u044d\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442: NVRAM \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 <a href=\"https:\/\/habr.com\/ru\/articles\/706972\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/706972\/<\/a> \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e NVRAM \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0430\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u0430\u043a <\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\"><strong>\u2116<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\"><strong>\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e NVRAM \u0437\u0430\u043f\u0438\u0441\u0438<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u0440\u0430\u0437\u043c\u0435\u0440<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0431\u0430\u0439\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u0438\u043c\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 (\u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u0430\u0434\u0440\u0435\u0441 \u0432 NVRAM<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e (0&lt;=)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"65\" width=\"65\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"310\" width=\"310\">\n<p align=\"left\">\u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043a SW \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 (\u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043d\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430.<\/p>\n<pre><code class=\"cpp\"> const ParamItem_t ParamArray[] = {     FLASH_FS_PARAMS     PARAMS_GNSS     IWDG_PARAMS     PARAMS_PASTILDA     PARAMS_SDIO     PARAMS_TIME     PARAMS_BOOTLOADER     {.facility=BOOT, .id=PAR_ID_BOOT_CMD, .len=1, .type=TYPE_UINT8, .name=\"BootCmd\"}, \/*num*\/     {.facility=BOOT, .id=PAR_ID_REBOOT_CNT, .len=2, .type=TYPE_UINT16, .name=\"ReBootCnt\"}, \/*num*\/     {.facility=SYS, .id=PAR_ID_SERIAL_NUM, .len=4, .type=TYPE_UINT32, .name=\"SerialNum\"},  \/**\/ }; <\/code><\/pre>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438<\/strong><\/p>\n<p>\u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430\u0445 \u0435\u0441\u0442\u044c UART \u0434\u043b\u044f printf() \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u0438\u043c, \u043a\u0430\u0436\u0434\u0430\u044f \u0432\u0437\u0440\u043e\u0441\u043b\u0430\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438 \u043f\u0435\u0447\u0430\u0442\u0438 \u043b\u043e\u0433\u0430 (\u0432 UART \u0438\u043b\u0438 SD \u043a\u0430\u0440\u0442\u0443) \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0442\u0430\u0432\u0438\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0447\u0438\u0441\u043b\u0443 \u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d.<\/p>\n<pre><code class=\"cpp\">const static FacilityInfo_t FacilityInfo[] = {  #ifdef HAS_AES     { .facility = AES, .name = \"AES\", }, #endif \/*HAS_AES*\/  #ifdef HAS_AD9833     { .facility = AD9833, .name = \"AD9833\", }, #endif \/*HAS_AD9833*\/  #ifdef HAS_NOR_FLASH     { .facility = NOR_FLASH, .name = \"NorFlash\", }, #endif \/*HAS_NOR_FLASH*\/   #ifdef HAS_NVRAM     { .facility = NVRAM, .name = \"NvRam\", }, #endif \/*HAS_NVRAM*\/    .... };<\/code><\/pre>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u0438\u043c \u0442\u043e\u043a\u0435\u043d\u0430\u043c \u0432 \u044d\u0442\u043e\u043c \u043b\u043e\u0433\u0435 \u044f\u0432\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0432 \u043b\u043e\u0433\u0435. <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0423\u0434\u043e\u0431\u043d\u043e? \u041e\u0447\u0435\u043d\u044c!<\/p>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f CLI<\/strong><\/p>\n<p>\u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0437\u0440\u043e\u0441\u043b\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0435\u0441\u0442\u044c UART-CLI. \u0414\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 UART-CLI. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 CLI \u0442\u043e\u0436\u0435 \u0441\u043a\u043b\u0430\u0434\u0438\u0440\u0443\u0435\u043c \u0448\u0442\u0430\u0431\u0435\u043b\u044f\u043c\u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0442\u0435\u043a\u0441\u0442\u0435: \u041f\u043e\u0447\u0435\u043c\u0443 \u041d\u0430\u043c \u041d\u0443\u0436\u0435\u043d UART-Shell? <a href=\"https:\/\/habr.com\/ru\/articles\/694408\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/articles\/694408\/<\/a><\/p>\n<pre><code class=\"cpp\">#define CLI_CMD(LONG_CMD, SHORT_CMD, FUNC)                                 \\     { .short_name = SHORT_CMD, .long_name = LONG_CMD, .handler = FUNC }      bool nau8814_i2c_ping_command(int32_t argc, char* argv[]); bool nau8814_reg_map_command(int32_t argc, char* argv[]);  #define NAU8814_COMMANDS          \\                        \\                  NAU8814_DAC_COMMANDS                 \\                                NAU8814_ADC_COMMANDS                    \\                             CLI_CMD(\"nau8814_ping\", \"nap\", nau8814_i2c_ping_command ),  \\           CLI_CMD(\"nau8814_map\", \"nrm\", nau8814_reg_map_command ),          #define CLI_COMMANDS      \\                                                   ASICS_COMMANDS          \\                                            APPLICATIONS_COMMANDS   \\                                         CONTROL_COMMANDS        \\                                      CONNECTIVITY_COMMANDS   \\                                   COMPUTING_COMMANDS      \\                                MCAL_COMMANDS           \\                             MULTIMEDIA_COMMANDS     \\                          PROTOTYPE_COMMANDS      \\                       STORAGE_COMMANDS        \\                                                   SENSITIVITY_COMMANDS    const CliCmdInfo_t CliCommands[] = {CLI_COMMANDS}; <\/code><\/pre>\n<p><strong>\u041c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437 CLI \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0443 \u043d\u0435\u0451 \u043d\u0430 \u0431\u043e\u0440\u0442\u0443. \u0421\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0442\u0435\u0441\u0442\u043e\u043c \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<pre><code class=\"cpp\"> bool test_c_types(void) {     LOG_INFO(TEST, \"%s()..\", __FUNCTION__);     bool res = true;       EXPECT_EQ(4, sizeof(long));     EXPECT_EQ(4, sizeof(1UL));     EXPECT_EQ(4, sizeof(1L));     EXPECT_EQ(4, sizeof(size_t));     EXPECT_EQ(4, sizeof(1l));       EXPECT_EQ(4, sizeof(1));     EXPECT_EQ(4,<\/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-377773","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377773","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=377773"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377773\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=377773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=377773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=377773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}