{"id":466136,"date":"2025-07-05T15:00:14","date_gmt":"2025-07-05T15:00:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=466136"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=466136","title":{"rendered":"<span>VL53L0 \u0438 STM32F103C8T6<\/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<p>\u041e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c VL53L0 \u043a STM32F103C8T6 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e.<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f\u043f\u0440\u043e\u043b\u0435\u0442\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a VL53L5, \u043d\u043e \u043d\u0430\u0448\u0435\u043b VL53L0, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0438 \u043f\u043e\u043f\u0440\u043e\u0449\u0435. \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u043d\u0430\u0448\u0435\u043b \u0435\u0451 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 STMicroelectronics, \u043e\u0434\u043d\u0430\u043a\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c VL53L0 \u0441 \u043d\u0435\u0439 \u043d\u0435 \u0432\u044b\u0448\u043b\u043e. \u0412 \u0438\u0442\u043e\u0433\u0435, \u043e\u0442\u044b\u0441\u043a\u0430\u043b \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 GitHub \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c STM32F401 \u0438 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043b \u0435\u0451 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 STM32F103.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c CubeIDE \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/p>\n<ol>\n<li>\n<p>\u0412\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 RCC \u0432\u044b\u0431\u0438\u0440\u0430\u044e Crystal\/Ceramic Resonator<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5cd\/35c\/e8b\/5cd35ce8bd9b89889a5c85b7c0788d28.png\" width=\"734\" height=\"352\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/5cd\/35c\/e8b\/5cd35ce8bd9b89889a5c85b7c0788d28.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5cd\/35c\/e8b\/5cd35ce8bd9b89889a5c85b7c0788d28.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 SYS \u0432\u044b\u0431\u0438\u0440\u0430\u044e Serial Wire<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b3d\/326\/b6e\/b3d326b6e163eb9f68c8afea4f402106.png\" width=\"750\" height=\"361\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b3d\/326\/b6e\/b3d326b6e163eb9f68c8afea4f402106.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b3d\/326\/b6e\/b3d326b6e163eb9f68c8afea4f402106.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Connectivity \u0432\u043a\u043b\u044e\u0447\u0430\u044e I2C1 \u0438 USART2<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a91\/a62\/bd3\/a91a62bd31b6d979128c41b024c930d7.png\" alt=\"\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 I2C1\" title=\"\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 I2C1\" width=\"757\" height=\"531\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a91\/a62\/bd3\/a91a62bd31b6d979128c41b024c930d7.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a91\/a62\/bd3\/a91a62bd31b6d979128c41b024c930d7.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 I2C1<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/110\/484\/7e4\/1104847e486da175256da9609046bbb1.png\" alt=\"\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 USART2\" title=\"\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 USART2\" width=\"733\" height=\"523\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/110\/484\/7e4\/1104847e486da175256da9609046bbb1.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/110\/484\/7e4\/1104847e486da175256da9609046bbb1.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 USART2<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0445\u043e\u0434 PB9 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e, \u043a\u0430\u043a GPIO_EXTI9<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/001\/33e\/e25\/00133ee25b4d934ce6bc4a7cad0defb5.png\" width=\"729\" height=\"472\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/001\/33e\/e25\/00133ee25b4d934ce6bc4a7cad0defb5.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/001\/33e\/e25\/00133ee25b4d934ce6bc4a7cad0defb5.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0436\u0443 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 NVIC \u0438 \u0441\u0442\u0430\u0432\u043b\u044e \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u043d\u0430 EXTI line interrupts<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/95c\/556\/25c\/95c55625c16ac8f97e877bbb8d4eb106.png\" width=\"785\" height=\"606\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/95c\/556\/25c\/95c55625c16ac8f97e877bbb8d4eb106.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/95c\/556\/25c\/95c55625c16ac8f97e877bbb8d4eb106.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412\u043e \u0432\u043a\u043b\u0430\u0434\u0435 GPIO \u0441\u0442\u0430\u0432\u043b\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/23d\/f01\/c14\/23df01c148d1c6b89ba1ba7fe2ad3d13.png\" width=\"832\" height=\"570\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/23d\/f01\/c14\/23df01c148d1c6b89ba1ba7fe2ad3d13.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/23d\/f01\/c14\/23df01c148d1c6b89ba1ba7fe2ad3d13.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u043e\u0442\u0443 72 \u0413\u0446<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ac4\/854\/ee9\/ac4854ee96329055e7b288602a1b8842.png\" width=\"1547\" height=\"481\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/ac4\/854\/ee9\/ac4854ee96329055e7b288602a1b8842.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ac4\/854\/ee9\/ac4854ee96329055e7b288602a1b8842.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0418 \u0441\u043e\u0437\u0434\u0430\u044e \u043f\u0440\u043e\u0435\u043a\u0442<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0430\u043c\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f VL53L0. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e:<\/p>\n<ol>\n<li>\n<p>\u041d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 GitHub &#8212; <a href=\"https:\/\/github.com\/lamik\/VL53L0X_API_INT_STM32_HAL\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/lamik\/VL53L0X_API_INT_STM32_HAL<\/a><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0430\u0440\u0445\u0438\u0432 VL53L0X_API_INT_STM32_HAL, \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Drivers \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u043f\u043a\u0443 VL53L0X.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Drivers \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 VL53L0X.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/328\/f92\/e5b\/328f92e5b4effdc781db2461d2c05fd6.png\" width=\"621\" height=\"132\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/328\/f92\/e5b\/328f92e5b4effdc781db2461d2c05fd6.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/328\/f92\/e5b\/328f92e5b4effdc781db2461d2c05fd6.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 VL53L0X \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 platform, \u043f\u043e\u0442\u043e\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 src, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b vl53l0x_platform.c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0435 \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <strong>#include &#171;stm32f4xx_hal.h&#187; <\/strong>\u043d\u0430 <strong>#include &#171;stm32f1xx_hal.h&#187;<\/strong>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 platform \u0438 \u0432 \u043f\u0430\u043f\u043a\u0435 inc \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b vl53l0x_platform.h \u0438 \u0442\u0430\u043a\u0436\u0435 \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <strong>#include &#171;stm32f4xx_hal.h&#187; <\/strong>\u043d\u0430 <strong>#include &#171;stm32f1xx_hal.h&#187;<\/strong>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d0\/228\/bc6\/9d0228bc6104d8ac62f1cc0f3f61bd40.png\" alt=\"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 vl53l0x_platform.c\" title=\"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 vl53l0x_platform.c\" width=\"411\" height=\"172\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/9d0\/228\/bc6\/9d0228bc6104d8ac62f1cc0f3f61bd40.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d0\/228\/bc6\/9d0228bc6104d8ac62f1cc0f3f61bd40.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 vl53l0x_platform.c<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/786\/b16\/4f4\/786b164f4313b32dab1d453c749f3ed7.png\" alt=\"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 vl53l0x_platform.h\" title=\"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 vl53l0x_platform.h\" width=\"390\" height=\"184\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/786\/b16\/4f4\/786b164f4313b32dab1d453c749f3ed7.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/786\/b16\/4f4\/786b164f4313b32dab1d453c749f3ed7.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 vl53l0x_platform.h<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u0432 CubeIDE. \u0412 \u0431\u043e\u043a\u043e\u0432\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0436\u043c\u0435\u043c \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448 Alt + Enter \u0438\u043b\u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 File \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043b\u0435\u0432\u043e\u043c \u0443\u0433\u043b\u0443 \u0438 \u0436\u043c\u0435\u043c Properties<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/190\/ad8\/5b6\/190ad85b6714d815ecd9329489db48c1.png\" alt=\"\" title=\"\" width=\"785\" height=\"544\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/190\/ad8\/5b6\/190ad85b6714d815ecd9329489db48c1.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/190\/ad8\/5b6\/190ad85b6714d815ecd9329489db48c1.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a, \u043d\u0430\u0436\u0438\u043c\u0430\u044f \u043d\u0430 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u043b\u0435 C\/C++ General, \u0438 \u0438\u0437 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0443\u043d\u043a\u0442 Paths and Symbols<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d7\/e1b\/448\/9d7e1b448409d70e14272c33d30dbe79.png\" width=\"800\" height=\"570\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/9d7\/e1b\/448\/9d7e1b448409d70e14272c33d30dbe79.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d7\/e1b\/448\/9d7e1b448409d70e14272c33d30dbe79.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Add \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043a\u0438 Inc, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0435\u0439\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Drivers, \u0432 \u043f\u0430\u043f\u043a\u0435 VL53L0, \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Core<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dd3\/650\/6df\/dd36506dfd4abb3cfb5bca8b1992446b.png\" alt=\"\u0416\u043c\u0435\u043c \u043d\u0430 File system\" title=\"\u0416\u043c\u0435\u043c \u043d\u0430 File system\" width=\"342\" height=\"204\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/dd3\/650\/6df\/dd36506dfd4abb3cfb5bca8b1992446b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dd3\/650\/6df\/dd36506dfd4abb3cfb5bca8b1992446b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0416\u043c\u0435\u043c \u043d\u0430 File system<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0c3\/346\/752\/0c334675276ff4c72b4e1f6e16dc8c6d.png\" alt=\"\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u041e\u041a\" title=\"\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u041e\u041a\" width=\"446\" height=\"210\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/0c3\/346\/752\/0c334675276ff4c72b4e1f6e16dc8c6d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0c3\/346\/752\/0c334675276ff4c72b4e1f6e16dc8c6d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u041e\u041a<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438 Inc, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0435\u0439\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 platform<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b6b\/75f\/325\/b6b75f325deddc5dac245540582e2f00.png\" alt=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 Inc \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 platform\" title=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 Inc \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 platform\" width=\"469\" height=\"207\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b6b\/75f\/325\/b6b75f325deddc5dac245540582e2f00.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b6b\/75f\/325\/b6b75f325deddc5dac245540582e2f00.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 Inc \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 platform<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4e5\/c02\/a5f\/4e5c02a5fbf0fbe32a4b63d9a8570106.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" width=\"800\" height=\"575\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/4e5\/c02\/a5f\/4e5c02a5fbf0fbe32a4b63d9a8570106.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4e5\/c02\/a5f\/4e5c02a5fbf0fbe32a4b63d9a8570106.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0416\u043c\u0451\u043c Apply.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0436\u043c\u0435\u043c \u043d\u0430 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u043b\u0435 C\/C++ Build \u0438 \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0430\u0436\u043c\u0435\u043c \u043d\u0430 Settings. \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 MCU\/MPU Settings \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u043b\u0435 <strong>Use float with printf from newlib-nano<\/strong>. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d hex-\u0444\u0430\u0439\u043b, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 MCU\/MPU Post build outputs \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u043b\u0435 Convert to Intel Hex file<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7c6\/055\/f92\/7c6055f924491b8e1d1505050c381138.png\" width=\"806\" height=\"836\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/7c6\/055\/f92\/7c6055f924491b8e1d1505050c381138.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7c6\/055\/f92\/7c6055f924491b8e1d1505050c381138.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/685\/44f\/06a\/68544f06a0cee157e8a6295f6f3520d1.png\" width=\"811\" height=\"848\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/685\/44f\/06a\/68544f06a0cee157e8a6295f6f3520d1.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/685\/44f\/06a\/68544f06a0cee157e8a6295f6f3520d1.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0416\u043c\u0435\u043c Apply \u0438 Apply and Close<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043a\u043e\u0434\u0443.<\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 VL53L0<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN Includes *\/ #include \"vl53l0x_api.h\" #include \"stdio.h\" \/* USER CODE END Includes *\/<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN PV *\/ uint8_t Message[64]; uint8_t MessageLen;  VL53L0X_RangingMeasurementData_t RangingData; VL53L0X_Dev_t  vl53l0x_c; \/\/ center module VL53L0X_DEV    Dev = &amp;vl53l0x_c;  volatile uint8_t TofDataRead; \/* USER CODE END PV *\/<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 UART<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN 0 *\/ void String_write(char sx[]) {     HAL_UART_Transmit(&amp;huart2, (uint8_t *)sx, strlen(sx), 100); }  void String_writeln(char sx[]) {     String_write(sx);     char cr[] = \"\\r\\n\";     HAL_UART_Transmit(&amp;huart2, (uint8_t *)cr, strlen(cr), 100); }  void Int_write(int32_t x) {     char buf[BUFSIZ];     sprintf(buf, \"%ld\", x);     String_write(buf); }  void Int_writeln(int32_t x) {     Int_write(x);     char cr[] = \"\\r\\n\";     HAL_UART_Transmit(&amp;huart2, (uint8_t *)cr, strlen(cr), 100); }  void Float_write(float x) {     char buf[BUFSIZ];     sprintf(buf, \"%f\", x);     String_write(buf); }  void Float_writeln(float x) {     Float_write(x);     char cr[] = \"\\r\\n\";     HAL_UART_Transmit(&amp;huart2, (uint8_t *)cr, strlen(cr), 100); } \/* USER CODE END 0 *\/<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN 1 *\/ uint32_t refSpadCount; uint8_t isApertureSpads; uint8_t VhvSettings; uint8_t PhaseCal;   \/* USER CODE END 1 *\/<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 UART \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN 2 *\/   MessageLen = sprintf((char*)Message, \"msalamon.pl VL53L0X Continuous mode\\n\\r\");   HAL_UART_Transmit(&amp;huart2, Message, MessageLen, 100);    Dev-&gt;I2cHandle = &amp;hi2c1;   Dev-&gt;I2cDevAddr = 0x52;    HAL_NVIC_DisableIRQ(EXTI9_5_IRQn);    VL53L0X_WaitDeviceBooted( Dev );   VL53L0X_DataInit( Dev );   VL53L0X_StaticInit( Dev );   VL53L0X_PerformRefCalibration(Dev, &amp;VhvSettings, &amp;PhaseCal);   VL53L0X_PerformRefSpadManagement(Dev, &amp;refSpadCount, &amp;isApertureSpads);   VL53L0X_SetDeviceMode(Dev, VL53L0X_DEVICEMODE_CONTINUOUS_RANGING);   VL53L0X_StartMeasurement(Dev);    HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);   \/* USER CODE END 2 *\/<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 UART \u0432 \u043c\u043c \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 <\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN WHILE *\/   while (1)   {   if(TofDataRead == 1)       {     \/*MessageLen = sprintf((char*)Message, \"Measured distance: %i\\n\\r\", RangingData.RangeMilliMeter);     HAL_UART_Transmit(&amp;huart2, Message, MessageLen, 100);*\/     String_write(\"Measured distance: \");     Int_write(RangingData.RangeMilliMeter);     String_write(\" mm   \\r\");       TofDataRead = 0;       HAL_Delay(50);       }     \/* USER CODE END WHILE *\/<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN 4 *\/ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if(GPIO_Pin == GPIO_PIN_9) { VL53L0X_GetRangingMeasurementData(Dev, &amp;RangingData); VL53L0X_ClearInterruptMask(Dev, VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY); TofDataRead = 1; } } \/* USER CODE END 4 *\/<\/code><\/pre>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043c\u043e\u043b\u043e\u0442\u043e\u043a \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u043f\u0430\u043d\u0435\u043b\u0438. \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e7e\/1ef\/654\/e7e1ef6540482e4769de1861dd2318f5.png\" width=\"741\" height=\"248\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/e7e\/1ef\/654\/e7e1ef6540482e4769de1861dd2318f5.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e7e\/1ef\/654\/e7e1ef6540482e4769de1861dd2318f5.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0421\u0445\u0435\u043c\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/758\/42c\/038\/75842c038f7b8aa557f80031e01fec43.png\" width=\"1282\" height=\"673\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/758\/42c\/038\/75842c038f7b8aa557f80031e01fec43.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/758\/42c\/038\/75842c038f7b8aa557f80031e01fec43.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CubeProgrammer. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c STM32F103C8T6 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 st-link \u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/df7\/52f\/ec9\/df752fec9ab3915fe98efa018e2f1162.png\" alt=\"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a STM32\" title=\"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a STM32\" width=\"1204\" height=\"698\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/df7\/52f\/ec9\/df752fec9ab3915fe98efa018e2f1162.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/df7\/52f\/ec9\/df752fec9ab3915fe98efa018e2f1162.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a STM32<\/figcaption><\/div>\n<\/figure>\n<p>\u0423\u043a\u0430\u0436\u0435\u043c \u043f\u0443\u0442\u044c \u0434\u043e hex-\u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Debug. \u041f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043c \u0434\u0436\u0430\u043c\u043f\u0435\u0440 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0432 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 boot 1 \u0438 \u043d\u0430\u0436\u043c\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443. <\/p>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Start Programming<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a40\/7cd\/526\/a407cd5261c513f08a497f36a57a6bb8.png\" width=\"569\" height=\"593\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a40\/7cd\/526\/a407cd5261c513f08a497f36a57a6bb8.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a40\/7cd\/526\/a407cd5261c513f08a497f36a57a6bb8.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p> \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 Putty. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c UART \u043a \u041f\u041a \u0438 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043f\u043e\u0434 \u043a\u0430\u043a\u0438\u043c com-\u043f\u043e\u0440\u0442\u043e\u043c \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0441\u044f, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 COM7<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/77d\/109\/1b8\/77d1091b8e389a642b3f7b69701f8e9c.png\" width=\"474\" height=\"111\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/77d\/109\/1b8\/77d1091b8e389a642b3f7b69701f8e9c.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/77d\/109\/1b8\/77d1091b8e389a642b3f7b69701f8e9c.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0416\u043c\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e, \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Bits per second \u0431\u044b\u043b\u043e 115200.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/59f\/651\/404\/59f6514044c48a1f6713c96b5bea31ef.png\" width=\"406\" height=\"455\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/59f\/651\/404\/59f6514044c48a1f6713c96b5bea31ef.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/59f\/651\/404\/59f6514044c48a1f6713c96b5bea31ef.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c, \u0437\u0430\u0445\u043e\u0436\u0443 \u0432 Putty. \u0412\u044b\u0431\u0438\u0440\u0430\u044e Connection type: serial, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e com-\u043f\u043e\u0440\u0442 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c. \u041d\u0430\u0436\u0438\u043c\u0430\u044e open.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/45b\/224\/ebd\/45b224ebd3fea834829852f5621dad4e.png\" width=\"450\" height=\"444\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/45b\/224\/ebd\/45b224ebd3fea834829852f5621dad4e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/45b\/224\/ebd\/45b224ebd3fea834829852f5621dad4e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u044e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432 \u043c\u0438\u043b\u043b\u0438\u043c\u0435\u0442\u0440\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/876\/82a\/557\/87682a5576972f516c64fcc4c0002580.png\" width=\"658\" height=\"270\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/876\/82a\/557\/87682a5576972f516c64fcc4c0002580.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/876\/82a\/557\/87682a5576972f516c64fcc4c0002580.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c VL53L0 \u043a STM32F103 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/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\/925242\/\"> https:\/\/habr.com\/ru\/articles\/925242\/<\/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<p>\u041e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c VL53L0 \u043a STM32F103C8T6 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e.<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f\u043f\u0440\u043e\u043b\u0435\u0442\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a VL53L5, \u043d\u043e \u043d\u0430\u0448\u0435\u043b VL53L0, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0438 \u043f\u043e\u043f\u0440\u043e\u0449\u0435. \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u043d\u0430\u0448\u0435\u043b \u0435\u0451 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 STMicroelectronics, \u043e\u0434\u043d\u0430\u043a\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c VL53L0 \u0441 \u043d\u0435\u0439 \u043d\u0435 \u0432\u044b\u0448\u043b\u043e. \u0412 \u0438\u0442\u043e\u0433\u0435, \u043e\u0442\u044b\u0441\u043a\u0430\u043b \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 GitHub \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c STM32F401 \u0438 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043b \u0435\u0451 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 STM32F103.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c CubeIDE \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/p>\n<ol>\n<li>\n<p>\u0412\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 RCC \u0432\u044b\u0431\u0438\u0440\u0430\u044e Crystal\/Ceramic Resonator<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0412\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 SYS \u0432\u044b\u0431\u0438\u0440\u0430\u044e Serial Wire<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0412\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Connectivity \u0432\u043a\u043b\u044e\u0447\u0430\u044e I2C1 \u0438 USART2<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 I2C1<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 USART2<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0445\u043e\u0434 PB9 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e, \u043a\u0430\u043a GPIO_EXTI9<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0436\u0443 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 NVIC \u0438 \u0441\u0442\u0430\u0432\u043b\u044e \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u043d\u0430 EXTI line interrupts<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0412\u043e \u0432\u043a\u043b\u0430\u0434\u0435 GPIO \u0441\u0442\u0430\u0432\u043b\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u043e\u0442\u0443 72 \u0413\u0446<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0418 \u0441\u043e\u0437\u0434\u0430\u044e \u043f\u0440\u043e\u0435\u043a\u0442<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0430\u043c\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f VL53L0. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e:<\/p>\n<ol>\n<li>\n<p>\u041d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 GitHub &#8212; <a href=\"https:\/\/github.com\/lamik\/VL53L0X_API_INT_STM32_HAL\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/lamik\/VL53L0X_API_INT_STM32_HAL<\/a><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0430\u0440\u0445\u0438\u0432 VL53L0X_API_INT_STM32_HAL, \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Drivers \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u043f\u043a\u0443 VL53L0X.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Drivers \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 VL53L0X.<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 VL53L0X \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 platform, \u043f\u043e\u0442\u043e\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 src, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b vl53l0x_platform.c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0435 \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <strong>#include &#171;stm32f4xx_hal.h&#187; <\/strong>\u043d\u0430 <strong>#include &#171;stm32f1xx_hal.h&#187;<\/strong>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 platform \u0438 \u0432 \u043f\u0430\u043f\u043a\u0435 inc \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b vl53l0x_platform.h \u0438 \u0442\u0430\u043a\u0436\u0435 \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <strong>#include &#171;stm32f4xx_hal.h&#187; <\/strong>\u043d\u0430 <strong>#include &#171;stm32f1xx_hal.h&#187;<\/strong>.<\/p>\n<figure class=\"\">\n<div><figcaption>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 vl53l0x_platform.c<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 vl53l0x_platform.h<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u0432 CubeIDE. \u0412 \u0431\u043e\u043a\u043e\u0432\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0436\u043c\u0435\u043c \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448 Alt + Enter \u0438\u043b\u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 File \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043b\u0435\u0432\u043e\u043c \u0443\u0433\u043b\u0443 \u0438 \u0436\u043c\u0435\u043c Properties<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a, \u043d\u0430\u0436\u0438\u043c\u0430\u044f \u043d\u0430 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u043b\u0435 C\/C++ General, \u0438 \u0438\u0437 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0443\u043d\u043a\u0442 Paths and Symbols<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Add \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043a\u0438 Inc, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0435\u0439\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Drivers, \u0432 \u043f\u0430\u043f\u043a\u0435 VL53L0, \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Core<\/p>\n<figure class=\"\">\n<div><figcaption>\u0416\u043c\u0435\u043c \u043d\u0430 File system<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u041e\u041a<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438 Inc, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0435\u0439\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 platform<\/p>\n<figure class=\"\">\n<div><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 Inc \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 platform<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0416\u043c\u0451\u043c Apply.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0436\u043c\u0435\u043c \u043d\u0430 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u043b\u0435 C\/C++ Build \u0438 \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0430\u0436\u043c\u0435\u043c \u043d\u0430 Settings. \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 MCU\/MPU Settings \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u043b\u0435 <strong>Use float with printf from newlib-nano<\/strong>. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d hex-\u0444\u0430\u0439\u043b, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 MCU\/MPU Post build outputs \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u043b\u0435 Convert to Intel Hex file<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u0416\u043c\u0435\u043c Apply \u0438 Apply and Close<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043a\u043e\u0434\u0443.<\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 VL53L0<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN Includes *\/ #include \"vl53l0x_api.h\" #include \"stdio.h\" \/* USER CODE END Includes *\/<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN PV *\/ uint8_t Message[64]; uint8_t MessageLen;  VL53L0X_RangingMeasurementData_t RangingData; VL53L0X_Dev_t  vl53l0x_c; \/\/ center module VL53L0X_DEV    Dev = &amp;vl53l0x_c;  volatile uint8_t TofDataRead; \/* USER CODE END PV *\/<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 UART<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN 0 *\/ void String_write(char sx[]) {     HAL_UART_Transmit(&amp;huart2, (uint8_t *)sx, strlen(sx), 100); }  void String_writeln(char sx[]) {     String_write(sx);     char cr[] = \"\\r\\n\";     HAL_UART_Transmit(&amp;huart2, (uint8_t *)cr, strlen(cr), 100); }  void Int_write(int32_t x) {     char buf[BUFSIZ];     sprintf(buf, \"%ld\", x);     String_write(buf); }  void Int_writeln(int32_t x) {     Int_write(x);     char cr[] = \"\\r\\n\";     HAL_UART_Transmit(&amp;huart2, (uint8_t *)cr, strlen(cr), 100); }  void Float_write(float x) {     char buf[BUFSIZ];     sprintf(buf, \"%f\", x);     String_write(buf); }  void Float_writeln(float x) {     Float_write(x);     char cr[] = \"\\r\\n\";     HAL_UART_Transmit(&amp;huart2, (uint8_t *)cr, strlen(cr), 100); } \/* USER CODE END 0 *\/<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN 1 *\/ uint32_t refSpadCount; uint8_t isApertureSpads; uint8_t VhvSettings; uint8_t PhaseCal;   \/* USER CODE END 1 *\/<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 UART \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN 2 *\/   MessageLen = sprintf((char*)Message, \"msalamon.pl VL53L0X Continuous mode\\n\\r\");   HAL_UART_Transmit(&amp;huart2, Message, MessageLen, 100);    Dev-&gt;I2cHandle = &amp;hi2c1;   Dev-&gt;I2cDevAddr = 0x52;    HAL_NVIC_DisableIRQ(EXTI9_5_IRQn);    VL53L0X_WaitDeviceBooted( Dev );   VL53L0X_DataInit( Dev );   VL53L0X_StaticInit( Dev );   VL53L0X_PerformRefCalibration(Dev, &amp;VhvSettings, &amp;PhaseCal);   VL53L0X_PerformRefSpadManagement(Dev, &amp;refSpadCount, &amp;isApertureSpads);   VL53L0X_SetDeviceMode(Dev, VL53L0X_DEVICEMODE_CONTINUOUS_RANGING);   VL53L0X_StartMeasurement(Dev);    HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);   \/* USER CODE END 2 *\/<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 UART \u0432 \u043c\u043c \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 <\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN WHILE *\/   while (1)   {   if(TofDataRead == 1)       {     \/*MessageLen = sprintf((char*)Message, \"Measured distance: %i\\n\\r\", RangingData.RangeMilliMeter);     HAL_UART_Transmit(&amp;huart2, Message, MessageLen, 100);*\/     String_write(\"Measured distance: \");     Int_write(RangingData.RangeMilliMeter);     String_write(\" mm   \\r\");       TofDataRead = 0;       HAL_Delay(50);       }     \/* USER CODE END WHILE *\/<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/p>\n<pre><code class=\"objectivec\">\/* USER CODE BEGIN 4 *\/ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if(GPIO_Pin == GPIO_PIN_9) { VL53L0X_GetRangingMeasurementData(Dev, &amp;RangingData); VL53L0X_ClearInterruptMask(Dev, VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY); TofDataRead = 1; } } \/* USER CODE END 4 *\/<\/code><\/pre>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043c\u043e\u043b\u043e\u0442\u043e\u043a \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u043f\u0430\u043d\u0435\u043b\u0438. \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u0445\u0435\u043c\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CubeProgrammer. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c STM32F103C8T6 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 st-link \u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a STM32<\/figcaption><\/div>\n<\/figure>\n<p>\u0423\u043a\u0430\u0436\u0435\u043c \u043f\u0443\u0442\u044c \u0434\u043e hex-\u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Debug. \u041f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043c \u0434\u0436\u0430\u043c\u043f\u0435\u0440 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0432 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 boot 1 \u0438 \u043d\u0430\u0436\u043c\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443. <\/p>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Start Programming<\/p>\n<figure class=\"full-width\"><\/figure>\n<p> \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 Putty. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c UART \u043a \u041f\u041a \u0438 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043f\u043e\u0434 \u043a\u0430\u043a\u0438\u043c com-\u043f\u043e\u0440\u0442\u043e\u043c \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0441\u044f, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 COM7<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0416\u043c\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e, \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Bits per second \u0431\u044b\u043b\u043e 115200.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c, \u0437\u0430\u0445\u043e\u0436\u0443 \u0432 Putty. \u0412\u044b\u0431\u0438\u0440\u0430\u044e Connection type: serial, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e com-\u043f\u043e\u0440\u0442 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c. \u041d\u0430\u0436\u0438\u043c\u0430\u044e open.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u044e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432 \u043c\u0438\u043b\u043b\u0438\u043c\u0435\u0442\u0440\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c VL53L0 \u043a STM32F103 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/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\/925242\/\"> https:\/\/habr.com\/ru\/articles\/925242\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-466136","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/466136","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=466136"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/466136\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=466136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=466136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=466136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}