{"id":6413,"date":"2022-12-30T03:11:14","date_gmt":"2022-12-30T01:11:14","guid":{"rendered":"https:\/\/flprog.ru\/?p=6413"},"modified":"2022-12-30T03:11:14","modified_gmt":"2022-12-30T01:11:14","slug":"ispolzovanie-kontrollerov-stm32f103c8-blue-pill-s-arduino-ide","status":"publish","type":"post","link":"https:\/\/flprog.ru\/en\/uchebnyj-centr\/articles\/ispolzovanie-kontrollerov-stm32f103c8-blue-pill-s-arduino-ide\/","title":{"rendered":"Using STM32F103C8 (Blue Pill) Controllers with Arduino IDE"},"content":{"rendered":"<p>Basic tech. specifications:<\/p>\n<p>ARM Cortex M3<br \/>\nBit depth &#8211; 32-bit<br \/>\nFrequency &#8211; 72MHz<br \/>\nFlash memory &#8211; 64KB \/ 128KB<br \/>\nRAM &#8211; 20KB<br \/>\nSPI &#8211; two pieces<br \/>\nI2C &#8211; two pieces<br \/>\nUART &#8211; three hardware UARTs + USB (that is, four interfaces are obtained)<br \/>\nCAN bus<br \/>\nADC &#8211; 12-bit<br \/>\nPWM &#8211; 16 bit<br \/>\nSupply voltage &#8211; from 2 to 3.6V (that is, it can be powered by two &#8220;finger&#8221; batteries)<br \/>\nInternal real-time clock (there is a special pin on the board &#8211; Vbat, for connecting the battery)<\/p>\n<p>Basic information on using STM32 controllers with the Arduino IDE can be found here: <a href=\"https:\/\/github.com\/stm32duino\/wiki\/wiki\/Getting-Started\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/stm32duino\/wiki\/wiki\/Getting-Started<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><em><strong>Some information from personal experience.<\/strong><\/em><\/p>\n<p>I am programming using STM32CubeProgrammer(Serial) mode.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6414\" src=\"https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04411-1.png\" alt=\"\" width=\"830\" height=\"596\" srcset=\"https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04411-1.png 830w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04411-1-300x215.png 300w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04411-1-150x108.png 150w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04411-1-768x551.png 768w\" sizes=\"auto, (max-width: 830px) 100vw, 830px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>To use this mode, you must install the STM32CubeProgrammer program on your computer. As I wrote earlier, there is a crazy person in the world, and therefore you can download this program from Russia only through VPN, and then deceiving the system with your place of residence. I succeeded and therefore I downloaded the current version for various OS, and you can download them from these links.<\/p>\n<p>1.<a href=\"https:\/\/flprog.ru\/downloads\/additionalFiles\/en.stm32cubeprg-win32_v2-12-0.zip\" target=\"_blank\" rel=\"noopener\">Win32<\/a><\/p>\n<p>2.<a href=\"https:\/\/flprog.ru\/downloads\/additionalFiles\/en.stm32cubeprg-win64-v2-12-0.zip\" target=\"_blank\" rel=\"noopener\">Win64<\/a><\/p>\n<p>3.<a href=\"https:\/\/flprog.ru\/downloads\/additionalFiles\/en.stm32cubeprg-lin-v2-12-0.zip\" target=\"_blank\" rel=\"noopener\">Linux<\/a><\/p>\n<p>4.<a href=\"http:\/\/en.stm32cubeprg-mac_v2-12-0.zip\" target=\"_blank\" rel=\"noopener\">Mac Oc<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>You can read more about this and other firmware methods here: <a href=\"https:\/\/github.com\/stm32duino\/wiki\/wiki\/Upload-methods#stm32cubeprogrammer\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/stm32duino\/wiki\/wiki\/Upload-methods#stm32cubeprogrammer<\/a>.<\/p>\n<p>There is also an interesting video:<\/p>\n<p><iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/Myon8H111PQ\" width=\"560\" height=\"314\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<hr \/>\n<p>Some features of Blue Pill pins.<\/p>\n<p>&nbsp;<\/p>\n<p>Be careful with the PA11 and PA12 pins &#8211; this is USB, if something goes wrong, then in addition to losing the ability to flash the MK via usb, you can also damage the computer.<\/p>\n<p>An external quartz clock (32.768) is connected to pins PC14 and PC15.<\/p>\n<p>Other pins can deliver a maximum of 20mA, 8mA is recommended. The total maximum load must not exceed 150mA.<\/p>\n<p>Despite the fact that the supply voltage is ~ 3V, half of the \u201clegs\u201d are tolerant of five volts. Which of course greatly facilitates the use of various peripherals.<\/p>\n<p>The PC13 LED (which the D13 arduino has) is turned on not by a plus, but by a minus. This is just in case, so that you do not experience cognitive dissonance when you write &#8211; digitalWrite (PC13, HIGH), and the diode goes out<\/p>\n<p>The MK does not have an EERPOM, but this is solved by connecting an external flash drive via I2C or SPI.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>Connecting the programmer (UART)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6417\" src=\"https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04413-1.png\" alt=\"\" width=\"1200\" height=\"681\" srcset=\"https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04413-1.png 1200w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04413-1-300x170.png 300w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04413-1-1024x581.png 1024w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04413-1-150x85.png 150w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04413-1-768x436.png 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Connecting the W550<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6418\" src=\"https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04412.jpg\" alt=\"\" width=\"1024\" height=\"303\" srcset=\"https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04412.jpg 1024w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04412-300x89.jpg 300w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04412-150x44.jpg 150w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04412-768x227.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<table style=\"border-collapse: collapse; width: 63.5968%; height: 288px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 31.8709%; text-align: center; height: 24px;\"><strong>STM32<\/strong><\/td>\n<td style=\"width: 31.7259%; height: 24px; text-align: center;\"><strong>W5500<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 31.8709%; height: 24px; text-align: center;\">PA4<\/td>\n<td style=\"width: 31.7259%; height: 24px; text-align: center;\">CS<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 31.8709%; height: 24px; text-align: center;\">PA5<\/td>\n<td style=\"width: 31.7259%; height: 24px; text-align: center;\">SCK<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 31.8709%; height: 24px; text-align: center;\">PA6<\/td>\n<td style=\"width: 31.7259%; height: 24px; text-align: center;\">MISO<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 31.8709%; height: 24px; text-align: center;\">PA7<\/td>\n<td style=\"width: 31.7259%; height: 24px; text-align: center;\">MOSI<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 31.8709%; height: 24px; text-align: center;\">3.3V<\/td>\n<td style=\"width: 31.7259%; height: 24px; text-align: center;\">VCC<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 31.8709%; height: 24px; text-align: center;\">GND<\/td>\n<td style=\"width: 31.7259%; height: 24px; text-align: center;\">GND<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>Features of using Serial0.<\/p>\n<p>Since Serial0 in STM32 is connected to USB, USB support must be enabled as \u201cGeneric Serial\u201d in order to use it when flashing the controller.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6421\" src=\"https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04414-1.png\" alt=\"\" width=\"621\" height=\"595\" srcset=\"https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04414-1.png 621w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04414-1-300x287.png 300w, https:\/\/flprog.ru\/wp-content\/uploads\/2022\/12\/\u0420\u0438\u04414-1-150x144.png 150w\" sizes=\"auto, (max-width: 621px) 100vw, 621px\" \/><\/p>\n<p>Otherwise, when compiling, if Serial0 is used, an error will be generated. By default, when using the description integrated into the FLProg program, these settings are used.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>Additional files that may be required:<\/p>\n<ol>\n<li><a href=\"https:\/\/flprog.ru\/downloads\/additionalFiles\/Flash Loader Demonstrator.zip\" target=\"_blank\" rel=\"noopener\">Flash Loader Demonstrator<\/a><\/li>\n<li><a href=\"https:\/\/flprog.ru\/downloads\/additionalFiles\/generic_boot20_pc13.bin\" target=\"_blank\" rel=\"noopener\">Maple DFU Bootloader firmware binary (generic_boot20_pc13.bin)<\/a><\/li>\n<li><a href=\"https:\/\/flprog.ru\/downloads\/additionalFiles\/win_drivers.zip\" target=\"_blank\" rel=\"noopener\">Drivers for Maple (Windows)<\/a><\/li>\n<li><a href=\"https:\/\/flprog.ru\/downloads\/additionalFiles\/stm32_binaries_hid.zip\" target=\"_blank\" rel=\"noopener\">Drivers for Maple (Windows)<\/a><\/li>\n<\/ol>\n<div class=\"rcl-rating-box rating-type-post box-default\"><div class=\"rating-wrapper\"><span class=\"vote-heart\"><i class=\"rcli fa-heartbeat\" aria-hidden=\"true\"><\/i><\/span><span class=\"rating-value\"><span class=\"rating-null\">0<\/span><\/span><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Basic tech. specifications: ARM Cortex M3 Bit depth &#8211; 32-bit Frequency &#8211; 72MHz Flash memory &#8211; 64KB \/ 128KB RAM &#8211; 20KB SPI &#8211; two pieces I2C &#8211; two pieces UART &#8211; three hardware UARTs + USB (that is, four interfaces are obtained) CAN bus ADC &#8211; 12-bit PWM &#8211; 16 bit Supply voltage &#8211; &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Using STM32F103C8 (Blue Pill) Controllers with Arduino IDE\" class=\"read-more button\" href=\"https:\/\/flprog.ru\/en\/uchebnyj-centr\/articles\/ispolzovanie-kontrollerov-stm32f103c8-blue-pill-s-arduino-ide\/#more-6413\">\u0414\u0430\u043b\u0435\u0435&#8230;<span class=\"screen-reader-text\">Using STM32F103C8 (Blue Pill) Controllers with Arduino IDE<\/span><\/a><\/p>\n<div class=\"rcl-rating-box rating-type-post box-default\"><div class=\"rating-wrapper\"><span class=\"vote-heart\"><i class=\"rcli fa-heartbeat\" aria-hidden=\"true\"><\/i><\/span><span class=\"rating-value\"><span class=\"rating-null\">0<\/span><\/span><\/div><\/div>","protected":false},"author":9177,"featured_media":6432,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"telegram_tosend":false,"telegram_tosend_message":"","telegram_tosend_target":0,"generate_page_header":"","footnotes":""},"categories":[11],"tags":[],"class_list":["post-6413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles"],"translation":{"provider":"WPGlobus","version":"3.0.5","language":"en","enabled_languages":["ru","en","uk"],"languages":{"ru":{"title":true,"content":true,"excerpt":false},"en":{"title":true,"content":true,"excerpt":false},"uk":{"title":true,"content":true,"excerpt":false}}},"_links":{"self":[{"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/posts\/6413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/users\/9177"}],"replies":[{"embeddable":true,"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/comments?post=6413"}],"version-history":[{"count":16,"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/posts\/6413\/revisions"}],"predecessor-version":[{"id":6435,"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/posts\/6413\/revisions\/6435"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/media\/6432"}],"wp:attachment":[{"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/media?parent=6413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/categories?post=6413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flprog.ru\/en\/wp-json\/wp\/v2\/tags?post=6413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}