{"id":264592,"date":"2015-08-31T01:13:02","date_gmt":"2015-08-30T21:13:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=264592"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=264592","title":{"rendered":"USB bootloader \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435: \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441 \u0444\u043b\u0435\u0448\u043a\u0438"},"content":{"rendered":"<p>     \t\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0438\u0439\u043d\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u0438\u0437\u0434\u0435\u043b\u0438\u044f\u0445, \u0438\u043b\u0438 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0438\u0437\u0434\u0435\u043b\u0438\u044f\u0445, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0443 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u0446\u0435\u043d\u0438\u0442\u044c. \u042d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0430\u0433\u043e\u0432 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u043d\u043e \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0441 \u0431\u043e\u043b\u0435\u0435 \u043b\u0451\u0433\u043a\u0438\u043c \u0441\u0435\u0440\u0434\u0446\u0435\u043c \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u00ab\u0435\u0449\u0435 \u0441\u044b\u0440\u043e\u0432\u0430\u0442\u044b\u0439\u00bb \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u043d\u0430 \u0440\u044b\u043d\u043e\u043a, \u0435\u0441\u043b\u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d5a\/700\/eb4\/d5a700eb4f04415cb63c505ee763182b.png\"\/><br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u044f bootloader&#8217;\u0430 \u0432\u043e \u0432\u043d\u043e\u0432\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 bootloader&#8217;\u0430 \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 USB \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 Atmel <a href=\"http:\/\/www.atmel.com\/products\/microcontrollers\/arm\/sam-d.aspx#samd21\">SAM D21<\/a> \u0441 \u044f\u0434\u0440\u043e\u043c Cortex M0+. \u0410 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043d\u0430 <a href=\"http:\/\/www.atmel.com\/devices\/ATSAMD21J18A.aspx\">SAMD21J18A<\/a>. \u0423 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 SAM D20\/21 \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0442\u043b\u043e\u0430\u0434\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u041d\u0430 \u0441\u0430\u0439\u0442\u0435 Atmel \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"http:\/\/www.atmel.com\/products\/microcontrollers\/arm\/sam-d.aspx?tab=documents\">Application notes<\/a>, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 (UART, I2C, SPI, USB). \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f USB-\u0431\u0443\u0442\u043b\u043e\u0430\u0434\u0435\u0440\u0430.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h4>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u0443\u044e \u0444\u043b\u0435\u0448\u043a\u0443 \u0444\u0430\u0439\u043b \u0441 \u043d\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u043e\u0439, \u0432\u043e\u0442\u043a\u043d\u0443\u0442\u044c \u0444\u043b\u0435\u0448\u043a\u0443 \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 reset (\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0438\u0442\u0430\u043d\u0438\u0435). \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 bootloader, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u043e\u0439 \u043d\u0430 \u0444\u043b\u0435\u0448\u043a\u0435 \u0438 \u0437\u0430\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 application<\/li>\n<li>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u00ab\u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0434\u0443\u0440\u0430\u043a\u0430\u00bb \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438, \u0447\u0442\u043e \u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043d\u0430 \u0444\u043b\u0435\u0448\u043a\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0435\u0441\u043b\u0438 \u00ab\u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u00bb \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u0444\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u043c \u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0430, \u043d\u043e \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0441\u0443\u043d\u0443\u0432 \u0444\u043b\u0435\u0448\u043a\u0443 \u0441 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u043e\u0439<\/li>\n<li>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 USB \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 USB \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/li>\n<li>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443, \u0447\u0442\u043e \u0431\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443<\/li>\n<li>\u0421\u0447\u0438\u0442\u0430\u0435\u043c \u0447\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u041f\u041a \u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438<\/h4>\n<p>  <\/p>\n<h5>\u041f\u0430\u043c\u044f\u0442\u044c<\/h5>\n<p>  \u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0441\u0435\u0440\u0438\u0438 SAMD20\/21 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/1f3\/8a7\/989\/1f38a7989f384f28bcc9d8f03623e4e4.png\" alt=\"\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 samd20\"\/><br \/>  \u042d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0440\u044f\u0434\u0430\u043c\u0438, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u044f\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 4 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0420\u0430\u0437\u043c\u0435\u0440 1 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b 64 \u0431\u0430\u0439\u0442\u0430. \u042d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0441\u0442\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0440\u044f\u0434\u0430\u043c\u0438, \u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c. <br \/>  \u041d\u0438\u0436\u043d\u0438\u0435 (\u043c\u043b\u0430\u0434\u0448\u0438\u0435) \u0440\u044f\u0434\u044b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0431\u0443\u0442\u043b\u043e\u0430\u0434\u0435\u0440\u0430 (\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u044c\u044e\u0437\u043e\u0432 BOOTPROT), \u0430 \u0432\u0435\u0440\u0445\u043d\u0438\u0435 \u0440\u044f\u0434\u044b \u0434\u043b\u044f \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 EEPROM. <br \/>  Bootloader-\u0441\u0435\u043a\u0446\u0438\u044f \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0443 lock-\u0431\u0438\u0442\u0430\u043c\u0438 \u0438 \u0444\u044c\u044e\u0437\u0430\u043c\u0438 BOOTPROT. <br \/>  \u0424\u044c\u044e\u0437\u044b BOOTPROT \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 bootloader-\u0441\u0435\u043a\u0446\u0438\u0438 \u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0442 \u0447\u0442\u0435\u043d\u0438\u044f. <br \/>  EEPROM \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0437\u0430\u0449\u0438\u0442\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0435\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<h4>\u0427\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 bootloader&#8217;\u0430?<\/h4>\n<p>  <\/p>\n<ol>\n<li>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u2013 \u0437\u0430 \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 Non-volatile memory (NVM);<\/li>\n<li>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 USB \u2013 \u0437\u0430 \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 USB;<\/li>\n<li>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u2013 \u044d\u0442\u043e \u043f\u043e\u0434 \u0441\u0438\u043b\u0443 FATFS.<\/li>\n<li>\u0418 \u043f\u043e \u043c\u0435\u043b\u043e\u0447\u0438: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430, \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/li>\n<\/ol>\n<p>  <i><b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0440\u0435\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"http:\/\/www.atmel.com\/ru\/ru\/Microsite\/atmel_studio6\/\">Atmel Studio<\/a> \u0432\u0435\u0440\u0441\u0438\u0438 6.2 (\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u0446\u0430 AVR Studio) \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <a href=\"http:\/\/www.atmel.com\/ru\/ru\/tools\/avrsoftwareframework.aspx?tab=overview\">ASF<\/a> (Atmel Software Framework)<\/i><\/p>\n<h5>\u0422\u043e\u043d\u043a\u043e\u0441\u0442\u0438 USB<\/h5>\n<p>  \u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c USB \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0448\u0438\u043d\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0447\u0435\u043d\u044c \u0442\u043e\u0447\u043d\u043e\u0435 \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043a\u0432\u0430\u0440\u0446 \u043d\u0430 32 \u043a\u0413\u0446 \u043a\u0430\u043a \u043e\u043f\u043e\u0440\u0443 \u0434\u043b\u044f DFLL (Digital Frequency Locked Loop). \u0412\u044b\u0445\u043e\u0434 DFLL \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0434\u043b\u044f \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f USB \u043c\u043e\u0434\u0443\u043b\u044f, \u0442\u0430\u043a \u0438 \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b USB \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c DFLL \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0431\u044b\u043b\u043e \u0440\u043e\u0432\u043d\u043e 48 \u041c\u0413\u0446. \u0414\u043b\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b DFFL \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 closed loop. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d96\/3f3\/53c\/d963f353c1b7493b8ec5970bd11bb757.png\" alt=\"\u0422\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\"\/>  <\/p>\n<h4>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/h4>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/www.atmel.com\/webdoc\/asf\/asf.ModuleExplorerView.html\">ASF wizard<\/a> \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u043c\u043e\u0434\u0443\u043b\u0438, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435.<\/p>\n<h5>USB Host<\/h5>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <b>USB Host service<\/b> \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <b>mass storage<\/b>.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b 2 \u0438\u0437 \u043d\u0438\u0445:  <\/p>\n<ul>\n<li><b>conf_usb_host.h<\/b> \u2013 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442 USB \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 (Callback),<\/li>\n<li><b>conf_access.h<\/b> \u2013 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e.<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0442\u0435\u043a\u0430 USB \u0445\u043e\u0441\u0442\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u0432\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"cpp\">USB_MASS_STORAGE_ENABLE=true ACCESS_MEM_TO_RAM_ENABLED=true <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0449\u0435\u043b\u043a\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0443, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <b>Properties -&gt; Toolchain -&gt; ARM\/GNU C Compiler -&gt; Symbols<\/b>.<br \/>  \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <b>&quot;#define Lun_usb_unload \u2014 NULL&quot;<\/b> \u0432 <b>USB LUNs Definitions<\/b> \u0432 \u0444\u0430\u0439\u043b\u0435 <b>conf_access.h<\/b> \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<br \/>  \u0414\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0448\u0438\u043d\u0435 USB \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f (callback) \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044e <b>Start of Frame<\/b>. \u042d\u0442\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0441\u044b\u043b\u043a\u0435 SOF, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a SOF \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437 \u0432 1 \u043c\u0441, \u043a\u043e\u0433\u0434\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043a \u0448\u0438\u043d\u0435, \u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0442\u0430\u0439\u043c\u0435\u0440.<br \/>  \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0444\u0430\u0439\u043b\u0435 <b>conf_usb_host.h<\/b>.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <b>main_usb_sof_event()<\/b> \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0430\u0439\u043b\u0430 <b>conf_usb_host.h<\/b> \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 #include&#8217;\u043e\u0432.  <\/p>\n<pre><code class=\"cpp\">void main_usb_sof_event(void); <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0441\u0442\u0440\u043e\u043a\u0443:  <\/p>\n<pre><code class=\"cpp\"># define UHC_SOF_EVENT() main_usb_sof_event() <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e-\u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 <b>main.c<\/b>, \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430:  <\/p>\n<pre><code class=\"cpp\">volatile static uint16_t main_usb_sof_counter = 0; <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f (callback):  <\/p>\n<pre><code class=\"cpp\">void main_usb_sof_event(void) {    main_usb_sof_counter++; } <\/code><\/pre>\n<p>  <\/p>\n<h5>\u0424\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<\/h5>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <b>FAT FS file system service<\/b> (c \u043f\u043e\u043c\u043e\u0449\u044c\u044e ASF wizard). \u0420\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c RTC \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 <b>calendar_polled<\/b>.<br \/>  \u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435<b> main.c<\/b>:  <\/p>\n<pre><code class=\"cpp\">#include &quot;string.h&quot; #define MAX_DRIVE _VOLUMES #define FIRMWARE_FILE &quot;firmware.bin&quot; const char firmware_filename[] = {FIRMWARE_FILE}; \/* FATFS variables *\/ static FATFS fs; static FILE file_object; <\/code><\/pre>\n<p>  \u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 (#define FIRMWARE_FILE \u00abfirmware.bin\u00bb) \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0444\u0430\u0439\u043b\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u043d\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u043e\u0439 \u0444\u043b\u0435\u0448\u043a\u0435.<\/p>\n<h5>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e<\/h5>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c NVM-Non-volatile memory (driver). \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 main.c:  <\/p>\n<pre><code class=\"cpp\">#define APP_START_ADDRESS (NVMCTRL_ROW_SIZE * 200) uint8_t page_buffer[NVMCTRL_PAGE_SIZE]; <\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 (\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e), \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c (\u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0435\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e):  <\/p>\n<pre><code class=\"cpp\">struct nvm_config nvm_cfg; void nvm_init(void) { \tnvm_get_config_defaults(&nvm_cfg); \tnvm_cfg.manual_page_write=false; \tnvm_set_config(&nvm_cfg); } <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434.<\/p>\n<h4>\u041a\u043e\u0434<\/h4>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432 \u0431\u0443\u0442\u043b\u043e\u0430\u0434\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0443 \u0436\u0435 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u044e, \u0447\u0442\u043e \u0438 application, \u0442\u043e \u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u0432 application. \u0421\u0431\u0440\u043e\u0441 (reset) \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0432 ASF.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a USB \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 1-2 \u0441\u0435\u043a\u0443\u043d\u0434 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0435\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0448\u0438\u043d\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<br \/>  \u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b (\u0442\u043e\u043b\u044c\u043a\u043e bootloader) \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435: <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d67\/3d3\/b68\/d673d3b6864e458abcd84d5d5b9e9f8d.png\" alt=\"\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\"\/>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;asf.h&gt; #include &lt;exp_io.h&gt; #include &lt;led.h&gt; #include &quot;string.h&quot; \/\/------------------------------------------------------------------------------------------------------------------------------ #define MAX_DRIVE _VOLUMES #define FIRMWARE_FILE &quot;Modbus_RTU_TCP.bin&quot; #define APP_START_ADDRESS (NVMCTRL_ROW_SIZE * 200) \/\/------------------------------------------------------------------------------------------------------------------------------ const char firmware_filename[] = {FIRMWARE_FILE}; \/\/ FATFS variables  static FATFS fs; static FIL file_object; \/\/ NVM uint8_t page_buffer[NVMCTRL_PAGE_SIZE]; struct nvm_config nvm_cfg; \/\/USB volatile static uint16_t main_usb_sof_counter = 0; \/\/------------------------------------------------------------------------------------------------------------------------------ void main_usb_sof_event(void) { \tmain_usb_sof_counter++; }  static void check_boot_mode(void) { \tuint32_t app_check_address; \tuint32_t *app_check_address_ptr; \t\/\/ Check if WDT is locked  \tif (!(WDT-&gt;CTRL.reg & WDT_CTRL_ALWAYSON)) \t{ \t\t\/\/Disable the Watchdog module  \t\tWDT-&gt;CTRL.reg &= ~WDT_CTRL_ENABLE; \t} \tapp_check_address = APP_START_ADDRESS; \tapp_check_address_ptr = (uint32_t *)app_check_address; \tif (*app_check_address_ptr == 0xFFFFFFFF) \t{ \t\t\/\/ No application; run bootloader  \t\treturn; \t}  \t\/\/ Pointer to the Application Section  \tvoid (*application_code_entry)(void); \t\/\/ Rebase the Stack Pointer  \t__set_MSP(*(uint32_t *)APP_START_ADDRESS); \t\/\/ Rebase the vector table base address TODO: use RAM  \tSCB-&gt;VTOR = ((uint32_t)APP_START_ADDRESS & SCB_VTOR_TBLOFF_Msk); \t\/\/ Load the Reset Handler address of the application  \tapplication_code_entry = (void (*)(void))(unsigned *)(*(unsigned *)(APP_START_ADDRESS + 4)); \t\/\/Jump to user Reset Handler in the application  \tapplication_code_entry(); }  void delay_ms(uint32_t ms) { \tvolatile int a=0; \tfor(uint32_t i=0; i&lt;ms; i++) \t{ \t\tfor( int j=0; j&lt;2000; j++) \t\ta++; \t} }  void nvm_init(void) { \tnvm_get_config_defaults(&nvm_cfg); \tnvm_cfg.manual_page_write=false; \tnvm_set_config(&nvm_cfg); }  void init_IO(void) { \tExpIO_Init(); \tLED_Init(); }  int main (void) { \tvolatile uint16_t z=0; \tuint32_t fw_size ; \tUINT bytes_read = 0; \tenum status_code error_code; \tuint32_t current_page; \tuint32_t curr_address = 0; \t\/\/ Erase flash rows to fit new firmware \tuint16_t rows_clear; \tuint16_t i; \tcheck_boot_mode(); \tsystem_init();     init_IO(); \tnvm_init(); \tuhc_start(); \t \twhile (1) \t{ \t\tif(65000==z) \t\t{ \t\t\tLED(GREEN,0); \t\t\tdelay_ms(1000); \t\t\tLED(GREEN,1);\t\t\t\t \t\t\tz = 0; \t\t} \t\tz++;         \/\/ Wait 2 seconds before trying to access the USB drive  \t    if (main_usb_sof_counter &gt; 2000)  \t    { \t\t   main_usb_sof_counter = 0; \t\t   volatile uint8_t lun = LUN_ID_USB; \t\t   \/\/ Mount drive  \t\t   memset(&fs, 0, sizeof(FATFS)); \t\t   FRESULT res = f_mount(lun, &fs); \t\t   if (FR_INVALID_DRIVE == res)  \t\t   { \t\t\t  continue; \t\t   } \t\t   res = f_open(&file_object,firmware_filename, FA_READ); \t\t   if (res == FR_NOT_READY)  \t\t   { \t\t\t   \/\/ LUN not ready  \t\t\t  f_close(&file_object); \t\t\t  continue; \t\t   } \t\t   if (res != FR_OK) \t\t   { \t\t\t   \/\/ LUN test error  \t\t\t  f_close(&file_object); \t\t\t  continue; \t\t   } \t\t   \/\/ Get size of file  \t\t   fw_size = f_size(&file_object); \t \t   bytes_read = 0; \t\t   if (fw_size != 0)  \t\t   { \t\t\t  current_page = APP_START_ADDRESS \/NVMCTRL_PAGE_SIZE; \t\t\t  curr_address = 0; \t\t\t  \/\/ Erase flash rows to fit new firmware  \t\t\t  rows_clear = fw_size \/ NVMCTRL_ROW_SIZE; \t\t\t  for (i = 0; i &lt; rows_clear; i++) \t\t\t  { \t\t\t\tdo { \t\t\t\t\terror_code = nvm_erase_row(\t(APP_START_ADDRESS) +(NVMCTRL_ROW_SIZE * i)); \t\t\t\t} while (error_code == STATUS_BUSY); \t\t\t  } \t\t\t  do { \t\t\t\t    \/\/Read data from USB stick to the page buffer  \t\t\t\t    f_read(&file_object,page_buffer,NVMCTRL_PAGE_SIZE,&bytes_read ); \t\t\t        bytes_read=64; \t\t\t\t    curr_address += bytes_read; \t\t\t\t    \/\/ Write page buffer to flash  \t\t\t\t    do { \t\t\t\t\t      error_code = nvm_write_buffer(current_page * NVMCTRL_PAGE_SIZE,\tpage_buffer, bytes_read); \t\t\t\t   } while (error_code == STATUS_BUSY); \t\t\t\t    current_page++; \t\t\t    } while (curr_address &lt; fw_size); \t    } \t\tf_close(&file_object); \t\tsystem_interrupt_disable_global(); \t\tuhc_stop(1); \t\tNVIC_SystemReset(); \t  } \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438<\/h4>\n<p>  \u0412 <a href=\"http:\/\/www.atmel.com\/devices\/ATSAMD21J18A.aspx\">SAMD21J18A<\/a> (\u043a\u0430\u043a \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0441\u0435\u0440\u0438\u0438 SAMD20\/21) \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u044f\u0434 NVM \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 4 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e 64 \u0431\u0430\u0439\u0442\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c 200 \u0440\u044f\u0434\u043e\u0432 (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u043e\u0434 bootloader) \u044d\u0442\u043e (200 * 4 * 64) \u0431\u0430\u0439\u0442 = 51200 (0xC800) \u0431\u0430\u0439\u0442 \u043f\u0430\u043c\u044f\u0442\u0438. \u0418 application \u0447\u0430\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 51200 \u0431\u0430\u0439\u0442 flash \u043f\u0430\u043c\u044f\u0442\u0438.<br \/>  \u0420\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 flash \u043f\u0430\u043c\u044f\u0442\u0438:<br \/>  \u0421\u0435\u043a\u0446\u0438\u044f bootloader:  <\/p>\n<ul>\n<li>\u0420\u0430\u0437\u043c\u0435\u0440: 50 \u043a\u0431\u0430\u0439\u0442 (51200 \u0431\u0430\u0439\u0442)<\/li>\n<li>\u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e(flash \u043f\u0430\u043c\u044f\u0442\u044c): 0x00000000 \u0434\u043e 0x0000C7FF<\/li>\n<\/ul>\n<p>  \u0421\u0435\u043a\u0446\u0438\u044f application:  <\/p>\n<ul>\n<li>\u0420\u0430\u0437\u043c\u0435\u0440: 206 \u043a\u0431\u0430\u0439\u0442 (256\u043a\u0431\u0430\u0439\u0442-50\u043a\u0431\u0430\u0439\u0442)<\/li>\n<li>\u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e(flash \u043f\u0430\u043c\u044f\u0442\u044c): 0x0000C800 \u0434\u043e 0x0003FFFF<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u0441 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c \u0430\u0434\u0440\u0435\u0441\u0430, \u0430 \u043d\u0435 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 flash \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043b\u0438\u043d\u043a\u0435\u0440\u0430. <br \/>  \u0421\u0430\u043c \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 solution explorer. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <b>samd21j18a_flash.ld<\/b>:<br \/>  \u041f\u0443\u0442\u044c: src-asf-sam0-utils-linker scripts-samd21-gcc<br \/>  \u0412 \u043d\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438:<br \/>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<br \/>  <code> rom (rx) : ORIGIN = 0x00000000,  LENGTH = 0x00040000 <\/code><br \/>  \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u0430 \u043d\u0430<br \/>  <code> rom (rx) : ORIGIN = 0x0000C800, LENGTH = 0x00033800 <\/code><br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0435\u043d\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0431\u0443\u0442\u043b\u043e\u0430\u0434\u0435\u0440.     \t<\/p>\n<div class=\"clear\"><\/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=\"http:\/\/geektimes.ru\/post\/261006\/\"> http:\/\/geektimes.ru\/post\/261006\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0438\u0439\u043d\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u0438\u0437\u0434\u0435\u043b\u0438\u044f\u0445, \u0438\u043b\u0438 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0438\u0437\u0434\u0435\u043b\u0438\u044f\u0445, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0443 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u0446\u0435\u043d\u0438\u0442\u044c. \u042d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0430\u0433\u043e\u0432 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u043d\u043e \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0441 \u0431\u043e\u043b\u0435\u0435 \u043b\u0451\u0433\u043a\u0438\u043c \u0441\u0435\u0440\u0434\u0446\u0435\u043c \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u00ab\u0435\u0449\u0435 \u0441\u044b\u0440\u043e\u0432\u0430\u0442\u044b\u0439\u00bb \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u043d\u0430 \u0440\u044b\u043d\u043e\u043a, \u0435\u0441\u043b\u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d5a\/700\/eb4\/d5a700eb4f04415cb63c505ee763182b.png\"\/><br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u044f bootloader&#8217;\u0430 \u0432\u043e \u0432\u043d\u043e\u0432\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 bootloader&#8217;\u0430 \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 USB \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 Atmel <a href=\"http:\/\/www.atmel.com\/products\/microcontrollers\/arm\/sam-d.aspx#samd21\">SAM D21<\/a> \u0441 \u044f\u0434\u0440\u043e\u043c Cortex M0+. \u0410 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043d\u0430 <a href=\"http:\/\/www.atmel.com\/devices\/ATSAMD21J18A.aspx\">SAMD21J18A<\/a>. \u0423 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 SAM D20\/21 \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0442\u043b\u043e\u0430\u0434\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u041d\u0430 \u0441\u0430\u0439\u0442\u0435 Atmel \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"http:\/\/www.atmel.com\/products\/microcontrollers\/arm\/sam-d.aspx?tab=documents\">Application notes<\/a>, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 (UART, I2C, SPI, USB). \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f USB-\u0431\u0443\u0442\u043b\u043e\u0430\u0434\u0435\u0440\u0430.  <\/p>\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-264592","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264592","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=264592"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264592\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}