STM32CubeMX study notes [1] - First attempt to build a project

Publisher:美梦小狮子Latest update time:2020-04-22 Source: eefocusKeywords:STM32CubeMX Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Record the general process of how to use STM32CubeMX software to establish a project to generate code


Preparation: stm32f103RCT6 development board, j-link emulator, MDK5.21.1.0, STM32CubeMX and corresponding libraries (Java environment needs to be installed for running).


Take a program that flashes an LED light as an example

1. Open the STM32CubeMX software

insert image description here

Then the update loading window may appear (mine did) just wait.


2. Select the corresponding development board model

insert image description here
insert image description here

3. Enter the clock source selection interface. Since I am a beginner in setting up a project, I will choose the default one.

insert image description here

4. Configure GPIO. Here I choose to control PA8 to control the flashing of the LED light.

insert image description here

5. Choose to configure the clock, crystal oscillator, frequency multiplication and division, etc. Mine is the default selection.

insert image description here
insert image description here

6. Enter the project management interface

insert image description here

7. Select the other default options, and a basic executable project file will be configured. Click Generate.

insert image description here

8. Add test code

Insert the LED flashing code into the newly created main function to test whether the program can run correctly


HAL_Delay(500);

HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_8);

insert image description here

No errors, no warnings, the program is running correctly.

9. Download test

Let's actually test it.

insert image description here

Success, this is the general process, I will study it in depth later.


Keywords:STM32CubeMX Reference address:STM32CubeMX study notes [1] - First attempt to build a project

Previous article:ARM working mode - how to use exceptions and interrupts
Next article:ARM Cortex-M core interrupt/exception system, interrupt priority/nesting details

Recommended ReadingLatest update time:2024-11-15 10:58

STM32CubeMX study notes [1] - First attempt to build a project
Record the general process of how to use STM32CubeMX software to establish a project to generate code Preparation: stm32f103RCT6 development board, j-link emulator, MDK5.21.1.0, STM32CubeMX and corresponding libraries (Java environment needs to be installed for running). Take a program that flashes an LED light as
[Microcontroller]
STM32CubeMX study notes [1] - First attempt to build a project
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号