{"id":367837,"date":"2024-05-21T03:29:34","date_gmt":"2024-05-21T03:29:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=367837"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T03:29:34","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=367837","title":{"rendered":"<span>\u0414\u043d\u0435\u0432\u043d\u0438\u043a \u0430\u043b\u044c\u0442\u0440\u0443\u0438\u0441\u0442\u0430. dfu-util<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<details class=\"spoiler\">\n<summary>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 dfu-util \u0438 \u0437\u0430\u0447\u0435\u043c \u0431\u0443\u0434\u0438\u0442\u044c \u044d\u0442\u043e \u043b\u0438\u0445\u043e?<\/summary>\n<div class=\"spoiler__content\">\n<h2>\u0427\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u0433\u0434\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c?<\/h2>\n<blockquote>\n<p>\u201cDFU is intended to download and upload firmware to\/from devices connected over USB\u201d &#8212;\u00a0<a href=\"https:\/\/dfu-util.sourceforge.net\" rel=\"noopener noreferrer nofollow\">dfu-util manual page<\/a><\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/dfu-util.sourceforge.net\" rel=\"noopener noreferrer nofollow\">dfu-util<\/a> \u2014 \u044d\u0442\u043e \u0432\u00a0\u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043e\u00a0\u0447\u0435\u0308\u043c \u044f \u043d\u0435\u00a0\u043e\u0447\u0435\u043d\u044c\u2011\u0442\u043e \u0438 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0441\u044f, \u043f\u043e\u0138\u0430 \u043d\u0435\u00a0\u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u00a0\u0435\u0435\u0308 \u0138\u043e\u0434\u043e\u043c. \u041e\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0434\u043b\u044f\u00a0\u0440\u0430\u0431\u043e\u0442\u044b \u0441\u00a0\u0443\u0441\u0442\u0440\u043e\u0438\u0306\u0441\u0442\u0432\u0430\u043c\u0438, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432\u00a0DFU (Device<em> <\/em>Firmware Upgrade) \u0440\u0435\u0436\u0438\u043c\u0435, \u0442.\u00a0\u0435. \u0432\u00a0\u0440\u0435\u0436\u0438\u043c\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u00a0\u043f\u0440\u043e\u0448\u0438\u0432\u0138\u043e\u0438\u0306. \u0422\u0430\u0138\u0438\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0438\u0306\u0441\u0442\u0432\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0432\u0441\u0435\u0308 \u043e\u0442\u00a0\u043c\u0438\u0138\u0440\u043e\u0138\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0434\u043e\u00a0\u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u043e\u0432, \u0430\u00a0\u0441\u0430\u043c\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0446\u0435\u043b\u044f\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0432\u044b\u0433\u0440\u0443\u0437\u0138\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0138\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u0138\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u0411\u044b\u0442\u043e\u0432\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 DFU \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e,\u00a0\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0436\u0438\u0437\u043d\u0438,\u00a0\u0138\u043e\u0442\u043e\u0440\u044b\u0438\u0306 \u0441\u043e \u043c\u043d\u043e\u0438\u0306 \u0441\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0431\u0443\u0138\u0432\u0430\u043b\u044c\u043d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>\u0420\u0435\u0448\u0438\u043b \u044f \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0438\u0306 \u0430\u0438\u0306\u0444\u043e\u043d \u0138 \u0437\u0430\u0432\u043e\u0434\u0441\u0138\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u043f\u0440\u043e\u0448\u0438\u0432\u0138\u0438.\u00a0\u0418 \u0432\u043e\u0442,\u00a0\u0447\u0442\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0438 \u043e\u0434\u0438\u043d \u0430\u0434\u0435\u0138\u0432\u0430\u0442\u043d\u044b\u0438\u0306 \u0447\u0435\u043b\u043e\u0432\u0435\u0138\u00a0&#8212;\u00a0\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u0431\u0430\u043b\u0434\u044b \u0438 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 2 \u043d\u0430\u043d\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043f\u043e\u0441\u043b\u0435 \u0432\u0432\u043e\u0434\u0430.<\/p>\n<p>\u0414\u0430,\u00a0\u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u044f \u0438 \u0441\u0434\u0435\u043b\u0430\u043b.\u00a0\u0423\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c\u00a0Apple ID\u00a0\u0435\u0449\u0435 \u043d\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0438\u0306\u0441\u0442\u0432\u0435,\u00a0\u0442\u0430\u0138 \u0447\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0435\u0308 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435\u043b\u044c\u0437\u044f.\u00a0\u041f\u043e\u0441\u043b\u0435 \u0446\u0435\u043b\u043e\u0433\u043e \u0434\u043d\u044f \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u044f \u0437\u0430\u0431\u043b\u043e\u0138\u0438\u0440\u043e\u0432\u0430\u043b \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043d\u0430 \u0434\u0435\u043d\u044c.\u00a0\u041d\u0430\u0447\u0430\u043b \u0440\u044b\u0441\u0138\u0430\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435,\u00a0\u0138\u0430\u0138 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c.\u00a0\u0412\u0443\u0430\u043b\u044f! \u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u0432\u00a0DFU\u00a0\u0440\u0435\u0436\u0438\u043c,\u00a0\u043f\u043e\u0434\u0138\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0138\u00a0macbook-\u0443 (\u043b\u0438\u0431\u043e Windows iTunes) \u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0448\u0438\u0432\u0138\u0443 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e.\u00a0\u041c\u043e\u0435\u0438\u0306 \u0440\u0430\u0434\u043e\u0441\u0442\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430.\u00a0\u0414\u0435\u043b\u043e\u0432 \u043d\u0430\u00a015\u00a0\u043c\u0438\u043d\u0443\u0442 \u0438 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u0433\u043e\u0442\u043e\u0432 \u0138 \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 DFU \u0440\u0435\u0436\u0438\u043c\u043e\u043c. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430, \u043c\u0438\u043a\u0440\u043e\u0432\u043e\u043b\u043d\u043e\u0432\u043e\u043a, \u043b\u0430\u043f\u0442\u043e\u043f\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 DFU.<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0442\u0435\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u043e dfu-util \u0432 2007-\u043c \u0433\u043e\u0434\u0443:<\/p>\n<blockquote>\n<p>\u201cinitial (unfinished) version of new DFU utility (dfu\u2011programmer just sucks as something generic, device independent)\u201d\u00a0\u2014 Harald Welte \u0432 \u0441\u0432\u043e\u0451\u043c <a href=\"https:\/\/gitlab.com\/dfu-util\/dfu-util\/-\/commit\/0a689cae5e048e4dbb3a27602a58052b52637aeb\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u043e\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u0435<\/a>. <\/p>\n<\/blockquote>\n<p>\u042d\u0442\u043e \u0436 \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/dfu-programmer.github.io\" rel=\"noopener noreferrer nofollow\">dfu-programmer<\/a> \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0447\u0443\u0432\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u043b \u0446\u0435\u043b\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u0430 \u0438 \u0442\u0430\u043a\u043e\u0439, \u0447\u0442\u043e \u0438\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0442\u043d\u0438 \u0442\u044b\u0441\u044f\u0447 \u043b\u044e\u0434\u0435\u0439 \u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0443 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0439. <\/p>\n<h2>\u0411\u0443\u0434\u0438\u0442\u044c \u043b\u0438\u0445\u043e \u0438\u043b\u0438 \u043e\u043d\u043e \u0438 \u0442\u0430\u043a \u0433\u0443\u043b\u044f\u0435\u0442 \u043f\u043e \u043c\u0438\u0440\u0443?<\/h2>\n<p>dfu-util \u043d\u0435 \u0448\u0438\u0431\u043a\u043e-\u0442\u043e \u0437\u0430\u0441\u044b\u043f\u0430\u043b\u0430. \u0415\u0451 \u043f\u043e \u0441\u0435\u0439 \u0434\u0435\u043d\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0433\u0438\u0433\u0430\u043d\u0442\u0438\u0437\u043c\u0430 \u043e\u0442 <a href=\"https:\/\/www.blackmagicdesign.com\" rel=\"noopener noreferrer nofollow\">BlackMagic design<\/a> (dfu-\u0448\u0435\u0447\u043a\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0438\u0445 <a href=\"https:\/\/black-magic.org\/upgrade.html\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0444. \u0433\u0430\u0439\u0434\u0430\u0445<\/a>) \u0438 <a href=\"https:\/\/www.st.com\/content\/st_com\/en.html\" rel=\"noopener noreferrer nofollow\">STM32<\/a> (dfu-util \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <a href=\"https:\/\/wiki.st.com\/stm32mpu\/wiki\/How_to_load_U-Boot_with_dfu-util\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u0434\u0430<\/a>) \u0434\u043e \u043a\u0430\u043a\u0438\u0445-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0442\u0430\u0440\u0442\u0430\u043f\u043e\u0432. <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438. \u041f\u0435\u0440\u0435\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u044b\u0431\u043e\u0440, \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e API \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0432 DFU \u0440\u0435\u0436\u0438\u043c\u0435 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0437\u044f\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e. \u0412\u044b\u0431\u043e\u0440 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d. <\/p>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443 \u0443\u043f\u043e\u043c\u044f\u043d\u0443, \u0447\u0442\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 USB \u043f\u043e\u0440\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/libusb.info\" rel=\"noopener noreferrer nofollow\">LibUsb<\/a>, \u0430 dfu-util \u043a\u0430\u043a \u0440\u0430\u0437 \u0435\u0451 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442. <\/p>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 DFU \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c, \u0430 dfu-util \u043e\u0431\u044b\u0447\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u043d\u0430\u0440\u0435\u0439, \u0430 \u043d\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041e\u0442\u0441\u044e\u0434\u0430 \u0438 \u043f\u043e\u0448\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443 \u0434\u043b\u044f C++ &amp; CMake, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<h2>\u041f\u043b\u0430\u043d\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/h2>\n<ul>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b dfu-util \u043a\u0430\u043a \u0441\u0430\u0431\u043c\u043e\u0434\u0443\u043b\u044f\/\u0441\u0430\u0431\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0421++ \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u0434 CMake \u0441\u0431\u043e\u0440\u043a\u043e\u0439. CMakeList-\u044b \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u0430\u043a \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0441\u0432\u043e\u0438\u0445 \u043d\u0430\u0432\u044b\u043a\u043e\u0432, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u0435\u0435 \u0451\u043c\u043a\u043e\u0439 \u0438 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/module\/ExternalProject.html\" rel=\"noopener noreferrer nofollow\">ExternalProject<\/a>, <a href=\"https:\/\/github.com\/cpm-cmake\/CPM.cmake\" rel=\"noopener noreferrer nofollow\">CPM<\/a> \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0437\u0434\u0435\u0441\u044c \u0432\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435;<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u0430\u043a \u043d\u0430 macOS, \u0442\u0430\u043a \u0438 \u043d\u0430 Windows. \u0412\u0435\u043a \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0434\u0432\u043e\u0440\u0435 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b dfu-util \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c CMake;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0441\u0430-\u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0438 \u043d\u0430 \u0421++ \u0434\u043b\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f dfu-util.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f macOS. \u0412\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043b\u0430\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 macOS \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 \u043a\u043e\u043d\u0435\u0446 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u043f\u043e\u0434 Windows.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b <a href=\"https:\/\/dfu-util.sourceforge.net\/build.html\" rel=\"noopener noreferrer nofollow\">\u0433\u0430\u0439\u0434<\/a> \u043e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 dfu-util. Autoconf, autoheader&#8230; \u044d\u0442\u043e \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0432\u043e\u043e\u0431\u0449\u0435&#8230; \u041b\u0430\u0434\u043d\u043e, \u0441\u0442\u0430\u0432\u0438\u043c \u043b\u044e\u0431\u0438\u043c\u043e\u0439 <a href=\"https:\/\/brew.sh\" rel=\"noopener noreferrer nofollow\">brew<\/a>-\u0448\u043a\u043e\u0439  <\/p>\n<pre><code class=\"bash\">brew install make cmake pkg-config libusb autoconf autoheader<\/code><\/pre>\n<p>\u041d\u0430\u0434\u043e \u0431\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0430\u0434 \u0434\u0440\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0430\u0434\u043e \u043d\u0435\u0434\u043e\u043b\u0433\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<pre><code>WorDfuUtil |--- include |    |--- pch.hpp |    ... |--- src |    |--- main.cpp |    ... |--- ThirdParty |    |--- dfu-util (submodule) |         |--- ... |    |--- DfuUtilConfiguring.cmake |    |--- CMakeLists.txt |--- CMakeLists.txt<\/code><\/pre>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h2>\n<p>\u0422\u043e\u043f\u043e\u0432\u044b\u0439 CMakeLists.txt \u043c\u043d\u0435 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0439\u0434\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0432 <code>ThirdParty\/CMakeLists.txt<\/code>. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0442\u0430\u0440\u0433\u0435\u0442\u044b <code>dfu-util<\/code> \u0438 <code>dfu-util_exe<\/code>.<\/p>\n<pre><code class=\"cmake\"># WorDfuUtil\/ThirdParty\/CMakeLists.txt  cmake_minimum_required(VERSION 3.23)  # ---------- # #   libusb   # # ---------- # find_path(LibusbIncludeDir         NAMES libusb.h         PATH_SUFFIXES \"include\" \"libusb\" \"libusb-1.0\") find_library(LibusbLib         NAMES libusb-1.0.dylib         PATH_SUFFIXES \"lib\")  add_library(libusb INTERFACE) target_link_libraries(libusb         INTERFACE ${LibusbLib}) target_include_directories(libusb         INTERFACE ${LibusbIncludeDir})  # ------------ # #   dfu-util   # # ------------ # project(dfu-util         LANGUAGES C)  set(DfuUtilRoot ${CMAKE_CURRENT_SOURCE_DIR}\/dfu-util) set(DfuUtilSourceDir ${DfuUtilRoot}\/src)  add_library(dfu-util)  set(Sources          ${DfuUtilSourceDir}\/dfu_load.c         ${DfuUtilSourceDir}\/dfu_util.c         ${DfuUtilSourceDir}\/dfuse.c         ${DfuUtilSourceDir}\/dfuse_mem.c         ${DfuUtilSourceDir}\/dfu.c         ${DfuUtilSourceDir}\/dfu_file.c         ${DfuUtilSourceDir}\/quirks.c) target_sources(dfu-util         PRIVATE ${Sources}) source_group(\"dfu-util_sources\"         FILES ${Sources})  target_include_directories(dfu-util         PUBLIC         ${DfuUtilRoot}\/src         ${DfuUtilRoot})  target_link_libraries(dfu-util         PUBLIC libusb)  # ---------------- # #   dfu-util_exe   # # ---------------- # add_executable(dfu-util_exe)  target_sources(dfu-util_exe         PRIVATE         ${Sources}         ${DfuUtilSourceDir}\/main.c)  target_include_directories(dfu-util_exe         PUBLIC         ${DfuUtilRoot}\/src         ${DfuUtilRoot})  target_link_libraries(dfu-util_exe         PUBLIC libusb)<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432\u043c\u0435\u0441\u0442\u043e <code>file({GLOB | GLOB_RECURSE} ...)<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u0432 <code>main.cpp<\/code> \u043d\u0430\u0441 \u0436\u0434\u0451\u0442 \u0441\u044e\u0440\u043f\u0440\u0438\u0437, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0437\u0436\u0435. \u0412\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438 \u0442\u0430\u043a \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u0430\u0436\u0435 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/command\/file.html#filesystem\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f<\/a> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 CMake. \u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u0440\u0443\u0447\u043a\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c CMake \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u0441\u0447\u0430\u0441\u0442\u044c\u0435, \u041d\u041e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043e\u0442\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u043e \u0434\u0430 &#8212; \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0438\u0445 \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u0438 \u0442.\u043f. <\/p>\n<p>\u0420\u0435\u043c\u0430\u0440\u043a\u0430 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0432\u0441\u0435\u043c\u043e\u0433\u0443\u0449\u0435\u0439 LibUsb. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0435\u0451 \u0447\u0435\u0440\u0435\u0437 <code>find_package(PkgConfig REQUIRED)<\/code> + <code>pkg_check_module(libusb REQUIRED libusb-1.0)<\/code>, \u043d\u043e \u044f \u043d\u0435 \u043f\u0440\u0438\u0432\u044b\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/www.freedesktop.org\/wiki\/Software\/pkg-config\/\" rel=\"noopener noreferrer nofollow\">pkg_config<\/a>, \u0442.\u043a. \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u0435\u043d\u044c\u043a\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0434\u0430 \u0438 \u0435\u0451 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0442 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0430\u0445. <\/p>\n<p>Dfu-util \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Makefile, \u043d\u043e \u044f, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f, \u043d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u0441 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u043c\u043e\u0433\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043b\u043e\u0432\u0438\u0442\u044c \u0441\u0443\u0442\u044c. \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043b\u044e\u0441-\u043c\u0438\u043d\u0443\u0441 \u0441\u043e\u0431\u043b\u044e\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438, \u0441\u043e\u0431\u0440\u0430\u043b \u043a\u0443\u0440\u0441\u044b, \u043b\u0438\u043d\u043a\u0430\u043d\u0443\u043b LibUsb \u0438 \u0441 \u043f\u0440\u0435\u0434\u0432\u043a\u0443\u0448\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0436\u0430\u043b \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0443. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dde\/087\/35e\/dde08735e204b5660596cadbc4501ff5.png\" alt=\"\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043f\u043e\u0439\u043c\u0430\u043d \u043b\u043e\u0434\u044b\u0436\u043a\u043e\u0439\" title=\"\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043f\u043e\u0439\u043c\u0430\u043d \u043b\u043e\u0434\u044b\u0436\u043a\u043e\u0439\" width=\"3534\" height=\"2076\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dde\/087\/35e\/dde08735e204b5660596cadbc4501ff5.png\"\/><\/p>\n<div><figcaption>\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043f\u043e\u0439\u043c\u0430\u043d \u043b\u043e\u0434\u044b\u0436\u043a\u043e\u0439<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e \u043c\u0435\u0440\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f, \u043e\u0442\u043a\u0443\u0434\u0430 \u0437\u0432\u0443\u043a\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430, \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e dfu-util-\u0449\u0438\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u044f\u0442 <code>config.h<\/code> \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u0444\u0430\u0439\u043d\u0438\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0442.\u043a. \u043f\u043e \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b.<\/p>\n<pre><code class=\"cpp\">\/**  * ThirdParty\/dfu-util\/config.h.in  *\/  \/* config.h.in.  Generated from configure.ac by autoheader.  *\/  \/* Define to 1 if you have the 'err' function. *\/ #undef HAVE_ERR  \/* Define to 1 if you have the &lt;inttypes.h> header file. *\/ #undef HAVE_INTTYPES_H  \/* Define to 1 if you have the 'usb' library (-lusb). *\/ #undef HAVE_LIBUSB  \/* Define to 1 if you have the 'nanosleep' function. *\/ #undef HAVE_NANOSLEEP  \/* Define to 1 if you have the &lt;stdint.h> header file. *\/ #undef HAVE_STDINT_H  \/* Define to 1 if you have the &lt;stdio.h> header file. *\/ #undef HAVE_STDIO_H  \/* ... *\/<\/code><\/pre>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"cpp\">\/**  * ThirdParty\/dfu-util\/config.h  *\/  \/* config.h.  Generated from config.h.in by configure.  *\/ \/* config.h.in.  Generated from configure.ac by autoheader.  *\/  \/* Define to 1 if you have the 'err' function. *\/ #define HAVE_ERR 1  \/* Define to 1 if you have the &lt;inttypes.h> header file. *\/ #define HAVE_INTTYPES_H 1  \/* Define to 1 if you have the 'usb' library (-lusb). *\/ \/* #undef HAVE_LIBUSB *\/  \/* Define to 1 if you have the 'nanosleep' function. *\/ #define HAVE_NANOSLEEP 1  \/* Define to 1 if you have the &lt;stdint.h> header file. *\/ #define HAVE_STDINT_H 1  \/* Define to 1 if you have the &lt;stdio.h> header file. *\/ #define HAVE_STDIO_H 1  \/* ... *\/<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0431\u0438\u043b\u0434\u0430 dfu-util \u043d\u0443\u0436\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u043e \u043a\u0442\u043e \u044f \u0442\u0430\u043a\u043e\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0438\u0432\u0438\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u0432\u0438 \u043a CMake, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0432\u044b\u043a\u0438\u043d\u0443 \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <code>DfuUtilConfiguring.cmake<\/code> \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"cmake\"># WorDfuUtil\/ThirdParty\/DfuUtilConfiguring.cmake  cmake_minimum_required(VERSION 3.23)  add_custom_target(dfu-util_autogen         COMMAND .\/autogen.sh         COMMENT \"Creating dfu-util configuration file...\"         WORKING_DIRECTORY ${DfuUtilRoot})  add_custom_target(dfu-util_configure         COMMAND .\/configure         DEPENDS dfu-util_autogen         COMMENT \"Configuring dfu-utils for current OS. Generating makefiles...\"         WORKING_DIRECTORY ${DfuUtilRoot})  add_custom_target(dfu-util_build         COMMAND make         DEPENDS dfu-util_configure         COMMENT \"Running make for dfu-utils project...\"         WORKING_DIRECTORY ${DfuUtilRoot})<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0432\u043a\u0443\u0448\u0430\u044e \u0432\u043e\u043f\u0440\u043e\u0441, \u0437\u0430\u0447\u0435\u043c \u043c\u043d\u0435 \u0431\u0438\u043b\u0434\u0438\u0442\u044c \u044d\u0442\u043e Make-\u043e\u043c, \u0435\u0441\u043b\u0438 \u044f \u0438 \u0442\u0430\u043a \u0441\u043e\u0431\u0438\u0440\u0430\u044e \u0432 CMake \u0446\u0435\u043b\u044c <code>dfu-util_exe<\/code>. \u041d\u0435 \u0437\u043d\u0430\u044e, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f. \u041f\u0443\u0441\u0442\u044c \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0443\u0442 \u0438 \u043d\u0435 \u043e\u0442\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e.<br \/>\u041f\u0440\u043e\u0431\u0443\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <code>configure<\/code> \u0438 \u0432\u0441\u0451 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/259\/54b\/ded\/25954bded38af707d420c07b869e4f27.png\" alt=\"\u041b\u043e\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430 dfu-util_configure\" title=\"\u041b\u043e\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430 dfu-util_configure\" width=\"1084\" height=\"546\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/259\/54b\/ded\/25954bded38af707d420c07b869e4f27.png\"\/><\/p>\n<div><figcaption>\u041b\u043e\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430 <code>dfu-util_configure<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u0411\u0438\u043b\u0434 <code>dfu-util<\/code> \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0432\u0435\u043b \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u0438\u043a\u043e\u0432. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0435\u0441\u0442\u044c \u0441\u043b\u0443\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">#ifdef HAVE_CONFIG_H # include \"config.h\" #endif<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c <code>-DHAVE_CONFIG_H<\/code> \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u0432 <code>dfu*.cpp<\/code> \u0444\u0430\u0439\u043b\u0430\u0445 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u0438\u043a\u0430. \u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0448\u0435\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0446\u0435\u043b\u044c \u0438\u043c\u0435\u043b\u0430 \u0442\u043e\u0442 \u0436\u0435 \u0434\u0435\u0444\u0430\u0439\u043d.<\/p>\n<pre><code class=\"cmake\"># ThirdParty\/CMakeLists.txt # ... add_library(dfu-util)  target_compile_definitions(dfu-util         PUBLIC -DHAVE_CONFIG_H) # ...  # ThirdParty\/CMakeLists.txt # ... add_executable(dfu-util_exe)  target_compile_definitions(dfu-util_exe         PUBLIC -DHAVE_CONFIG_H) # ...<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0441\u043d\u043e\u0432\u0430 \u0442\u0430\u0440\u0433\u0435\u0442 <code>dfu-util<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/78a\/13f\/ed0\/78a13fed071f30ade0478bf084e8c6f6.png\" alt=\"\u041b\u043e\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430 dfu-util\" title=\"\u041b\u043e\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430 dfu-util\" width=\"1122\" height=\"218\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/78a\/13f\/ed0\/78a13fed071f30ade0478bf084e8c6f6.png\"\/><\/p>\n<div><figcaption>\u041b\u043e\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430 <code>dfu-util<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a CMakeList-\u0443 \u0434\u043b\u044f <code>WorDfuUtil<\/code>:<\/p>\n<pre><code class=\"cmake\"># CMakeLists.txt  cmake_minimun_required(VERSION 3.23)  project(WorDfuUtil         LANGUAGES C)  add_subdirectory(ThirdParty)  # -------------- # #   WorDfuUtil   # # -------------- # add_executable(WorDfuUtil)  file(GLOB Sources src\/*.cpp) target_sources(WorDfuUtil         PRIVATE ${Sources})  target_compile_features(WorDfuUtil         PRIVATE cxx_std_17)  target_include_directories(WorDfuUtil         PUBLIC include)  target_link_libraries(WorDfuUtil          PRIVATE dfu-util)<\/code><\/pre>\n<p>\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u043e\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0441\u0431\u043e\u0440\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0439.<\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044e \u043f\u0440\u043e pch \u0444\u0430\u0439\u043b. \u0423\u0434\u043e\u0431\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u044d\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u0414\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0443 \u043c\u0435\u043d\u044f \u044d\u0442\u0438 <code>dfu*.h<\/code> \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u043a\u0438\u043d\u0443 \u0438\u0445 \u0432 \u043f\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e. <\/p>\n<pre><code class=\"cpp\">\/**  * include\/pch.hpp  *\/  #pragma once  #include \"libusb.h\"  extern \"C\" {  #ifdef HAVE_CONFIG_H #include \"config.h\" #endif  #include \"portable.h\" #include \"dfu.h\" #include \"dfu_file.h\" #include \"dfu_load.h\" #include \"dfu_util.h\" #include \"dfuse.h\" }  #include \"DfuUtilVariables.hpp\"<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0435\u0449\u0435 \u043c\u043e\u043c\u0435\u043d\u0442. \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 <code>ThirdParty\/dfu-util\/config.h<\/code> \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u043e CMake \u043f\u0430\u0434\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e <code>config.h<\/code> \u0443\u043a\u0430\u0437\u0430\u043d \u0432 pch \u0444\u0430\u0439\u043b\u0435. \u0414\u043e\u0431\u0430\u0432\u043b\u044e \u0435\u0449\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u044b \u0431\u044b\u043b\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f dfu-util \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<pre><code class=\"cmake\"># ThirdParty\/DfuUtilConfiguring.cmake # ... add_custom_target(dfu-util_build         COMMAND make         DEPENDS dfu-util_configure         COMMENT \"Running make for dfu-utils project...\"         WORKING_DIRECTORY ${DfuUtilRoot})  if(NOT EXIST ${DfuUtilRoot}\/config.h)     message(WARNING \"Cannot find dfu-util's config file.  Configure dfu-util first.     Run build dfu-util_configure target.\")     return() else ()     set(HaveConfig ON PARENT_SCOPE) endif() # ...  # CMakeLists.txt # ... add_subdirectory(ThirdParty)  if(NOT ${HaveConfig})     return() endif() # ...  # CMakeLists.txt # ... target_compile_features(WorDfuUtil         PRIVATE cxx_std_17)  target_precompile_headers(WorDfuUtil         PRIVATE include\/pch.h) # ...<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b <code>main.cpp<\/code> \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430 <code>WorDfuUtil<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u043b \u0432\u044b\u0437\u043e\u0432\u044b \u043f\u0430\u0440\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. <\/p>\n<pre><code class=\"cpp\">\/**  * src\/main.cpp  *\/  #include &lt;cstdio>  #include \"libusb.h\"  #include \"pch.hpp\"  int main() {     libusb_context *ctx;     const int ec = libusb_init(&amp;ctx);     if (ec &lt; 0) {         std::printf(\"LibUsb if ducked up.\\n\");         return -1;     }     probe_devices(ctx);     if (dfu_root == nullptr) {         std::printf(\"dfu-util is ducked up.\\n\");         return -2;     }     return 0; }<\/code><\/pre>\n<p>\u041d\u0430 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b27\/50b\/302\/b2750b3020bca3c062b7b6e42d54655b.png\" alt=\"\u041f\u0443\u043b\u044f \u043e\u0442 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430 \u0443\u0436\u0435 \u043b\u0435\u0442\u0438\u0442 \u0432 \u043a\u043e\u043b\u0435\u043d\u043d\u0443\u044e \u0447\u0430\u0448\u0435\u0447\u043a\u0443\" title=\"\u041f\u0443\u043b\u044f \u043e\u0442 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430 \u0443\u0436\u0435 \u043b\u0435\u0442\u0438\u0442 \u0432 \u043a\u043e\u043b\u0435\u043d\u043d\u0443\u044e \u0447\u0430\u0448\u0435\u0447\u043a\u0443\" width=\"1654\" height=\"1892\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b27\/50b\/302\/b2750b3020bca3c062b7b6e42d54655b.png\"\/><\/p>\n<div><figcaption>\u041f\u0443\u043b\u044f \u043e\u0442 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430 \u0443\u0436\u0435 \u043b\u0435\u0442\u0438\u0442 \u0432 \u043a\u043e\u043b\u0435\u043d\u043d\u0443\u044e \u0447\u0430\u0448\u0435\u0447\u043a\u0443<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b&#8230; \u041f\u043e\u0448\u0435\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/03b\/f4d\/c6d\/03bf4dc6d3b6a6d4e064f5141318d14c.png\" alt=\"\u041a\u043e\u043b\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0448\u0435\u0447\u043a\u0430 \u0440\u0430\u0437\u0434\u0440\u043e\u0431\u043b\u0435\u043d\u0430 \u0432\u0442\u043e\u0440\u044b\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u043c\" title=\"\u041a\u043e\u043b\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0448\u0435\u0447\u043a\u0430 \u0440\u0430\u0437\u0434\u0440\u043e\u0431\u043b\u0435\u043d\u0430 \u0432\u0442\u043e\u0440\u044b\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u043c\" width=\"2252\" height=\"1694\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/03b\/f4d\/c6d\/03bf4dc6d3b6a6d4e064f5141318d14c.png\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043b\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0448\u0435\u0447\u043a\u0430 \u0440\u0430\u0437\u0434\u0440\u043e\u0431\u043b\u0435\u043d\u0430 \u0432\u0442\u043e\u0440\u044b\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u043c<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0435\u0437 \u0441\u0430\u0440\u043a\u0430\u0437\u043c\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0434\u0430\u0436\u0435 \u0438 \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0431\u044b\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0434\u0438\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 <code>ThirdParty\/dfu-util\/src\/main.cpp<\/code>. \u041c\u043d\u0435 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u0441\u043e\u0437\u0440\u0435\u043b \u0447\u0443\u0434\u0435\u0441\u043d\u044b\u0439 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u043b\u0430\u043d. \u042f \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044e \u0444\u043e\u0442\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u043b\u0438\u0446\u0430 \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fee\/586\/4fe\/fee5864fe75fbfc0e689719fa696ab5a.png\" alt=\"\u041c\u043e\u0451 \u043b\u0438\u0446\u043e, \u043a\u043e\u0433\u0434\u0430 \u0443\u0432\u0438\u0434\u0435\u043b \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0443\u0440c\u0430\u0445 extern\" title=\"\u041c\u043e\u0451 \u043b\u0438\u0446\u043e, \u043a\u043e\u0433\u0434\u0430 \u0443\u0432\u0438\u0434\u0435\u043b \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0443\u0440c\u0430\u0445 extern\" width=\"1648\" height=\"1598\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fee\/586\/4fe\/fee5864fe75fbfc0e689719fa696ab5a.png\"\/><\/p>\n<div><figcaption>\u041c\u043e\u0451 \u043b\u0438\u0446\u043e, \u043a\u043e\u0433\u0434\u0430 \u0443\u0432\u0438\u0434\u0435\u043b \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0443\u0440c\u0430\u0445 <code>extern<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0435\u0432\u0435\u043b\u0438\u043a\u0430 \u043f\u043e\u0442\u0435\u0440\u044f. \u0414\u0435\u0439\u0441\u0442\u0432\u0443\u044e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e &#8212; \u043a\u0430\u043a \u0431\u0430\u0440\u0430\u043d, \u0443\u0432\u0438\u0434\u0435\u0432\u0448\u0438\u0439 \u0445\u043b\u0438\u043f\u043a\u0443\u044e \u0434\u043e\u0441\u043a\u0443 \u0437\u0430\u0431\u043e\u0440\u0430.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u044e \u0444\u0430\u0439\u043b\u044b <code>ThirdParty\/DfuUtilVariables.hpp<\/code> \u0438 <code>ThirdParty\/DfuUtilVariables.cpp<\/code> \u0441 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044e \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c cpp-\u0448\u043d\u0438\u043a \u0432 CMake \u0442\u0430\u0440\u0433\u0435\u0442 <code>dfu-util<\/code>.<\/p>\n<pre><code class=\"cpp\">\/**  * ThirdParty\/DfuUtilVariables.hpp  *\/  #pragma once  extern int verbose; extern struct dfu_if *dfu_root; extern char *match_path; extern int match_vendor; extern int match_product; extern int match_vendor_dfu; extern int match_product_dfu; extern int match_config_index; extern int match_iface_index; extern int match_iface_alt_index; extern int match_devnum; extern const char *match_iface_alt_name; extern const char *match_serial; extern const char *match_serial_dfu;  \/**  * ThirdParty\/DfuUtilVariables.cpp  *\/  #include \"DfuUtilVariables.hpp\"  #include &lt;cstddef>  int verbose = 0; struct dfu_if *dfu_root = nullptr; char *match_path = nullptr; int match_vendor = -1; int match_product = -1; int match_vendor_dfu = -1; int match_product_dfu = -1; int match_config_index = -1; int match_iface_index = -1; int match_iface_alt_index = -1; int match_devnum = -1; const char *match_iface_alt_name = nullptr; const char *match_serial = nullptr; const char *match_serial_dfu = nullptr;<\/code><\/pre>\n<p>\u0417\u0430\u0432\u0435\u0442\u043d\u044b\u0435 \u0444\u0440\u0430\u0437\u044b \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b. \u041d\u0440\u0430\u0432\u0438\u0442\u0441\u044f. <\/p>\n<blockquote>\n<p><code>[12\/12] Linking CXX executable WorDfuUtil<\/code> <\/p>\n<p><code>Build finished<\/code><\/p>\n<\/blockquote>\n<blockquote>\n<p><code>dfu-util is ducked up.<\/code><\/p>\n<p><code>Process finished with exit code 156<br \/>(interrupted by signal 28:SIGWINCH)<\/code><\/p>\n<\/blockquote>\n<p>\u0412\u044b\u043b\u0435\u0442 \u043f\u043e <code>156<\/code>-\u043c\u0443 \u043a\u043e\u0434\u0443 \u043c\u043d\u0435 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d, \u0442.\u043a. \u044d\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f LibUsb \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0451 \u043d\u0435 \u0437\u0430\u043a\u0440\u044b\u043b\u0438.  \u041c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 dfu-util \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e. <\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0433\u043e API<\/h2>\n<p>\u041d\u0430\u0434\u043e \u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u044e\u0437\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u043f\u0438\u0448\u0443 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c. \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0414\u0443\u043c\u0430\u0435\u0442\u0441\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0434\u0438\u0441\u043a\u043e\u043c\u0444\u043e\u0440\u0442 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c:<\/p>\n<ol>\n<li>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 <code>ThirdParty\/DfuUtilVariables.hpp<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0432\u043a\u0443\u0441\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442. \u0425\u043e\u0440\u043e\u0448\u043e\u00a0\u0431\u044b \u0438\u0445 \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u00a0\u043a\u0430\u043a\u043e\u0439\u2011\u043d\u0438\u0431\u0443\u0434\u044c \u00ab\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u00bb, \u043d\u043e\u00a0\u043f\u043e\u043a\u0430 \u044d\u0442\u043e \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u00ab\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u00bb \u0438\u0437  \u0444\u0430\u0439\u043b\u0430 <code>ThirdParty\/dfu-util\/src\/main.cpp<\/code>, \u043e\u0442\u043a\u0443\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0440\u0430\u0442\u044c \u043a\u0443\u0441\u043a\u0438 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u043e \u0432 \u043d\u0451\u043c \u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b.<br \/>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0430 \u043d\u0435 \u0432\u044b\u0437\u043e\u0432\u043e\u043c <code>dfuse_parse_options(const char*)<\/code>, \u0442\u043e \u043e\u043d\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>dfuload_do_upload(...)<\/code>, \u0442.\u043a. \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043d\u044f\u0442 \u0444\u043b\u0430\u0433 <code>int dfuse_address_present<\/code>. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0433\u043e \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u043e\u0447\u043d\u044b\u0435 \u0448\u0442\u0430\u043d\u044b \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u0441 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u0435\u0439, \u043d\u043e \u044d\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043f\u043e\u0437\u0436\u0435 \u0438 \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u043e \u043d\u0430 \u0433\u0438\u0442\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u044f \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u043e \u043f\u043e\u0439\u0434\u0443 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 JavaDoc \u0432 \u043a\u043e\u0434\u0435. \u042f, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435 \u0437\u043d\u0430\u044e, \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c JavaDoc \u043a \u043a\u043e\u0434\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u0435\u0437 \u0434\u043e\u043a\u0438, \u043d\u043e \u043d\u0430 \u0433\u0438\u0442 \u0432\u044b\u043b\u043e\u0436\u0443 \u0441 \u0434\u043e\u043a\u043e\u0439. \u041f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0438 \u044f \u0432\u043d\u0435\u0441\u0443 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u044e, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 JavaDoc;<\/p>\n<\/li>\n<li>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c USB \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u044f  \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0430 \u0441\u0442\u0430\u0442\u0443\u0441 USB \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0411\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u043a\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 <code>ThirdParty\/DfuUtilVariables.hpp<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0433\u043d\u0430\u043b\u0438. <\/p>\n<pre><code class=\"cpp\">\/**  * include\/FirmwareStatus.hpp  *\/  #pragma once  #include &lt;cstdint>  namespace WorDfuUtil {      enum class FrameworkStatus             : std::uint8_t {         Deinited = 0b0,         Inited = 0b1,         DeviceOpened = 0b10,         DfuDeviceFound = 0b100,         InterfaceClaimed = 0b1000,         AltInterfaceSelected = 0b10000     }; }<\/code><\/pre>\n<pre><code class=\"cpp\">\/**  * include\/Firmware.hpp  *\/  #pragma once  #include &lt;string>  namespace WorDfuUtil {      class Firmware final {     public:         [[nodiscard]]         static bool Upload(const std::string&amp; filePath, int transferLimit, int transferSize = -1) noexcept;     }; }<\/code><\/pre>\n<pre><code class=\"cpp\">\/**  * src\/Firmware.cpp  *\/  #include \"pch.hpp\"  #include \"Firmware.hpp\" #include \"FirmwareStatus.hpp\"  #include &lt;cstdio> #include &lt;filesystem> #include &lt;fcntl.h> #include &lt;sstream>  using namespace WorDfuUtil;  namespace {      libusb_context *ctx;      std::uint8_t frameworkStatus = static_cast&lt;std::uint8_t>(FrameworkStatus::Deinited);      [[nodiscard]]     bool isDfuDeviceFound() noexcept {         std::printf(\"Cannot find DFU device.\\n\");         return ::dfu_root != nullptr;     }      [[nodiscard]]     bool checkDfuStatus() {         if (!::isDfuDeviceFound()) {             return false;         }         dfu_status dfuStatus {};         const int ec = dfu_get_status(::dfu_root, &amp;dfuStatus);         if (ec &lt; 0) {             std::printf(\"Cannot check device status: %s\\n\", libusb_error_name(ec));             return false;         }         if (dfuStatus.bStatus != 0 || dfuStatus.bState != DFU_STATE_dfuIDLE) {             std::printf(\"Bad DFU device status: %s\\n\", dfu_status_to_string(dfuStatus.bStatus));             std::printf(\"Bad DFU device state: %s\\n\", dfu_state_to_string(dfuStatus.bState));             return false;         }         return true;     }      void deinitFrameworks() noexcept {         if (::frameworkStatus == static_cast&lt;std::uint8_t>(FrameworkStatus::Deinited)) {             return;         }          if (::frameworkStatus &amp; static_cast&lt;std::uint8_t>(FrameworkStatus::DeviceOpened)) {             libusb_close(::dfu_root->dev_handle);         }          if (::frameworkStatus &amp; static_cast&lt;std::uint8_t>(FrameworkStatus::DfuDeviceFound)) {             disconnect_devices();         }          if (::frameworkStatus &amp; static_cast&lt;std::uint8_t>(FrameworkStatus::Inited)) {             libusb_exit(::ctx);         }     }      bool prepareFrameworks() {         int ec = libusb_init(&amp;::ctx);         if (ec &lt; 0) {             std::printf(\"LibUsb initialization error - %s.\\n\", libusb_error_name(ec));             return false;         }         ::frameworkStatus |= static_cast&lt;std::uint8_t>(FrameworkStatus::Inited);          probe_devices(::ctx);         if (!::isDfuDeviceFound()) {             return false;         }         ::frameworkStatus |= static_cast&lt;std::uint8_t>(FrameworkStatus::DfuDeviceFound);          ec = libusb_open(::dfu_root->dev, &amp;::dfu_root->dev_handle);         if (ec &lt; 0) {             std::printf(\"Cannot open device - %s.\\n\", libusb_error_name(ec));             return false;         }         ::frameworkStatus |= static_cast&lt;std::uint8_t>(FrameworkStatus::DeviceOpened);          return ::checkDfuStatus();     } }  bool Firmware::Upload(const std::string &amp;filePath, int transferLimit, int transferSize) noexcept {     if (!::prepareFrameworks()) {         ::deinitFrameworks();         return false;     }      if (std::filesystem::exists(filePath)) {         std::ignore = std::filesystem::remove(filePath);     }      const int fileDescriptor = open(filePath.c_str(), O_WRONLY | O_BINARY | O_CREAT | O_EXCL | O_TRUNC, 0666);     if (fileDescriptor &lt; 0) {         std::printf(\"Cannot create and open file %s for writing.\\n\", filePath.c_str());         ::deinitFrameworks();         return false;     }      std::stringstream dfuUtilOptions;     dfuUtilOptions &lt;&lt; \"-s 0x08000000\";     dfuUtilOptions &lt;&lt; \":\" &lt;&lt; transferLimit;      if (transferSize &lt; 0) {         transferSize = libusb_le16_to_cpu(::dfu_root->func_dfu.wTransferSize);         if (transferSize == 0) {             std::printf(\"Device return zero transfer size. Specify it manually.\\n\");             close(fileDescriptor);         }         if (transferSize &lt; ::dfu_root->bMaxPacketSize0) {             transferSize = ::dfu_root->bMaxPacketSize0;         }     }      const int ec = dfuse_do_upload(::dfu_root,                                    transferSize,                                    fileDescriptor,                                    dfuUtilOptions.str().c_str());     close(fileDescriptor);     if (ec &lt; 0) {         std::printf(\"Error in firmware uploading.\\n\");     }      ::deinitFrameworks();     return true; }<\/code><\/pre>\n<p>\u041d\u0443\u0436\u043d\u043e. \u041f\u043e\u0431\u043e\u0440\u043e\u0442\u044c. \u0416\u0435\u043b\u0430\u043d\u0438\u0435. \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c. \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e&#8230;<br \/>\u0421\u0442\u0430\u0442\u044c\u044f. \u0414\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c. \u041a\u043e\u0440\u043e\u0442\u043a\u043e\u0439&#8230;<br \/>\u041b\u0430\u0434\u043d\u043e, \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430 \u0433\u0438\u0442\u0435 \u0432\u043d\u0435\u0441\u0443 \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0443 \u043a\u043e\u0434, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0432 \u0432\u0441\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u0432\u0441\u0451 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b.<\/p>\n<p>\u041d\u0443 \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u043c \u044d\u0442\u043e \u0441\u0447\u0430\u0441\u0442\u044c\u0435:<\/p>\n<pre><code class=\"cpp\">\/**  * src\/main.cpp  *\/  #include \"Firmware.hpp\"  using namespace WorDfuUtil;  int main() {     std::string filePath = \"firmware.bin\";     int transferLimit = 150'000;      const bool uploadRes = Firmware::upload(filePath, transferLimit);     if(!uploadRes) {         return -50;     }     return 0; }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/724\/4ae\/d5b\/7244aed5b62823740f8d74dc09a2e623.png\" alt=\"\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0447\u0442\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441 DFU \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\" title=\"\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0447\u0442\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441 DFU \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\" width=\"1598\" height=\"380\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/724\/4ae\/d5b\/7244aed5b62823740f8d74dc09a2e623.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0447\u0442\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441 DFU \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 \u043a\u043e\u0434\u0430, \u043d\u043e \u0435\u0449\u0451 \u043e\u0441\u0442\u0430\u043b\u0441\u044f Windows, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0432\u0435\u0441\u0451\u043b\u044b\u043c.<\/p>\n<h2>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c. Windows<\/h2>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0432\u0435\u0441\u0435\u043b\u044c\u0435 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e autoconf \u0438 autoheader \u043d\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u0434 Windows. \u0418\u0434\u0451\u043c \u043d\u0430 <a href=\"https:\/\/www.msys2.org\" rel=\"noopener noreferrer nofollow\">msys2<\/a>, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438 \u043a\u0430\u0447\u0430\u0435\u043c \u0438\u0437 \u0435\u0433\u043e \u0441\u0440\u0435\u0434\u044b \u0432\u0441\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u041d\u0430 <a href=\"https:\/\/dfu-util.sourceforge.net\/build.html\" rel=\"noopener noreferrer nofollow\">\u0431\u0438\u043b\u0434 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u0445<\/a> \u043e\u0442 dfu-util \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c. \u041e\u0431\u044b\u0447\u043d\u043e \u044f \u0441\u0442\u0430\u0432\u043b\u044e \u043f\u0430\u043a\u0435\u0442 <code>mingw-w64-x86_64-toolchain<\/code>, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0436\u043d\u043e \u0438 \u0442\u043e\u0447\u0435\u0447\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435:<\/p>\n<pre><code class=\"bash\">$ pacman -S mingw-w64-x86_64-gcc $ pacman -S mingw-w64-x86_64-autotools  $ pacman -S mingw-w64-x86_64-liusb<\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u0443\u0442\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 msys2:<\/p>\n<pre><code class=\"bash\">C:\/msys64\/mingw64 C:\/msys64\/mingw64\/bin<\/code><\/pre>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0441\u044c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0438 \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e dfu-util \u043f\u043e \u0431\u0438\u043b\u0434-\u0438\u043d\u0441\u0442\u0440\u0443\u0446\u0438\u0438. \u0412\u0438\u043d\u0434\u0430 &#8212; \u043e\u043d\u0430 \u0442\u0430\u043a\u0430\u044f, \u043b\u0443\u0447\u0448\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0440\u0443\u0447\u043a\u0430\u043c\u0438:<\/p>\n<pre><code class=\"bash\">$ bash autogen.sh $ bash configure USB_CFLAGS=\"-IC:\/msys64\/mingw64\/include\/libusb\" \\                  USB_LIBS=\"-L C:\/msys64\/mingw64\/lib -lusb-1.0\"<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b dfu-util, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b \u0446\u0435\u043b\u044b\u0439 \u0432\u0430\u0433\u043e\u043d \u043e\u0448\u0438\u0431\u043e\u043a. \u0422\u043e \u043e\u043d \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 <code>libusb.h<\/code>, \u0442\u043e \u043e\u043d \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <code>lusb-1.0<\/code> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 configure.<\/p>\n<p>\u041c\u0435\u0436\u0434\u0443 \u0434\u0435\u043b\u043e\u043c \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432 \u043b\u043e\u0433\u0435 \u043e\u0442 <code>configure<\/code> \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0430 macOS:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dcb\/dae\/00e\/dcbdae00e42a7398273e4e31cfe22fd4.png\" alt=\"\u041b\u043e\u0433 \u0432\u044b\u0432\u043e\u0434\u0430 configure\" title=\"\u041b\u043e\u0433 \u0432\u044b\u0432\u043e\u0434\u0430 configure\" width=\"683\" height=\"108\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dcb\/dae\/00e\/dcbdae00e42a7398273e4e31cfe22fd4.png\"\/><\/p>\n<div><figcaption>\u041b\u043e\u0433 \u0432\u044b\u0432\u043e\u0434\u0430 <code>configure<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u043d\u043e\u0441\u0438\u0442 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440. \u0414\u0435\u0444\u0430\u0439\u043d <code>HAVE_LIBUSB<\/code> \u043d\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445 dfu-util, \u0442\u0430\u043a \u0447\u0442\u043e \u044f \u0437\u0430\u043a\u0440\u044b\u043b \u043d\u0430 \u044d\u0442\u043e \u0433\u043b\u0430\u0437\u0430. \u0412 \u0441\u0438\u043b\u0443 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 LibUsb \u044f \u0434\u0430\u0436\u0435 \u043f\u043e\u043c\u0435\u0449\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0431\u043b\u043e\u043a.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 LibUsb<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u0433 \u0432\u044b\u0432\u043e\u0434\u0430, \u0442\u043e \u0435\u0441\u0442\u044c 2 \u043f\u0443\u0442\u0438:<\/p>\n<p>\u041f\u0443\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439. \u041f\u0443\u0442\u044c \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u0439.<br \/>\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0434\u043b\u044f pkg-config <code>libusb-1.0.pc<\/code>. \u041e\u043d \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u0432\u0438\u0442\u044c LibUsb \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0430-\u043b\u044f <a href=\"https:\/\/vcpkg.io\/en\/\" rel=\"noopener noreferrer nofollow\">vcpkg<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/brew.sh\" rel=\"noopener noreferrer nofollow\">homebrew<\/a>.<\/p>\n<pre><code># libusb-1.0.pc  prefix=\/opt\/homebrew\/Cellar\/libusb\/1.0.27 exec_prefix=${prefix} libdir=${exec_prefix}\/lib includedir=${prefix}\/include  Name: libusb-1.0 Description: C API for USB device access from Linux, Mac OS X, Windows, OpenBSD\/NetBSD and Solaris userspace Version: 1.0.27 Libs: -L${libdir} -lusb-1.0 Libs.private:  -lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation -Wl,-framework,Security Cflags: -I${includedir}\/libusb-1.0<\/code><\/pre>\n<p>\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c 9-\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<pre><code># libusb-1.0.pc # ... Version: 1.0.27 Libs: -L${libdir} -lusb # ...<\/code><\/pre>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0442.\u043a. \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043a\u0430\u0442\u044c <code>-lusb-1.0<\/code> \u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0443\u0442. \u042f \u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440.<\/p>\n<p>\u0417\u0430\u0447\u0435\u043c \u044f \u043f\u0440\u0438\u0432\u0435\u043b \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440? \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f pkg-config \u0438 \u043a\u0430\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u043d\u0438 \u0432 \u0441\u0435\u0431\u0435 \u043d\u0435\u0441\u0443\u0442. <\/p>\n<p>\u041f\u0443\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439. \u041f\u0443\u0442\u044c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0439.<br \/>\u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0430\u043c\u044b\u0439 \u0431\u0435\u0437\u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u044b\u0439. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>ThirdParty\/dfu-util\/configure.ac<\/code> <\/p>\n<pre><code class=\"xml\"># ThirdParty\/configure.ac # ... Checks for libraries. On FreeBSD the libusb-1.0 is called libusb and resides in system location AC_CHECK_LIB([usb], [libusb_init],, [native_libusb=no],) AS_IF([test x$native_libusb = xno], [ PKG_CHECK_MODULES([USB], [libusb-1.0 >= 1.0.0],, AC_MSG_ERROR([*** Required libusb-1.0 >= 1.0.0 not installed ***])) ]) # ...<\/code><\/pre>\n<p>\u0418 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c 18-\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 <\/p>\n<pre><code class=\"xml\"># ThirdParty\/configure.ac # ... AC_CHECK_LIB([usb-1.0], [libusb_init],, [native_libusb=no],) # ...<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. <br \/>\u0412\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u0445 \u0444\u0430\u0439\u043b\u0430 <code>configure<\/code> \u0432\u0441\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f <code>lusb<\/code> \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u0441\u044f \u043d\u0430 <code>lusb-1.0<\/code>. <br \/>\u0412 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <code>config.h<\/code> \u0434\u0435\u0444\u0430\u0439\u043d <code>HAVE_LIBUSB<\/code> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043d\u0430 <code>HAVE_LIBUSB_1_0<\/code>. \u042d\u0442\u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f&#8230; \u041d\u0435 \u0437\u043d\u0430\u044e, \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u0438 \u0435\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u044f\u0442.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043b\u043e\u0433 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 LibUsb \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ee3\/e10\/8cd\/ee3e108cdefc82098815ac61a8cf96fa.png\" alt=\"\u041b\u043e\u0433 \u0432\u044b\u0432\u043e\u0434\u0430 configure \u043f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\" title=\"\u041b\u043e\u0433 \u0432\u044b\u0432\u043e\u0434\u0430 configure \u043f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\" width=\"652\" height=\"112\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee3\/e10\/8cd\/ee3e108cdefc82098815ac61a8cf96fa.png\"\/><\/p>\n<div><figcaption>\u041b\u043e\u0433 \u0432\u044b\u0432\u043e\u0434\u0430 <code>configure<\/code> \u043f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<\/div>\n<\/details>\n<p>\u041f\u0435\u0440\u0435\u043d\u043e\u0448\u0443 \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 CMake:<\/p>\n<pre><code class=\"cmake\"># ThirdPart\/DfuUtilConfiguring.cmake  if (APPLE)     set(AutogenCommand .\/autogen.sh)     set(ConfigureCommand .\/configure --libdir=${DfuRoot}\/lib --includedir=${DfuRoot}\/include) elseif (WIN32)     set(AutogenCommand bash autogen.sh)     set(ConfigureCommand bash configure USB_CFLAGS=\"-I${LibusbIncludeDir}\" USB_LIBS=\"-L ${LibusbLibDir} -lusb-1.0\") endif ()  add_custom_target(dfu-util_autogen         COMMAND ${AutogenCommand}         COMMENT \"Creating dfu-util configuration file...\"         WORKING_DIRECTORY ${DfuUtilRoot})  add_custom_target(dfu-util_configure         COMMAND ${ConfigureCommand}         DEPENDS dfu-util_autogen         COMMENT \"Configuring dfu-utils for current OS. Generating make files...\"         WORKING_DIRECTORY ${DfuUtilRoot})  add_custom_target(dfu-util_build         COMMAND make         DEPENDS dfu-util_configure         COMMENT \"Running make for dfu-utils project...\"         WORKING_DIRECTORY ${DfuUtilRoot})<\/code><\/pre>\n<p>\u041d\u0430 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 MinGW + Ninja \u0432\u0441\u0451 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1c5\/ff7\/edd\/1c5ff7edd0084e5be9c27959e88971f4.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 MinGW + Ninja\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 MinGW + Ninja\" width=\"1544\" height=\"566\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1c5\/ff7\/edd\/1c5ff7edd0084e5be9c27959e88971f4.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 MinGW + Ninja<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u043e \u044f \u0445\u043e\u0447\u0443 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043d\u0430 MSVC, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u044b\u0440\u044f\u0435\u043c \u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e67\/871\/89e\/e6787189e9d48b19cdc47ef03284ff95.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 MSVC + Ninja\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 MSVC + Ninja\" width=\"2256\" height=\"518\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e67\/871\/89e\/e6787189e9d48b19cdc47ef03284ff95.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 MSVC + Ninja<\/figcaption><\/div>\n<\/figure>\n<p><code>unistd.h<\/code> &#8212; \u044d\u0442\u043e \u0444\u0430\u0439\u043b \u0434\u043b\u044f POSIX \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0435\u0442 \u043d\u0430 Windows. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u0438\u043a\u0430\u043c MinGW \u0431\u0435\u0437\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0442.\u043a. MSVC \u0441 \u0443\u043c\u0430 \u0441\u043e\u0439\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u0438\u0445 \u0443\u0432\u0438\u0434\u0438\u0442. <\/p>\n<p>\u0422\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c &#8212; \u044d\u0442\u043e \u043c\u0435\u043d\u044f\u0442\u044c <code>config.h<\/code> \u0444\u0430\u0439\u043b. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b dfu-util \u043a\u0430\u043a \u043e\u043d\u0438 \u0435\u0441\u0442\u044c, \u043d\u043e \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>config.h.in<\/code> \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f <code>config.in<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0435\u0441\u0442\u044c <code>unistd.h<\/code> \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u0438\u043a. \u041f\u043e\u0434\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u044e \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CMake, \u0447\u0442\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0430 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0444\u0438\u0433\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u044b\u043d\u043e\u0441\u0438\u043c \u0435\u0451 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u043a <code>POST_BUILD<\/code> \u043f\u043e\u0441\u043b\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 <code>dfu-util_configure<\/code> .<\/p>\n<pre><code class=\"cmake\"># ThirdParty\/WriteExtraConfig.cmake  cmake_minimum_required(VERSION 3.23)  set(ConfigComment         \" \/**  * Wor:  *\/\")  file(READ dfu-util\/config.h Config) string(FIND \"${Config}\" \"${ConfigComment}\" ConfigCommentIndex REVERSE)  if (${ConfigCommentIndex} EQUAL -1)     file(READ extraConfig.in ExtraConfig)     string(APPEND Config \"${ConfigComment}\\n${ExtraConfig}\")     file(WRITE dfu-util\/config.h \"${Config}\") endif ()<\/code><\/pre>\n<pre><code class=\"cmake\"># ThirdParty\/DfuUtilConfiguring.cmake # ... add_custom_target(dfu-util_configure         COMMAND ${ConfigureCommand}         DEPENDS dfu-util_autogen         COMMENT \"Configuring dfu-utils for current OS. Generating make files...\"         WORKING_DIRECTORY ${DfuUtilRoot})  include(WriteExtraConfig.cmake)  add_custom_command(TARGET dfu-util_configure         POST_BUILD         COMMENT \"Adding extra config to config.h file...\"         COMMAND ${CMAKE_COMMAND}         -P ${CMAKE_CURRENT_SOURCE_DIR}\/WriteExtraConfig.cmake         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) # ...<\/code><\/pre>\n<pre><code class=\"cpp\">\/**  * ThirdPart\/extraConfig.in  *\/  #if WIN32  #undef HAVE_UNISTD_H #undef HAVE_NANOSLEEP  #include &lt;basetsd.h> #include &lt;sys\/types.h>  #ifndef SSIZE_MAX #define SSIZE_MAX INTPTR_MAX #endif  typedef SSIZE_T ssize_t;  #endif<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 CMake<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0432\u043e\u0442 \u0442\u0430\u043a.<\/p>\n<pre><code class=\"cmake\"># ThirdParty\/WriteExtraConfig.cmake  cmake_minimum_required(VERSION 3.23)  set(ConfigComment         \" \/**  * Wor:  *\/\")  file(READ dfu-util\/config.h Config) string(FIND \"${Config}\" \"${ConfigComment}\" ConfigCommentIndex REVERSE)  if (${ConfigCommentIndex} EQUAL -1)     file(READ extraConfig.in ExtraConfig)     string(APPEND Config ${ConfigComment} \"\\n\" ${ExtraConfig})     string(REPLACE \"%\" \"\\;\" Config \"${Config}\")     file(WRITE dfu-util\/config.h ${Config}) endif ()<\/code><\/pre>\n<pre><code class=\"cpp\">\/**  * ThirdPart\/extraConfig.in  *\/  \/* ... *\/  typedef SSIZE_T ssize_t%  \/* ... *\/<\/code><\/pre>\n<p>\u041c\u043e\u0436\u0435\u0442\u0435 \u0432\u0437\u044f\u0442\u044c \u043f\u0430\u0443\u0437\u0443 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043d\u0451\u043c \u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 15 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>ThirdParty\/WriteExtraConfig.cmake<\/code>  \u0438 \u0441\u0442\u0440\u043e\u043a\u0438 13 \u0444\u0430\u0439\u043b\u0430 <code>extraConfig.in<\/code>.<br \/>* \u0421\u0435\u043a\u0446\u0438\u0438 <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/manual\/cmake-language.7.html#variable-references\" rel=\"noopener noreferrer nofollow\">Variable References<\/a> \u0438 <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/manual\/cmake-language.7.html#lists\" rel=\"noopener noreferrer nofollow\">Lists<\/a> \u0438\u0437 \u043e\u0444\u0444. \u043c\u0430\u043d\u0443\u0430\u043b\u0430 CMake \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0443\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. <\/p>\n<p>\u0414\u0435\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0438\u0441\u043f\u044b\u0442\u0430\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u0430 &#8216;<code>;<\/code>&#8216; \u0432 CMake \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0438 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e. \u0422\u043e\u0447\u043a\u0430 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043a\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0430 \u0441\u0442\u0440\u043e\u043a\u0430 &#8212; \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432. \u041f\u0440\u0438\u043d\u044f\u0432 \u044d\u0442\u043e \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u043e\u0435, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043b \u0432 \u0444\u0430\u0439\u043b\u0435 <code>extraConfig.in<\/code> \u0441\u0438\u043c\u0432\u043e\u043b &#8216;<code>;<\/code>&#8216; \u043d\u0430 &#8216;<code>%<\/code>&#8216; \u0438 \u043c\u0435\u043d\u044f\u044e \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0438\u0445 \u0432 CMake.<\/p>\n<p>\u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f, \u0447\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0436\u0435 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0431\u0430\u0433 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0431\u043e\u0440\u043a\u0438, \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435. <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cmake\">include(CMakePrintHelpers) set(Var1 1;2;3;4;5) cmake_print_variables(Var1)    -> Var1=\"1;2;3;4;5\"  message(WARNING ${Var1})       -> 12345 message(WARNING \"${Var1}\")     -> 1;2;3;4;5 set(Var2 \"1;2;3;4;5\") cmake_print_variables(Var2)    -> Var2=\"1;2;3;4;5\" message(WARNING ${Var2})       -> 12345 message(WARNING \"${Var2}\")     -> 1;2;3;4;5 set(StrVar1 \"Hel;lo\") cmake_print_variables(StrVar1) -> StrVar1=\"Hel;lo\" message(WARNING ${StrVar1})    -> Hello message(WARNING \"${StrVar1}\")  -> Hel;lo set(StrVar2 \"Hel\" \"lo\") cmake_print_variables(StrVar1) -> StrVar2=\"Hel;lo\" message(WARNING ${StrVar2})    -> Hello message(WARNING \"${StrVar2}\")  -> Hel;lo<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0435\u043a\u0446\u0438\u0438 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 CMake \u043e\u043f\u0438\u0448\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435, \u0447\u0435\u043c \u044f.<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u0440\u043e\u0431\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 <code>WorDfuUtil<\/code>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/800\/14b\/78b\/80014b78bc5768e41f1fcb2cf3fc0ea1.jpg\" alt=\"\u041b\u043e\u0433 \u0431\u0438\u043b\u0434\u0430 WorDfuUtil\" title=\"\u041b\u043e\u0433 \u0431\u0438\u043b\u0434\u0430 WorDfuUtil\" width=\"852\" height=\"377\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/800\/14b\/78b\/80014b78bc5768e41f1fcb2cf3fc0ea1.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u041b\u043e\u0433 \u0431\u0438\u043b\u0434\u0430 <code>WorDfuUtil<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c <code>WorDfuUtil<\/code>-\u0443 \u0442\u0438\u043f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>add_library(WorDfuUtil)<\/code>  \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/bf5\/fed\/843\/bf5fed843bc17d00af4890e446e0ff3a.jpg\" alt=\"\u041b\u043e\u0433 WorDfuUtil \u043a\u0430\u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\" title=\"\u041b\u043e\u0433 WorDfuUtil \u043a\u0430\u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\" width=\"1083\" height=\"221\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bf5\/fed\/843\/bf5fed843bc17d00af4890e446e0ff3a.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u041b\u043e\u0433 <code>WorDfuUtil<\/code> \u043a\u0430\u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/13a\/b56\/e11\/13ab56e113c0bb0ba3a8a285713184e1.jpg\" alt=\"\u041b\u043e\u0433 WorDfuUtil \u043a\u0430\u043a \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\" title=\"\u041b\u043e\u0433 WorDfuUtil \u043a\u0430\u043a \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\" width=\"1006\" height=\"260\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/13a\/b56\/e11\/13ab56e113c0bb0ba3a8a285713184e1.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u041b\u043e\u0433 <code>WorDfuUtil<\/code> \u043a\u0430\u043a \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041a\u0430\u043a\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0432\u0435\u0441\u0442\u0438 \u0438\u0442\u043e\u0433\u0438? \u0414\u043b\u044f \u0441\u0435\u0431\u044f \u044f \u0432\u044b\u0434\u0435\u043b\u044f\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u0435\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0441 dfu-util, \u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0442\u043e\u0440\u043c\u043e\u0437\u043e\u043c <s>\u0431\u044b\u043b \u044f<\/s> \u0431\u044b\u043b\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0433\u043e-\u0442\u043e \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421\u0438 \u0431\u0435\u0437 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e CMake-\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u043c-\u0442\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u043c, \u043d\u043e dfu-util \u043f\u0440\u0438\u0432\u043d\u0435\u0441\u043b\u0430 \u043d\u043e\u0432\u044b\u0435 \u043a\u0440\u0430\u0441\u043a\u0438 \u0432 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0436\u0438\u0437\u043d\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438. \u0412 \u0446\u0435\u043b\u043e\u043c, \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e-\u0433\u0430\u0439\u0434\u043e\u043c \u043f\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043d\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0421\u0438 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e CMakeList-\u043e\u0432. <\/p>\n<\/li>\n<li>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0448\u044c \u0433\u043b\u0430\u0437\u0430 \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0448\u044c. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430\u0441\u0438\u043b\u044c\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0442\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0448\u0442\u0443\u043a\u0438 \u0432 CMake \u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0443\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043f\u0440\u0438\u0432\u044b\u043a \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447. <br \/>* \u041f\u0440\u0438\u0432\u0435\u0442 \u043c\u043e\u0435\u043c\u0443 \u043b\u0438\u0434\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043e\u043c\u0431\u0438\u0442 \u043d\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, <code>goto<\/code> \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043d\u0430\u0441\u0442\u0438 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0436\u0438\u0437\u043d\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u043e\u0434 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e <a href=\"https:\/\/github.com\/WorHyako\/Wor-DfuUtil\/tree\/bff7921cf4ddb400be36f0c515c6dddb08003eb6\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0435\u0434\u0451\u0442 \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u0435. \u041f\u043e\u0437\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u044b \u043a\u0430\u043a \u043e\u0442 \u043c\u0435\u043d\u044f, \u0442\u0430\u043a \u0438, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0422\u0430\u043c \u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0438\u0431\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c issue \u043d\u0430 \u043a\u043e\u0434, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b. <\/p>\n<p>dfu-util \u2014 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430. \u041e\u043d\u0430 \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 \u043a\u0440\u0438\u0432\u043e\u0439, \u0435\u0441\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044e \u0432\u043a\u043b\u0430\u0434\u0430 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438. <\/p>\n<p>P.S. \u041d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0445\u0430\u0431\u0440\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0441\u043a\u0430\u0436\u0443 \u0437\u0434\u0435\u0441\u044c. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438\u043b\u0438 \u0443\u0442\u0438\u043b\u0438\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a CMake, \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u043d\u0430\u0434 \u043d\u0438\u043c\u0438.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/792726\/\"> https:\/\/habr.com\/ru\/articles\/792726\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<details class=\"spoiler\">\n<summary>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 dfu-util \u0438 \u0437\u0430\u0447\u0435\u043c \u0431\u0443\u0434\u0438\u0442\u044c \u044d\u0442\u043e \u043b\u0438\u0445\u043e?<\/summary>\n<div class=\"spoiler__content\">\n<h2>\u0427\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u0433\u0434\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c?<\/h2>\n<blockquote>\n<p>\u201cDFU is intended to download and upload firmware to\/from devices connected over USB\u201d &#8212;\u00a0<a href=\"https:\/\/dfu-util.sourceforge.net\" rel=\"noopener noreferrer nofollow\">dfu-util manual page<\/a><\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/dfu-util.sourceforge.net\" rel=\"noopener noreferrer nofollow\">dfu-util<\/a> \u2014 \u044d\u0442\u043e \u0432\u00a0\u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043e\u00a0\u0447\u0435\u0308\u043c \u044f \u043d\u0435\u00a0\u043e\u0447\u0435\u043d\u044c\u2011\u0442\u043e \u0438 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0441\u044f, \u043f\u043e\u0138\u0430 \u043d\u0435\u00a0\u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u00a0\u0435\u0435\u0308 \u0138\u043e\u0434\u043e\u043c. \u041e\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0434\u043b\u044f\u00a0\u0440\u0430\u0431\u043e\u0442\u044b \u0441\u00a0\u0443\u0441\u0442\u0440\u043e\u0438\u0306\u0441\u0442\u0432\u0430\u043c\u0438, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432\u00a0DFU (Device<em> <\/em>Firmware Upgrade) \u0440\u0435\u0436\u0438\u043c\u0435, \u0442.\u00a0\u0435. \u0432\u00a0\u0440\u0435\u0436\u0438\u043c\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u00a0\u043f\u0440\u043e\u0448\u0438\u0432\u0138\u043e\u0438\u0306. \u0422\u0430\u0138\u0438\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0438\u0306\u0441\u0442\u0432\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0432\u0441\u0435\u0308 \u043e\u0442\u00a0\u043c\u0438\u0138\u0440\u043e\u0138\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0434\u043e\u00a0\u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u043e\u0432, \u0430\u00a0\u0441\u0430\u043c\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0446\u0435\u043b\u044f\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0432\u044b\u0433\u0440\u0443\u0437\u0138\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0138\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u0138\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u0411\u044b\u0442\u043e\u0432\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 DFU \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e,\u00a0\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0436\u0438\u0437\u043d\u0438,\u00a0\u0138\u043e\u0442\u043e\u0440\u044b\u0438\u0306 \u0441\u043e \u043c\u043d\u043e\u0438\u0306 \u0441\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0431\u0443\u0138\u0432\u0430\u043b\u044c\u043d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>\u0420\u0435\u0448\u0438\u043b \u044f \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0438\u0306 \u0430\u0438\u0306\u0444\u043e\u043d \u0138 \u0437\u0430\u0432\u043e\u0434\u0441\u0138\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u043f\u0440\u043e\u0448\u0438\u0432\u0138\u0438.\u00a0\u0418 \u0432\u043e\u0442,\u00a0\u0447\u0442\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0438 \u043e\u0434\u0438\u043d \u0430\u0434\u0435\u0138\u0432\u0430\u0442\u043d\u044b\u0438\u0306 \u0447\u0435\u043b\u043e\u0432\u0435\u0138\u00a0&#8212;\u00a0\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u0431\u0430\u043b\u0434\u044b \u0438 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 2 \u043d\u0430\u043d\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043f\u043e\u0441\u043b\u0435 \u0432\u0432\u043e\u0434\u0430.<\/p>\n<p>\u0414\u0430,\u00a0\u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u044f \u0438 \u0441\u0434\u0435\u043b\u0430\u043b.\u00a0\u0423\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c\u00a0Apple ID\u00a0\u0435\u0449\u0435 \u043d\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0438\u0306\u0441\u0442\u0432\u0435,\u00a0\u0442\u0430\u0138 \u0447\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0435\u0308 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435\u043b\u044c\u0437\u044f.\u00a0\u041f\u043e\u0441\u043b\u0435 \u0446\u0435\u043b\u043e\u0433\u043e \u0434\u043d\u044f \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u044f \u0437\u0430\u0431\u043b\u043e\u0138\u0438\u0440\u043e\u0432\u0430\u043b \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043d\u0430 \u0434\u0435\u043d\u044c.\u00a0\u041d\u0430\u0447\u0430\u043b \u0440\u044b\u0441\u0138\u0430\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435,\u00a0\u0138\u0430\u0138 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c.\u00a0\u0412\u0443\u0430\u043b\u044f! \u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u0432\u00a0DFU\u00a0\u0440\u0435\u0436\u0438\u043c,\u00a0\u043f\u043e\u0434\u0138\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0138\u00a0macbook-\u0443 (\u043b\u0438\u0431\u043e Windows iTunes) \u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0448\u0438\u0432\u0138\u0443 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e.\u00a0\u041c\u043e\u0435\u0438\u0306 \u0440\u0430\u0434\u043e\u0441\u0442\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430.\u00a0\u0414\u0435\u043b\u043e\u0432 \u043d\u0430\u00a015\u00a0\u043c\u0438\u043d\u0443\u0442 \u0438 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u0433\u043e\u0442\u043e\u0432 \u0138 \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 DFU \u0440\u0435\u0436\u0438\u043c\u043e\u043c. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430, \u043c\u0438\u043a\u0440\u043e\u0432\u043e\u043b\u043d\u043e\u0432\u043e\u043a, \u043b\u0430\u043f\u0442\u043e\u043f\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 DFU.<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0442\u0435\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u043e dfu-util \u0432 2007-\u043c \u0433\u043e\u0434\u0443:<\/p>\n<blockquote>\n<p>\u201cinitial (unfinished) version of new DFU utility (dfu\u2011programmer just sucks as something generic, device independent)\u201d\u00a0\u2014 Harald Welte \u0432 \u0441\u0432\u043e\u0451\u043c <a href=\"https:\/\/gitlab.com\/dfu-util\/dfu-util\/-\/commit\/0a689cae5e048e4dbb3a27602a58052b52637aeb\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u043e\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u0435<\/a>. <\/p>\n<\/blockquote>\n<p>\u042d\u0442\u043e \u0436 \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/dfu-programmer.github.io\" rel=\"noopener noreferrer nofollow\">dfu-programmer<\/a> \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0447\u0443\u0432\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u043b \u0446\u0435\u043b\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u0430 \u0438 \u0442\u0430\u043a\u043e\u0439, \u0447\u0442\u043e \u0438\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0442\u043d\u0438 \u0442\u044b\u0441\u044f\u0447 \u043b\u044e\u0434\u0435\u0439 \u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0443 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0439. <\/p>\n<h2>\u0411\u0443\u0434\u0438\u0442\u044c \u043b\u0438\u0445\u043e \u0438\u043b\u0438 \u043e\u043d\u043e \u0438 \u0442\u0430\u043a \u0433\u0443\u043b\u044f\u0435\u0442 \u043f\u043e \u043c\u0438\u0440\u0443?<\/h2>\n<p>dfu-util \u043d\u0435 \u0448\u0438\u0431\u043a\u043e-\u0442\u043e \u0437\u0430\u0441\u044b\u043f\u0430\u043b\u0430. \u0415\u0451 \u043f\u043e \u0441\u0435\u0439 \u0434\u0435\u043d\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0433\u0438\u0433\u0430\u043d\u0442\u0438\u0437\u043c\u0430 \u043e\u0442 <a href=\"https:\/\/www.blackmagicdesign.com\" rel=\"noopener noreferrer nofollow\">BlackMagic design<\/a> (dfu-\u0448\u0435\u0447\u043a\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0438\u0445 <a href=\"https:\/\/black-magic.org\/upgrade.html\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0444. \u0433\u0430\u0439\u0434\u0430\u0445<\/a>) \u0438 <a href=\"https:\/\/www.st.com\/content\/st_com\/en.html\" rel=\"noopener noreferrer nofollow\">STM32<\/a> (dfu-util \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <a href=\"https:\/\/wiki.st.com\/stm32mpu\/wiki\/How_to_load_U-Boot_with_dfu-util\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u0434\u0430<\/a>) \u0434\u043e \u043a\u0430\u043a\u0438\u0445-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0442\u0430\u0440\u0442\u0430\u043f\u043e\u0432. <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438. \u041f\u0435\u0440\u0435\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u044b\u0431\u043e\u0440, \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e API \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0432 DFU \u0440\u0435\u0436\u0438\u043c\u0435 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0437\u044f\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e. \u0412\u044b\u0431\u043e\u0440 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d. <\/p>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443 \u0443\u043f\u043e\u043c\u044f\u043d\u0443, \u0447\u0442\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 USB \u043f\u043e\u0440\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/libusb.info\" rel=\"noopener noreferrer nofollow\">LibUsb<\/a>, \u0430 dfu-util \u043a\u0430\u043a \u0440\u0430\u0437 \u0435\u0451 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442. <\/p>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 DFU \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c, \u0430 dfu-util \u043e\u0431\u044b\u0447\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u043d\u0430\u0440\u0435\u0439, \u0430 \u043d\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041e\u0442\u0441\u044e\u0434\u0430 \u0438 \u043f\u043e\u0448\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443 \u0434\u043b\u044f C++ &amp; CMake, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<h2>\u041f\u043b\u0430\u043d\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/h2>\n<ul>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b dfu-util \u043a\u0430\u043a \u0441\u0430\u0431\u043c\u043e\u0434\u0443\u043b\u044f\/\u0441\u0430\u0431\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0421++ \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u0434 CMake \u0441\u0431\u043e\u0440\u043a\u043e\u0439. CMakeList-\u044b \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u0430\u043a \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0441\u0432\u043e\u0438\u0445 \u043d\u0430\u0432\u044b\u043a\u043e\u0432, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u0435\u0435 \u0451\u043c\u043a\u043e\u0439 \u0438 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/module\/ExternalProject.html\" rel=\"noopener noreferrer nofollow\">ExternalProject<\/a>, <a href=\"https:\/\/github.com\/cpm-cmake\/CPM.cmake\" rel=\"noopener noreferrer nofollow\">CPM<\/a> \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0437\u0434\u0435\u0441\u044c \u0432\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435;<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u0430\u043a \u043d\u0430 macOS, \u0442\u0430\u043a \u0438 \u043d\u0430 Windows. \u0412\u0435\u043a \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0434\u0432\u043e\u0440\u0435 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b dfu-util \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c CMake;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0441\u0430-\u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0438 \u043d\u0430 \u0421++ \u0434\u043b\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f dfu-util.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f macOS. \u0412\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043b\u0430\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 macOS \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 \u043a\u043e\u043d\u0435\u0446 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u043f\u043e\u0434 Windows.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b <a href=\"https:\/\/dfu-util.sourceforge.net\/build.html\" rel=\"noopener noreferrer nofollow\">\u0433\u0430\u0439\u0434<\/a> \u043e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 dfu-util. Autoconf, autoheader&#8230; \u044d\u0442\u043e \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0432\u043e\u043e\u0431\u0449\u0435&#8230; \u041b\u0430\u0434\u043d\u043e, \u0441\u0442\u0430\u0432\u0438\u043c \u043b\u044e\u0431\u0438\u043c\u043e\u0439 <a href=\"https:\/\/brew.sh\" rel=\"noopener noreferrer nofollow\">brew<\/a>-\u0448\u043a\u043e\u0439  <\/p>\n<pre><code class=\"bash\">brew install make cmake pkg-config libusb autoconf autoheader<\/code><\/pre>\n<p>\u041d\u0430\u0434\u043e \u0431\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0430\u0434 \u0434\u0440\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0430\u0434\u043e \u043d\u0435\u0434\u043e\u043b\u0433\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<pre><code>WorDfuUtil |--- include |    |--- pch.hpp |    ... |--- src |    |--- main.cpp |    ... |--- ThirdParty |    |--- dfu-util (submodule) |         |--- ... |    |--- DfuUtilConfiguring.cmake |    |--- CMakeLists.txt |--- CMakeLists.txt<\/code><\/pre>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h2>\n<p>\u0422\u043e\u043f\u043e\u0432\u044b\u0439 CMakeLists.txt \u043c\u043d\u0435 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0439\u0434\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0432 <code>ThirdParty\/CMakeLists.txt<\/code>. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0442\u0430\u0440\u0433\u0435\u0442\u044b <code>dfu-util<\/code> \u0438 <code>dfu-util_exe<\/code>.<\/p>\n<pre><code class=\"cmake\"># WorDfuUtil\/ThirdParty\/CMakeLists.txt  cmake_minimum_required(VERSION 3.23)  # ---------- # #   libusb   # # ---------- # find_path(LibusbIncludeDir         NAMES libusb.h         PATH_SUFFIXES \"include\" \"libusb\" \"libusb-1.0\") find_library(LibusbLib         NAMES libusb-1.0.dylib         PATH_SUFFIXES \"lib\")  add_library(libusb INTERFACE) target_link_libraries(libusb         INTERFACE ${LibusbLib}) target_include_directories(libusb         INTERFACE ${LibusbIncludeDir})  # ------------ # #   dfu-util   # # ------------ # project(dfu-util         LANGUAGES C)  set(DfuUtilRoot ${CMAKE_CURRENT_SOURCE_DIR}\/dfu-util) set(DfuUtilSourceDir ${DfuUtilRoot}\/src)  add_library(dfu-util)  set(Sources          ${DfuUtilSourceDir}\/dfu_load.c         ${DfuUtilSourceDir}\/dfu_util.c         ${DfuUtilSourceDir}\/dfuse.c         ${DfuUtilSourceDir}\/dfuse_mem.c         ${DfuUtilSourceDir}\/dfu.c         ${DfuUtilSourceDir}\/dfu_file.c         ${DfuUtilSourceDir}\/quirks.c) target_sources(dfu-util         PRIVATE ${Sources}) source_group(\"dfu-util_sources\"         FILES ${Sources})  target_include_directories(dfu-util         PUBLIC         ${DfuUtilRoot}\/src         ${DfuUtilRoot})  target_link_libraries(dfu-util         PUBLIC libusb)  # ---------------- # #   dfu-util_exe   # # ---------------- # add_executable(dfu-util_exe)  target_sources(dfu-util_exe         PRIVATE         ${Sources}         ${DfuUtilSourceDir}\/main.c)  target_include_directories(dfu-util_exe         PUBLIC         ${DfuUtilRoot}\/src         ${DfuUtilRoot})  target_link_libraries(dfu-util_exe         PUBLIC libusb)<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432\u043c\u0435\u0441\u0442\u043e <code>file({GLOB | GLOB_RECURSE} ...)<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u0432 <code>main.cpp<\/code> \u043d\u0430\u0441 \u0436\u0434\u0451\u0442 \u0441\u044e\u0440\u043f\u0440\u0438\u0437, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0437\u0436\u0435. \u0412\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438 \u0442\u0430\u043a \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u0430\u0436\u0435 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c <a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/command\/file.html#filesystem\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f<\/a> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 CMake. \u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u0440\u0443\u0447\u043a\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c CMake \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u0441\u0447\u0430\u0441\u0442\u044c\u0435, \u041d\u041e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043e\u0442\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u043e \u0434\u0430 &#8212; \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0438\u0445 \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u0438 \u0442.\u043f. <\/p>\n<p>\u0420\u0435\u043c\u0430\u0440\u043a\u0430 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0432\u0441\u0435\u043c\u043e\u0433\u0443\u0449\u0435\u0439 LibUsb. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0435\u0451 \u0447\u0435\u0440\u0435\u0437 <code>find_package(PkgConfig REQUIRED)<\/code> + <code>pkg_check_module(libusb REQUIRED libusb-1.0)<\/code>, \u043d\u043e \u044f \u043d\u0435 \u043f\u0440\u0438\u0432\u044b\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/www.freedesktop.org\/wiki\/Software\/pkg-config\/\" rel=\"noopener noreferrer nofollow\">pkg_config<\/a>, \u0442.\u043a. \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u0435\u043d\u044c\u043a\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0434\u0430 \u0438 \u0435\u0451 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0442 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0430\u0445. <\/p>\n<p>Dfu-util \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Makefile, \u043d\u043e \u044f, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f, \u043d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u0441 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u043c\u043e\u0433\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043b\u043e\u0432\u0438\u0442\u044c \u0441\u0443\u0442\u044c. \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043b\u044e\u0441-\u043c\u0438\u043d\u0443\u0441 \u0441\u043e\u0431\u043b\u044e\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438, \u0441\u043e\u0431\u0440\u0430\u043b \u043a\u0443\u0440\u0441\u044b, \u043b\u0438\u043d\u043a\u0430\u043d\u0443\u043b LibUsb \u0438 \u0441 \u043f\u0440\u0435\u0434\u0432\u043a\u0443\u0448\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0436\u0430\u043b \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0443. <\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043f\u043e\u0439\u043c\u0430\u043d \u043b\u043e\u0434\u044b\u0436\u043a\u043e\u0439<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e \u043c\u0435\u0440\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f, \u043e\u0442\u043a\u0443\u0434\u0430 \u0437\u0432\u0443\u043a\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430, \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e dfu-util-\u0449\u0438\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u044f\u0442 <code>config.h<\/code> \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u0444\u0430\u0439\u043d\u0438\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0442.\u043a. \u043f\u043e \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b.<\/p>\n<pre><code class=\"cpp\">\/**  * ThirdParty\/dfu-util\/config.h.in  *\/  \/* config.h.in.  Generated from configure.ac by autoheader.  *\/  \/* Define to 1 if you have the 'err' function. *\/ #undef HAVE_ERR  \/* Define to 1 if you have the &lt;inttypes.h> header file. *\/ #undef HAVE_INTTYPES_H  \/* Define to 1 if you have the 'usb' library (-lusb). *\/ #undef HAVE_LIBUSB  \/* Define to 1 if you have the 'nanosleep' function. *\/ #undef HAVE_NANOSLEEP  \/* Define to 1 if you have the &lt;stdint.h> header file. *\/ #undef HAVE_STDINT_H  \/* Define to 1 if you have the &lt;stdio.h> header file. *\/ #undef HAVE_STDIO_H  \/* ... *\/<\/code><\/pre>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"cpp\">\/**  * ThirdParty\/dfu-util\/config.h  *\/  \/* config.h.  Generated from config.h.in by configure.  *\/ \/* config.h.in.  Generated from configure.ac by autoheader.  *\/  \/* Define to 1 if you have the 'err' function. *\/ #define HAVE_ERR 1  \/* Define to 1 if you have the &lt;inttypes.h> header file. *\/ #define HAVE_INTTYPES_H 1  \/* Define to 1 if you have the 'usb' library (-lusb). *\/ \/* #undef HAVE_LIBUSB *\/  \/* Define to 1 if you have the 'nanosleep' function. *\/ #define HAVE_NANOSLEEP 1  \/* Define to 1 if you have the &lt;stdint.h> header file. *\/ #define HAVE_STDINT_H 1  \/* Define to 1 if you have the &lt;stdio.h> header file. *\/ #define HAVE_STDIO_H 1  \/* ... *\/<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0431\u0438\u043b\u0434\u0430 dfu-util \u043d\u0443\u0436\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u043e \u043a\u0442\u043e \u044f \u0442\u0430\u043a\u043e\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0438\u0432\u0438\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u0432\u0438 \u043a CMake, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0432\u044b\u043a\u0438\u043d\u0443 \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <code>DfuUtilConfiguring.cmake<\/code> \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"cmake\"># WorDfuUtil\/ThirdParty\/DfuUtilConfiguring.cmake  cmake_minimum_required(VERSION 3.23)  add_custom_target(dfu-util_autogen         COMMAND .\/autogen.sh         COMMENT \"Creating dfu-util configuration file...\"         WORKING_DIRECTORY ${DfuUtilRoot})  add_custom_target(dfu-util_configure         COMMAND .\/configure         DEPENDS dfu-util_autogen         COMMENT \"Configuring dfu-utils for current OS. Generating makefiles...\"         WORKING_DIRECTORY ${DfuUtilRoot})  add_custom_target(dfu-util_build         COMMAND make         DEPENDS dfu-util_configure         COMMENT \"Running make for dfu-utils project...\"         WORKING_DIRECTORY ${DfuUtilRoot})<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0432\u043a\u0443\u0448\u0430\u044e \u0432\u043e\u043f\u0440\u043e\u0441, \u0437\u0430\u0447\u0435\u043c \u043c\u043d\u0435 \u0431\u0438\u043b\u0434\u0438\u0442\u044c \u044d\u0442\u043e Make-\u043e\u043c, \u0435\u0441\u043b\u0438 \u044f \u0438 \u0442\u0430\u043a \u0441\u043e\u0431\u0438\u0440\u0430\u044e \u0432 CMake \u0446\u0435\u043b\u044c <code>dfu-util_exe<\/code>. \u041d\u0435 \u0437\u043d\u0430\u044e, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f. \u041f\u0443\u0441\u0442\u044c \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0443\u0442 \u0438 \u043d\u0435 \u043e\u0442\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e.<br \/>\u041f\u0440\u043e\u0431\u0443\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <code>configure<\/code> \u0438 \u0432\u0441\u0451 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041b\u043e\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430 <code>dfu-util_configure<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u0411\u0438\u043b\u0434 <code>dfu-util<\/code> \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0432\u0435\u043b \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-367837","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/367837","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=367837"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/367837\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=367837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=367837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=367837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}