{"id":308747,"date":"2020-08-20T09:00:33","date_gmt":"2020-08-20T09:00:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=308747"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=308747","title":{"rendered":"\u0420\u0435\u0432\u0435\u0440\u0441 embedded: \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043a\u043e\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 SPI-flash"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/ntc-vulkan\/blog\/515906\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ab\/ng\/ri\/abngribz3iwleiggqt7zs2yp1gg.jpeg\">   <\/p>\n<p>\u0417\u0430\u0447\u0435\u043c?!<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u044d\u043c\u043e\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043b\u044e\u0434\u0435\u0439, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0432\u0448\u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e: \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u044b \u0434\u043e\u0445\u043e\u0434\u0438\u0442\u0435 \u0434\u043e \u0442\u043e\u0447\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u0434, \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 UART \u0437\u0430\u0432\u0435\u0442\u043d\u043e\u0435 &quot;Hello, Habr!&quot;, \u043f\u043e\u043c\u0438\u0433\u0430\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u043a\u0430\u043a \u043d\u0430 \u043d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0435\u0439 \u0451\u043b\u043a\u0435 \u0438\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c JTAG, \u043d\u043e \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0432 \u0432\u0430\u0448\u0435\u043c \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 SPI-\u0444\u043b\u0435\u0448\u0435\u043a.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"vvedenie\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/ntc-vulkan\/blog\/485966\/\">\u0420\u0435\u0432\u0435\u0440\u0441 USB-SATA-\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 (\u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0436\u0435\u0440\u0430)<\/a> \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u043e\u0431 SPI-\u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435 <a href=\"https:\/\/www.eltan.com\/products\/spi-flash-tools\/46-em100-emulator.html\">EM100-Pro<\/a>. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 SPI-flash \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043b\u043e\u0433 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430 SPI \u0448\u0438\u043d\u0435. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0447\u0430\u0441\u0442\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u0430\u0438\u0432\u0430\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u044b \u0441 \u043f\u043b\u0430\u0442\u044b \u0438\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043a\u043b\u0438\u043f\u0441\u0430\u043c\u0438. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u0432 GUI \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e \u0436\u0435 \u0441 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 SPI? \u0412 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435 \u0435\u0441\u0442\u044c \u0438 \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u041e\u043d\u0430 \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0430\u0444\u0438\u0448\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 <a href=\"https:\/\/www.dediprog.com\/download\/save\/79.pdf\">\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435<\/a>, \u0430 \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 <a href=\"https:\/\/www.eltan.com\/images\/brochures\/em100\/em100_presentation.pdf\">\u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438, \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e \u043f\u043e\u0447\u0442\u0435 \u0443 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1m\/6j\/b8\/1m6jb8olr5vwpa1gqfatytydczs.png\">   <\/p>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  <\/p>\n<h2 id=\"teper-obo-vsem-po-poryadku\">\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443<\/h2>\n<p>  <\/p>\n<p>SPI-\u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0441\u043c\u0435\u043d\u044b \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0438\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445\u0441\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0439 SPI-\u0444\u043b\u0435\u0448\u043a\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0443\u043c\u0435\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043c\u0430\u0441\u0442\u0435\u0440-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u044b\u043b \u0441\u043e\u0431\u0440\u0430\u043d \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u043d\u044b\u0439 \u0441\u0442\u0435\u043d\u0434. <\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/la\/ra\/yr\/larayrczhi3lffini4pxz-fp2bs.jpeg\"><\/div>\n<p>  <\/p>\n<p>\u041d\u0430 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 SM32F4DISCOVERY \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 SPI1 \u0438 \u043a \u044d\u0442\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u0430\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e SPI-Flash \u041f\u0417\u0423. <\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ny\/x3\/ci\/nyx3ci_p6el7qcnzff1gig8hk6e.png\"><\/div>\n<p>  <\/p>\n<p>\u0418\u0437 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c SPI-\u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0441 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u0438 \u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c. <\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zk\/hv\/rl\/zkhvrld-vpz2uy0zzp3cuktqiba.png\"><\/div>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Write uFIFO. uFIFO \u2014 \u0431\u0443\u0444\u0435\u0440 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 512 \u0431\u0430\u0439\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043a \u041f\u041a. \u0414\u0430\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0430 \u0441 \u041f\u041a \u043c\u043e\u0436\u043d\u043e \u0435\u0433\u043e \u0447\u0438\u0442\u0430\u0442\u044c. \u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c uFIFO \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430, \u0442\u043e GUI \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0445 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442. \u041d\u0438\u0436\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/t8\/kp\/s2\/t8kps2n8vjrlwrnmz6fo46lqd0m.png\"><\/div>\n<p>  <\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u043f\u043e\u0441\u044b\u043b\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 uFIFO \u0432\u044b\u0433\u043b\u0430\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>techCmd<\/th>\n<th><\/th>\n<th>CMD write uFIFO<\/th>\n<th>preByte1<\/th>\n<th>preByte2<\/th>\n<th>preByte3<\/th>\n<th>preByte4<\/th>\n<th>typeData<\/th>\n<th>lenData<\/th>\n<th>Data&#8230;..<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>11h<\/td>\n<td>don&#8217;t care<\/td>\n<td>C0h<\/td>\n<td>40h<\/td>\n<td>44h<\/td>\n<td>36h<\/td>\n<td>47h<\/td>\n<td>1-7<\/td>\n<td>\u0445<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Dediprog \u0440\u0435\u0448\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u043e &quot;@D6G&quot;, \u044f\u0432\u043d\u043e \u043d\u0430\u043c\u0435\u043a\u0430\u044e\u0449\u0435\u0435 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0435 &quot;debug&quot;.<\/p>\n<p>  <\/p>\n<h3 id=\"rezhim-ascii\">\u0420\u0435\u0436\u0438\u043c ASCII<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c UART. \u041e\u0431\u044b\u0447\u043d\u043e \u0442\u0443\u0434\u0430 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0418\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432\u044b\u0448\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e ASCII \u0441\u0442\u0440\u043e\u043a\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u044e\u0442\u0441\u044f \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u043c, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 uFIFO \u0432 \u043f\u043e\u043b\u0435 Data Type \u043a\u043e\u0434 05h. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043b\u0438\u0441\u0442\u0438\u043d\u0433, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 ASCII-\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 uFIFO void SpiFlash_WriteUFifo(unsigned int count, unsigned char* buffer) {        \/\/ 0x11 - custom-\u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430     \/\/ 0x00 - don't care byte     \/\/ 0xC0 - \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 uFIFO     char writeFifoCmd[3] = {0x11, 0x00, 0xC0};     CSEnable();     HAL_SPI_Transmit(&amp;hspi1, writeFifoCmd, sizeof(writeFifoCmd), HAL_MAX_DEALY);     HAL_SPI_Transmit(&amp;hspi1, buffer, count, HAL_MAX_DEALY);     \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435     CSDisable();     }  \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 ASCII \u0441\u0442\u0440\u043e\u043a\u0438 void SpiFlash_TxString(char* str) {     \/\/ preamble data packet, 0x05 - ASCII type     char premsg[6] = {0x40, 0x44, 0x36, 0x47, 0x05};       premsg[5] = strlen(str);     Flash_WaitBusy();                                                    SpiFlash_WriteUFifo(sizeof(premsg), premsg);    \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c &quot;\u043c\u0430\u0433\u0438\u044e&quot;     SpiFlash_WriteUFifo(strlen(str), str);          \/\/ \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 }  \/\/ \u0412\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 SpiFlash_TxString(&quot;Hello, Habr!\\n\\0&quot;); SpiFlash_TxString(&quot;Program start!\\n\\0&quot;); SpiFlash_TxString(&quot;While loop:\\n\\0&quot;); <\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c, \u043f\u0440\u043e\u0448\u0438\u0432\u0430\u0435\u043c \u041c\u041a, \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c GUI \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c SPI Hyper Terminal \u0438 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u041c\u041a \u0432\u0438\u0434\u0438\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430\u0448\u0438 \u0441\u0442\u0440\u043e\u043a\u0438. <\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sd\/ao\/mk\/sdaomksvbxq65g40uzwovk0z7n0.png\"><\/div>\n<p>  <\/p>\n<h3 id=\"rezhim-hex\">\u0420\u0435\u0436\u0438\u043c HEX<\/h3>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e ASCII-\u0434\u0430\u043d\u043d\u044b\u0445. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 Flash-\u043f\u0430\u043c\u044f\u0442\u0438 \u041c\u041a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432 \u043f\u043e\u043b\u0435 Data Type \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 04h. \u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 HEX. <\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 HEX \u0434\u0430\u043d\u043d\u044b\u0445 void SpiFlash_TxHexArray(unsigned char* hexArray, unsigned int count){     char premsg[6] = {0x40, 0x44, 0x36, 0x47, 0x04};     premsg[5] = count;     Flash_WaitBusy();     SpiFlash_WriteUFifo(sizeof(premsg), premsg);     SpiFlash_WriteUFifo(count, hexArray); }  \/\/ \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432-\u0441\u0447\u0435\u0442\u0447\u0438\u043a unsigned char array[0x10]; for(int i = 0; i &lt; 0x10; i++) {     array[i] = i; } SpiFlash_TxString(&quot;Array dump:\\0&quot;); SpiFlash_TxHexArray(array, 0x10); \/\/ \u0414\u0430\u043c\u043f\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0444\u043b\u0435\u0448\u043a\u0443 \u041c\u041a Spi_Flash_TxString(&quot;Memory dump:\\0&quot;); Spi_Flash_TxHexArray((char*)0x08000000, 0x10);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u0434\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u043a\u043d\u043e \u0438\u0437 ST-LINK Utility. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0422\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 STM32 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u044f\u0434\u0440\u043e Cortex-M, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Endianness\">little-endian<\/a>. <\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yg\/l2\/py\/ygl2pyhukyiwiagmdamlprczvt4.png\"><\/div>\n<p>  <\/p>\n<h3 id=\"rezhim-checkpoint\">\u0420\u0435\u0436\u0438\u043c Checkpoint<\/h3>\n<p>  <\/p>\n<p>\u041d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0432 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0443\u044e \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u041f\u041e \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0444\u0430\u0439\u043b &quot;Checkpoint.txt&quot; \u0432 ini-\u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043c\u0435\u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u043e\u043a\u043d\u0435 \u041f\u041e \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 checkpoint-a  void SpiFlash_SetCheckPoints(unsigned char* points, unsigned char countPoints) {     char premsg[6] = {0x40, 0x44, 0x36, 0x47, 0x01};         premsg[5] = countPoints;         Flash_WaitBusy();     SpiFlash_WriteUFifo(sizeof(premsg), premsg);     SpiFlash_WriteUFifo(countPoints, points);    }  \/\/\u0412\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438  unsigned char checkPoint[1]; checkPoint[0] = 0x1; SpiFlash_SetCheckPoints(checkPoint, 1); \/\/...\u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 checkPoint[0] = 0x2; SpiFlash_SetCheckPoints(checkPoint, 1); \/\/...\u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 checkPoint[0] = 0x3; SpiFlash_SetCheckPoints(checkPoint, 1);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>SpiFlash_SetCheckPoints(checkPoint, 1)<\/code>, \u0438 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r2\/dn\/dj\/r2dndj-ufnfqtgswwewnrpaxm8e.png\"><\/div>\n<p>  <\/p>\n<h3 id=\"rezhim-lookup-table\">\u0420\u0435\u0436\u0438\u043c Lookup table<\/h3>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Lookup table. \u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043c\u0431\u0438\u043e\u0437\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u0432 ASCII \u0438 Checkpoint. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u0437 \u0444\u0430\u0439\u043b\u0430, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 GUI, \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a \u043d\u0438\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0438\u0437 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0432 \u041c\u041a \u043a\u043e\u0434\u0430. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0434\u0440\u0430\u0433\u043e\u0446\u0435\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u041c\u041a \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043e\u0431\u0440\u0430\u043c\u043b\u044f\u044f \u0438\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u044c\u044e.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b  void SpiFlash_LookUpTable(uint16_t index, uint16_t AsciiChar) {     char premsg[10] = {0x40, 0x44, 0x36, 0x47, 0x07, 0x04};       premsg[6] = (index &gt;&gt; 8) &amp; 0xFF;     premsg[7] = index &amp; 0xFF;     premsg[8] = (AsciiChar &gt;&gt; 8) &amp; 0xFF;     premsg[9] = AsciiChar &amp; 0xFF;     Flash_WaitBusy();     SpiFlash_WriteUFifo(10, premsg); }  \/\/ \u0412\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 uint16_t varShow = 0x3031;              \/\/ ASCII: 01 SpiFlash_LookUpTable(0x0, varShow);     \/\/ \u0412\u044b\u0431\u0440\u0430\u0442\u044c 0-\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b varShow++;                              \/\/ Increment-&gt; ASCII: 02 SpiFlash_TxString(&quot;IncrementVar\\n\\0&quot;); SpiFlash_LookUpTable(0x0, varShow); SpiFlash_TxString(&quot;Reg2:\\n\\0&quot;); SpiFlash_LookUpTable(0x1, 0x3535);      \/\/ \u0412\u044b\u0431\u0440\u0430\u0442\u044c 1-\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (ASCII: 55) SpiFlash_TxString(&quot;LookUpDone\\n\\0&quot;);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435 \u043c\u044b \u0432\u044b\u0432\u0435\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>varShow<\/code>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043a \u043d\u0435\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u044c. \u041d\u0430 \u043d\u0430\u0448 \u0432\u0437\u0433\u043b\u044f\u0434, \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0440\u0435\u0436\u0438\u043c\u0443 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 HEX-\u0440\u0435\u0436\u0438\u043c\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ii\/r-\/v-\/iir-v-rcng9ccatxjgigml2cqqw.png\"><\/div>\n<p>  <\/p>\n<h3 id=\"rezhim-timestamp\">\u0420\u0435\u0436\u0438\u043c Timestamp<\/h3>\n<p>  <\/p>\n<p>\u0411\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u0438 \u0437\u0430\u043c\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u043b\u043e\u043a\u0430 \u043a\u043e\u0434\u0430. \u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0432 \u043f\u043e\u0440\u0442\u0444\u043e\u043b\u0438\u043e \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c Timestamp, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u043a. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0436\u0438\u043c, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043d\u0430 \u041c\u041a \u0442\u0430\u0439\u043c\u0435\u0440. \u0415\u0441\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430 1 \u043a\u0430\u0436\u0434\u044b\u0435 10 \u043d\u0441, \u0442\u043e \u0442\u043e\u0433\u0434\u0430 GUI \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0435. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0432 \u0431\u0443\u0444\u0435\u0440\u0435 uFIFO time stamp.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u0442\u043a\u0438  void SpiFlash_TxTimeStamp(int timeValue) {        char premsg[] = {0x40, 0x44, 0x36, 0x47, 0x06, 0x04};        Flash_WaitBusy();     SpiFlash_WriteUFifo(sizeof(premsg), premsg);      unsigned char timeBuffer[4];     timeBuffer[0] = (timeValue &gt;&gt; 24) &amp; 0xFF;     timeBuffer[1] = (timeValue &gt;&gt; 16) &amp; 0xFF;     timeBuffer[2] = (timeValue &gt;&gt; 8) &amp; 0xFF;     timeBuffer[3] = timeValue &amp; 0xFF;     SpiFlash_WriteUFifo(sizeof(timeBuffer), timeBuffer); }  \/\/ \u0412\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 SpiFlash_TxTimeStamp(100000000);    \/\/ 100000000 * 10 \u043d\u0441 = 1 \u0441\u0435\u043a<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>SpiFlash_TxTimeStamp<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 100000000 \u043e\u0442\u0441\u0447\u0435\u0442\u043e\u0432, \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u043d\u0430 10 \u043d\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c 1 \u0441\u0435\u043a. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043c\u0435\u0442\u043a\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0435.<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0n\/9v\/wv\/0n9vwvgzhse-n9gecefwqlozjps.png\"><\/div>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0438\u043e\u0434 10 \u043d\u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0435 100000000 \u0413\u0446 = 100\u041c\u0413\u0446, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0430\u0448\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0430\u0448\u0438\u043c\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"podvodya-itog\">\u041f\u043e\u0434\u0432\u043e\u0434\u044f \u0438\u0442\u043e\u0433<\/h3>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0445 \u0432\u0441\u0435\u043c UART \u0438\u043b\u0438 JTAG. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043c\u0435\u044e\u0442 \u043d\u0430 \u0431\u043e\u0440\u0442\u0443 SPI-\u0444\u043b\u0435\u0448\u043a\u0443 \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u0441\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 (~600$) \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e &quot;\u043a\u0443\u0441\u0430\u0447\u0435\u0439&quot; \u0434\u043b\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \ud83d\ude42<\/p>\n<p>  <\/p>\n<p>\u0410 \u043a\u0430\u043a\u043e\u0439 \u0441\u0430\u043c\u044b\u0439 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432\u044b? \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0435\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u0438 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pa\/o4\/_r\/pao4_rwvkk66sphjyem63ulvtey.png\"><\/div>\n<\/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\/company\/ntc-vulkan\/blog\/515906\/\"> https:\/\/habr.com\/ru\/company\/ntc-vulkan\/blog\/515906\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/ntc-vulkan\/blog\/515906\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ab\/ng\/ri\/abngribz3iwleiggqt7zs2yp1gg.jpeg\">   <\/p>\n<p>\u0417\u0430\u0447\u0435\u043c?!<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u044d\u043c\u043e\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043b\u044e\u0434\u0435\u0439, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0432\u0448\u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e: \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u044b \u0434\u043e\u0445\u043e\u0434\u0438\u0442\u0435 \u0434\u043e \u0442\u043e\u0447\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u0434, \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 UART \u0437\u0430\u0432\u0435\u0442\u043d\u043e\u0435 &quot;Hello, Habr!&quot;, \u043f\u043e\u043c\u0438\u0433\u0430\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u043a\u0430\u043a \u043d\u0430 \u043d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0435\u0439 \u0451\u043b\u043a\u0435 \u0438\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c JTAG, \u043d\u043e \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0432 \u0432\u0430\u0448\u0435\u043c \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 SPI-\u0444\u043b\u0435\u0448\u0435\u043a.<\/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-308747","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308747","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=308747"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308747\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}