Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Tsim Txoj Haujlwm Tshiab
- Kauj Ruam 2: Kho Tus Txheej Txheem
- Kauj ruam 3: Kho lub moos
- Kauj ruam 4: Txuag thiab Tsim
- Kauj Ruam 5: Ntxiv Qee Cov Cai
- Kauj Ruam 6: Txuas Txuas Cov Khoos Phis Tawj
- Kauj ruam 7: Debugging
- Kauj Ruam 8: Ua Ntau Ntxiv
Video: Teeb Up Blue Pill Board hauv STM32CubeIDE: 8 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Blue Pill yog qhov pheej yig heev pob txha liab qab ARM pawg thawj coj loj. Nws muaj STM32F103C8 raws li nws cov txheej txheem uas muaj 64 kbytes ntawm flash thiab 20 kbytes ntawm RAM nco. Nws khiav mus txog 72 MHz thiab yog txoj hauv kev pheej yig tshaj plaws kom nkag mus rau hauv ARM kos software tsim.
Feem ntau piv txwv cov phiaj xwm thiab yuav piav qhia lub phiaj xwm Blue Pill board siv Auduino ib puag ncig. Thaum qhov no ua haujlwm thiab yog txoj hauv kev pib nws muaj nws cov kev txwv. Ib puag ncig Arduino tso cai rau koj me ntsis los ntawm cov khoom siv kho vajtse - uas yog nws lub hom phiaj tsim. Vim li no koj yuav tsis tuaj yeem ua kom zoo dua ntawm txhua tus yam ntxwv ntawm tus txheej txheem muab, thiab kev koom ua ke lub sijhawm ua haujlwm tiag tiag tsis txhawb nqa. Qhov no txhais tau tias Arduino ib puag ncig tsis tau siv dav hauv kev lag luam. Yog tias koj xav ua txoj haujlwm hauv kev txhim kho software txhim kho, Arduino yog qhov chaw pib zoo, tab sis koj yuav tsum tau txav mus thiab siv kev txhim kho ib puag ncig uas siv kev lag luam. ST pab tau zoo ib puag ncig kev txhim kho pub dawb rau lawv cov txheej txheem hu ua STM32CubeIDE. Qhov no tau siv dav hauv kev lag luam, yog li nws yog qhov zoo uas yuav txav mus rau.
Txawm li cas los xij, thiab qhov no yog qhov loj txawm li cas los xij, STM32CubeIDE yog qhov nyuaj txaus ntshai thiab yog ib qho txaus ntshai ntawm kev siv software. Nws txhawb nqa txhua tus yam ntxwv ntawm txhua tus ST tus txheej txheem thiab tso cai rau lawv teeb tsa kom zoo, uas koj tsis tuaj hla hauv Arduino IDE vim tias nws ua tiav rau koj.
Koj yuav tsum teeb tsa koj lub rooj tsavxwm ua thawj kauj ruam hauv STM32CubeIDE. IDE paub txog ST tus kheej cov laug cam txhim kho thiab teeb tsa lawv rau koj, tab sis Blue Pill, thaum siv tus txheej txheem ST, nws tsis yog ST khoom, yog li koj nyob ntawm koj tus kheej ntawm no.
Cov lus qhia no coj koj mus rau txheej txheem teeb tsa koj li Blue Pill board, ua kom muaj chaw nres nkoj txuas, thiab sau qee cov ntawv. Nws tsis ntau, tab sis nws yog thawj kauj ruam tseem ceeb.
Khoom siv
STM32CubeIDE - rub tawm los ntawm ST lub vev xaib. Koj yuav tsum sau npe thiab nws yuav siv sijhawm me ntsis los rub tawm.
Ib daim ntawv Blue Pill board. Koj tuaj yeem tau txais lawv los ntawm eBay. Koj xav tau ib qho uas muaj cov txheej txheem ST tiag rau nws vim qee qhov tsis ua. Hauv ebay zoom rau ntawm daim duab thiab nrhiav ST logo ntawm tus txheej txheem.
ST-LINK v2 debugger/programmer muaj los ntawm ebay rau ob peb phaus.
FTDI TTL rau USB 3.3V cov kab hluav taws xob rau cov zis thiab 2 tus txiv neej rau poj niam lub taub hau xov hlau txuas nws.
Ib txoj haujlwm davhlau ya nyob twg zoo li PuTTY.
Kauj Ruam 1: Tsim Txoj Haujlwm Tshiab
- Pib STM32CubeIDE thiab tom qab ntawv los ntawm cov ntawv qhia zaub mov xaiv Cov Ntaub Ntawv | Tshiab | STM32 Project.
- Hauv Tus lej Tshawb Nrhiav lub thawv nkag STM32F103C8.
- Hauv MCUs/MPUs List koj yuav tsum pom STM32F103C8. Xaiv kab no raws li hauv daim duab saum toj no.
- Nyem Tom ntej no.
- Hauv qhov Project Setup dialog muab koj lub npe ua haujlwm.
- Tawm txhua yam ntxiv raws li nws yog thiab nyem Ua Ntej. Koj qhov haujlwm yuav tshwm rau sab laug hauv qhov Project Explorer pane.
Kauj Ruam 2: Kho Tus Txheej Txheem
- Hauv qhov Project Explorer pane qhib koj qhov haujlwm thiab ob npaug nyem rau.ioc ntawv.
- Ntawm qhov Project & Configuration tab nthuav System Core ces xaiv SYS.
- Nyob rau hauv SYS Hom thiab Kev teeb tsa hauv Debug nco-down xaiv Serial Wire.
- Tam sim no xaiv RCC hauv Cov Txheej Txheem Txheej Txheem teev cia saum SYS koj xaiv saum toj no.
- Hauv RCC Hom & Kev teeb tsa los ntawm Kev Kub Ceev (HSE) nco-down xaiv Crystal/Ceramic Resonator.
- Tam sim no nyob hauv Pawg dua, qhib Kev Sib Txuas thiab xaiv USART2.
- Nyob rau hauv USART2 Hom thiab Kev teeb tsa los ntawm Hom poob-xaiv xaiv Asynchronous.
- Tam sim no xaiv Clock Configuration tab thiab mus rau theem tom ntej.
Kauj ruam 3: Kho lub moos
Tam sim no koj tuaj yeem pom daim duab moos uas txaus ntshai, tab sis nws tsuas xav tau teeb tsa ib zaug. Qhov no nyuaj tshaj plaws los piav qhia ntawm no raws li daim duab yog qhov nyuaj. Txhua yam uas koj xav tau hloov pauv tau hais nyob hauv daim duab saum toj no.
- Blue Pill board los nrog 8 MHz siv lead ua ntawm lub rooj tsavxwm thiab qhov ntawd yog dab tsi lub moos teeb tsa daim duab teeb tsa tsis raug, yog li peb tsis tas yuav hloov qhov ntawd.
- Hauv qab PLL Source Mux xaiv qhov xaiv qis, HSE.
- Tsuas yog rau txoj cai teeb tsa PLLMul rau X9.
- Txhawm rau sab xis dua hauv System Clock Mux xaiv PLLCLK.
- Txhawm rau sab xis dua hauv APB1 Prescalar xaiv /2.
- Qhov ntawd yog nws. Yog tias koj pom ib feem ntawm daim duab qhia meej hauv ntshav koj tau ua qee yam tsis raug.
Kauj ruam 4: Txuag thiab Tsim
- Txuag lub.ioc teeb tsa nrog Ctrl-S. Thaum koj raug nug yog tias koj xav tsim cov cai xaiv yog (thiab zuam Nco Kuv qhov kev txiav txim siab kom koj tsis raug nug txhua lub sijhawm). Koj tuaj yeem kaw cov ntaub ntawv.ioc
- Tam sim no ua tus tsim los ntawm cov ntawv qhia zaub mov Project | Tsim Project.
Kauj Ruam 5: Ntxiv Qee Cov Cai
Tam sim no peb yuav ntxiv qee qhov chaws siv lub chaw nres nkoj uas peb teeb tsa.
- Hauv Project Explorer qhib Core / Src thiab ob npaug nias main.c txhawm rau kho nws.
- Scroll cia kom txog thaum koj pom lub ntsiab () muaj nuj nqi thiab ntxiv cov lej qhia hauv qab no tsuas yog hauv qab cov lus / * USER CODE BEGIN 3 * / tom qab ntawd rov tsim dua.
HAL_UART_Transmit (& huart2, (uint8_t *) "Nyob zoo, ntiaj teb! / R / n", 15U, 100U);
Tom ntej no nws txuas lub kho vajtse thiab muab nws mus.
Kauj Ruam 6: Txuas Txuas Cov Khoos Phis Tawj
Txuas ST-LINK v2
ST-LINK v2 yuav tsum tau los nrog 4 xaim poj niam rau poj niam header ribbon cable. Koj yuav tsum ua cov kev sib txuas hauv qab no:
Blue Pill rau ST-LINK v2
GND to CSY
CLK to SWV
DIO to SWV
3.3 rau 3.3V
Saib thawj daim duab saum toj no.
Txuas tus Serial Cable
Yog tias koj rov qab mus rau.ioc cov ntaub ntawv thiab saib daim duab duab ntawm sab xis koj yuav pom tias UART2's Tx kab nyob ntawm tus pin PA2. Yog li txuas tus lej cim npe PA2 ntawm Blue Pill board rau kev txuas nrog cov xaim daj ntawm FTDI Serial cable. Kuj txuas ib qho ntawm Blue Pill tus pin hauv av (sau G) mus rau cov xaim dub ntawm FTDI cov xov txuas.
Saib daim duab thib ob saum toj no.
Kauj ruam 7: Debugging
Txuas koj hauv FTDI Serial cable thiab tua hluav taws xob txuas ntawm 115200 baud. Tom qab ntawd ntsaws rau hauv koj li ST-LINK v2 thiab koj npaj txhij mus.
- Los ntawm STM32CubeIDE xaiv Khiav | Debug. Thaum Debug li kev sib tham tshwm tuaj xaiv STM32 Cortex-M C/C ++ Application thiab OK.
- Thaum qhov Kho Kom Zoo Dua dialog pops up cia li nias OK.
- Tus debugger yuav tawg ntawm thawj kab ntawm lub ntsiab (). Los ntawm cov ntawv qhia zaub mov xaiv Khiav | Rov pib dua thiab tshawb xyuas cov lus hauv lub davhlau ya nyob twg.
Kauj Ruam 8: Ua Ntau Ntxiv
Qhov ntawd yog nws, koj thawj daim ntawv thov STM32CubeIDE tau teeb tsa thiab ua haujlwm. Qhov piv txwv no tsis ua ntau - tsuas yog xa qee cov ntaub ntawv tawm ntawm qhov chaw nres nkoj.
Txhawm rau siv lwm cov khoom siv sab nrauv thiab sau cov tsav tsheb rau cov cuab yeej sab nraud koj yuav tsum daws qhov kev hloov kho uas txaus ntshai dua! Txhawm rau pab, Kuv tau tsim cov kab ke STM32CubeIDE piv txwv cov phiaj xwm uas teeb tsa thiab siv tag nrho cov khoom siv ntawm Blue Pill tus txheej txheem hauv qhov yooj yim kom nkag siab cov phiaj xwm. Lawv txhua tus qhib qhov chaw thiab koj muaj kev ywj pheej ua txhua yam koj xav tau nrog lawv. Txhua qhov khoom siv sab nraud tau teeb tsa thiab tom qab ntawd muaj tus qauv coj los siv nws nyob hauv kev sib cais (ze li!) Yog li koj tuaj yeem mob siab rau kom tau txais ib qho khoom siv ib leeg mus ib zaug.
Kuj tseem muaj cov tsav tsheb rau cov cuab yeej sab nraud los ntawm EEPROM cov chips yooj yim rau ntsuas lub siab, ntawv nyeem thiab duab nraaj LCD, SIM800 tus qauv rau TCP, HTTP thiab MQTT, keypads, xov tooj cua modules, USB thiab tseem koom nrog FatFS, SD phaib thiab FreeRTOS.
Lawv txhua tus tuaj yeem pom hauv Github ntawm no …
github.com/miniwinwm/BluePillDemo
Pom zoo:
Yog li, Koj Thauj STM32duino Bootloader hauv Koj "Blue Pill" Yog Li Cas Tam Sim No?: 7 Kauj Ruam
Yog li, Koj Thauj STM32duino Bootloader hauv Koj "Blue Pill" … Yog Li Cas Tam Sim No?: Yog tias koj twb nyeem kuv cov lus qhia piav qhia yuav ua li cas thauj STM32duino bootloader lossis lwm yam ntaub ntawv zoo sib xws, koj sim thauj cov piv txwv thiab …. tej zaum yuav tsis muaj dab tsi tshwm sim txhua qhov. Teeb meem yog, ntau, yog tias tsis yog txhua tus piv txwv rau " Generic " STM32 yog
STM32 "Blue Pill" Progmaming Via Arduino IDE & USB: 8 Kauj Ruam
STM32 "Blue Pill" Progmaming Via Arduino IDE & USB: Sib piv STM32F cov ntawv pov thawj kev ua tswv cuab (piv txwv li Blue Pill) rau nws cov txee ntu Arduino yooj yim pom ntau npaum li cas cov peev txheej nws muaj, uas qhib ntau txoj hauv kev tshiab rau IOT cov haujlwm. cons yog qhov tsis muaj kev txhawb nqa rau nws. Qhov tseeb tsis yog tiag tiag
DIY LED Teeb - Niaj Hnub Teeb Meem Teeb Nrog Cov Chaw Taws Teeb: 8 Kauj Ruam (nrog Duab)
DIY LED Teeb - Niaj Hnub Teeb Mood Teeb Nrog Chaw Taws Teeb: Hauv kab lus no kuv yuav mus hla cov txheej txheem Kuv tau siv los tsim qhov no zoo heev pyramid zoo li tus LED Mood Teeb.Kuv siv maple rau cov qauv tseem ceeb thiab qee qhov mahogany txhav ntxiv rau lub zog. Rau lub teeb Kuv siv RGB LED teeb uas tuaj nyob hauv 16 ko taw
DIY-Rov ua dua lub kiv cua hauv pem teb rau hauv Kev Teeb Duab Teeb Duab/txhua-hauv-ib Teeb: 11 Kauj Ruam
DIY-Rov ua dua lub kiv cua hauv pem teb rau hauv Kev Hloov Kho Lub Teeb/txhua-hauv-ib lub teeb: Yog li kuv nyuam qhuav nyuam qhuav ntxuav lub caij nplooj ntoo hlav thiab tuaj hla cov kiv cua hauv pem teb uas muaj nws lub cav hlawv tawm. Thiab kuv xav tau lub teeb rooj. 2+2 thiab kuv tau ua tswv yim me ntsis thiab tuaj nrog lub tswv yim los hloov lub kiv cua mus rau hauv 20inch dav lub teeb hloov kho. Nyeem rau s
LED Teeb Teeb Duab Cwjmem: Cov Cuab Yeej rau Teeb Teeb Doodles: 6 Kauj Ruam (nrog Duab)
LED Teeb Teeb Lub Cwjmem: Cov Cuab Yeej rau Teeb Doodles: Kuv tus poj niam Lori yog tus neeg siv tsis tu ncua thiab kuv tau ua si nrog kev yees duab ntev ntev rau ntau xyoo. Kev tshoov siab los ntawm PikaPika pab pawg teeb pom kev zoo thiab yooj yim ntawm cov koob yees duab digital peb tau siv lub teeb duab kos duab kom pom tias peb tuaj yeem ua dab tsi