"STM32" Keil New project template

Source: Internet
Author: User
Ⅰ, write in front

This article uses the current (November 2016) Latest version of the Keil (mdk-arm) V5.21A development environment , taking the STM32 processor as an example to tell you about the detailed process of creating a new software engineering.

Keil (Mdk-arm) V4 and V5 new software engineering are basically the same, this article is also suitable for the V4 version of the new software engineering.

The processor used in this paper is St company's STM32F1 series of Chips, St company other series (such as: F4, etc.), other companies (such as: TI) new software engineering process is the same.

Ⅱ, the main points of this article

From the title of this article can be seen, the focus is the process of new software engineering. However, as an arm developed software engineering, will generally contain some source code (such as: library), meaning that you need to prepare some of the project contains source files.

This article is based on the STM32F1 series Chip as an example (other series of chips similar), will briefly describe the preparation of STM32F1 standard Peripheral Library, demo source code (led flicker routine).

After the preparation of the new software engineering is the main point of this article, the process of new software engineering mainly for beginners, most of the project configuration will choose the default

Ⅲ, preparatory work

As the saying goes, "Ax", although the relationship with the topic is not very large, but also the focus of this article, ready to work, the next new software engineering work is easy to achieve.


2.stm32 Standard Peripheral Library Download

Website download link (need St account login):

Http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/ stm32-embedded-software.html?querycriteria=productid=sc961

According to the chip model to download the corresponding standard peripheral library (if the chip is Stm32f103ze, then download the corresponding stm32f10x_stdperiph_lib), as shown below:


Can also go to Baidu Network disk download (and official website):

Http://pan.baidu.com/s/1qYbBKMK

3. Organize the project folder

This section of the content can be organized according to their own habits, I organize the file and folder structure is in accordance with the regular arrangement. If you feel reasonable, you can quote, if you feel not accustomed to this structure, you can organize yourself.

First create a folder to hold the project files:stm32f103ze (Keil) _demo

A. Extracting St Standard Peripheral library files

There are many source code files in the standard Peripherals Library downloaded from St website, but we only need to use some files. Therefore, it is necessary to extract the files and folders used in our project.

To extract "Stm32f10x_stdperiph_lib", you can see that there are four folders under the home directory:

_htmresc: Picture folder (not extracted)

Libraries: Library folder ( extract most )

Project: Sample project ( extract Small Parts )

Utilities: Public Code, Evaluation Board code (not extracted)

The main files we extracted using the standard Peripherals Library are Libraries files, but some files and folders are superfluous. Therefore, I remove the extra files and folders, keep the required files and folders.

B. Creating new files and folders

In addition to the standard peripheral library files, we need to create files and folders that store our own code. I mainly need to create a new three folder here:

app: Apply part of the code

Bsp: Bottom Part code

Doc: Description Document

In the new folder under their own also need to create their own files, files add source code, we provide the demo project, the implementation of the function is relatively simple, is a led flashing. This is not described here and can be viewed at the end of the download.

Once the above two steps are complete, we can see the folders organized under "Stm32f103ze (Keil) _demo":



At this point, the preparation work is completed, the above extracted files, the new file inside the specific content please download the demo Project view.

Ⅳ, new software engineering

Creating a simple, basic software project takes about three steps: Building engineering, adding files, and configuring engineering.

After the preparation is done, you can create your own software engineering, and the following steps will step through the detailed process of creating a new software engineering from scratch.

1. Establishment of the project

The steps to establish the project are basic and relatively simple.

A. Open software, new build project (Project-uvision new project)


B. Select the path, save the name


C. Select the chip model




D. Basic Engineering


A basic project is completed, but it is not enough to use, and the following steps are required.

2. Add Files

To be exact, you should add a group (folder) and add a file. Directly, it is to add your own source code (previously extracted libraries, new files, etc.) to the project.

Project management here can be defined according to their own ideas (similar to their own classification, naming folders and files), I am here to manage the project in a regular manner.




·

·

add it step by step until the final finish

·

·


3. Configuration Engineering

Configuration engineering for beginners, most of the content only needs to be default , here are only a few common configurations, to meet the basic functions.

A. Click on "Project Target Options" to enter the configuration (or project, options for Target)


B. Output hex File

Many friends who are beginners will ask how to output HEX (files that can be downloaded directly), only need to tick "Project--options for Target, Output" "Create HEX file".

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.