STM32 MDK project creation diagram steps self-study summary

Publisher:红尘清梦Latest update time:2017-11-28 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I haven't used MDK to write STM32 programs for a long time. Now I find that I can't remember the creation steps. So I read the book again and recorded it step by step-----refer to the example of Wildfire!

---Step 1---Create a folder---Create the following folders under the folder---


---1-1---CMSIS is used to store the library files for our own startup files and some CMSIS layer files.


----1-1-1-----The startup file mentioned above is in the startup folder, which contains startup files for various STM32 chips, mainly divided according to the flash size, which will be introduced in the project settings later.


---1-2---FWlib is used to store the inc and src folders in the STM32 library---these two folders do not need to be modified----inc contains the header files of all driver files---src contains the driver source files of all drivers.


----1-2-1-----inc is the header file---------


----1-2-2-----src is the source file---------


---1-3---Output is used to save the files to be output after the software is compiled. A folder is specially specified here for easy management. Otherwise, it will be saved to the folder where the project is saved by default, and there is no content yet.

---1-4---Listing is used to save the link file generated after compilation. The reason is the same as above. There is no content yet!

---1-5---Among them, the USER folder is more important. It directly stores the user-level code written by our users, such as the main.c main function.

----1-5-1-----Here are------header files and source files----The most important ones are main.c, stm32f10x_it.c and stm32f10x_it.h----Other files are codes written by the user and then added to the project!


---1-6---Finally, PORT is used to save project files separately. It will have content only after the project is created later.


---The second step is to create a project and add the files needed for the project to the project! ---


---2-1---New Construction------


----2-1-1-----Save the new project in the PORT folder under the folder---------


----2-1-2-----Selecting driver chips for the project---STM32 series--------


----2-1-3-----Select STM32F103ZE here---------


-----2-1-4----After confirming, a dialog box will pop up, asking you whether you need to add the startup file provided by the project to the project. Here we use the startup file we copied earlier, so select ---No---!


----2-1-5-----A blank project file has been created. You can see that there is content in the PORT folder!


---2-2---Add files to the new project------

----2-2-1-----Right click and select to enter the component manager---------


-----2-2-2----In the component manager, you can create new folders, modify folder names, and add files previously saved in the corresponding folders to the corresponding folders----such as startup files, driver source files, etc.---------


---------After adding and modifying, it is as follows---------


----2-2-3-----Finally completed, you can see the added folders and files on the main interface---------




---2-3---The project has been created and the files have been added. Now let's configure the project, mainly including the header file path and other operations.


-----2-3-1----Enter the settings interface for the first time---------No need to set, just exit and enter again! ----


----2-3-2-----Enter the settings interface for the second time-----


------2-3-3------Set Target---mainly check the Use MicroLIB item in the figure below---its purpose is to allow the use of built-in C library----such as printf and other functions.


------2-3-4------Set Output Path---



------2-3-5------Set to generate HEX executable file during compilation---Check the second item.


-----2-3-6----Set Listing Path---



-----2-3-7----Set C/C++ Item---Add the following content---STM32F10X_HD, USE_STDPERIPH_DRIVER------STM32F10X_HD means the chip used is large capacity. There is one thing to say here. No matter what capacity chip we use, we only need to fill in this large capacity mark, but do not use the functions that small capacity chips do not have in the program. USE_STDPERIPH_DRIVER means we can use the ST official library.


----2-3-8-----Set C/C++ items---Add file path----Finally complete OK----





---The third step is to compile the main.c file----the simplest main function----


---The fourth step is to compile and check for errors---Generally use the middle one---



------No error, and the HEX file is generated------


Keywords:STM32 Reference address:STM32 MDK project creation diagram steps self-study summary

Previous article:STM32 serial port burning FLASH external font UCGUI display self-study summary
Next article:STM32 I2C bus self-summary learning

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号