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------
Previous article:STM32 serial port burning FLASH external font UCGUI display self-study summary
Next article:STM32 I2C bus self-summary learning
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Create a new folder and store files in a USB flash drive using C language in Linux
- [NUCLEO-L552ZE Review] + Simulate I2C to drive DS1307 calendar module
- Is the power supply working in a stable state?
- Another question about high frequency transformer design/sample proofing
- Verilog_HDL_Those Things_Timing
- Car-building fantasies | Read PI automotive electronics information and share your thoughts on car-building!
- How to deal with the waterproof problem of LED luminous characters outdoors?
- Activate the new generation of video doorbell! Let your eyes and ears be close to you
- Ask about inductor winding
- Selection of power inductors and filter energy storage capacitors for DCDC buck and boost circuits