STM32 KEIL5 to establish the engineering template steps __stm32

Source: Internet
Author: User

Related articles: * Linux Configuration Stm32 Development Environment Overview

2017/7/9 UPDATED
highly recommended use of Coide+gnu ARMG tool chain Development STM32, all is one-click to create a new complete project, not like in the Keil MDK modify the change that so troublesome, the most important is coide and GNU ARM Embedded Tooltrain are free, there is no infringement problem, Almost all projects under Keil can be easily and quickly transplanted to coide COIDE+GNU tool chain Construction STM32F103XX Project

Before long understand the next STM32 single-chip, with Keil set up a project (project) toss for a while, feeling more difficult than the 51 SCM, now record the STM32 based on the KEIL5 project establishment. Keil Installation

The first problem encountered is the coexistence of C51 and MDK, if not installed in a certain way Keil can only open one type of project, the following describes my own solution.

I installed the version is c51v954a and mdk511a, need to click here to download, the installation of the first set up a folder, I set up in E-disk Keil This folder, and then install the c51v954a, the installation path before the establishment of the E:\keil this folder, Do not activate after installation (keil_lic Activator.exe This is the activation tool, only for learning to use, if there is a commercial need please purchase genuine), and then install MDK511A, the same installation path to E:\keil this folder, This time the installation will be prompted to copy and replace, choose not to replace, save two files, this installation in the same folder method is the most convenient way I found on the Internet. The final installation directory file is as follows:

Then open KEIL5, the new version will have pack installer bounce out, download their corresponding models can choose New Project, then you can choose to build 51 or STM32 in the device where project
Building a project template

I am using the latest firmware library version 3.5, which mainly uses the files under the libraries and Project folders.

In the place where you want to save the file a new folder, named Template4(name at random, best English name, Chinese name do not know if there will be mistakes, I did not go to try), under the Template4 to establish three subfolders, respectively named cmsis (storing kernel support files and device support files),fwlib(storing external device driver files),USER(storing their own files, such as the main function, etc.), The next step is to copy the files from the library function 3.5 to the subdirectory you just created.

1),cmsis

Copy the two files under the 3.5\libraries\cmsis\cm3\coresupport of the library function to the Cmsis directory and the library function 3.5\libraries\cmsis\cm3\devicesupport\st\ stm32f10x folder The files below are copied to cmsis, and eventually cmsis files are

2), Fwlib

Copy the two files in the Library function 3.5\libraries\stm32f10x_stdperiph_driver folder to the fwlib below

3), USER

Copy the 3.5\project\stm32f10x_stdperiph_template file of the library function to the user directory

4), in Keil5 new project

Click on the toolbar of new project, the main to put project in the template folder just set up under, so as to facilitate the operation later, at the same time select their own chip model, completed in the folder will have the following documents
Note that more than three folders are used to put some of the files generated by the compilation process, the resulting hex file will also default to the objects directory.

5), Configuration related documents

Click on the Configuration button, open the following interface, add the appropriate group name, where Cmsis,fwlib,user and the previous file is the same, a startup, this is used to store the startup file, the boot file in the cmsis\startup\arm, the suffix is. S, Configure the time to select all file formats to see, the final configuration as shown:

Fwlib added files only need the SRC directory of the. c Suffix of the file can be compiled automatically when the head file included in the

6, after the completion of a place to be modified, click on the define there to write USE_STDPERIPH_DRIVER,STM32F10X_MD (my STM32 model is F103RB,64KB Flash, So select the medium capacity of the boot file STM32F10X_MD, another SCM model F103RC selected is STM32F10X_HD, this can be modified according to their own needs)

Also select the location of the header file in the Include Path

7, compile time may be wrong, because the main function is directly copied library function version, you can modify the compilation

2017/4/19 Update

With Keil is the most current tutorial to build STM32 engineering methods, today learned to use the free ioide and arm embedded GNU tool chain to develop, the first time to understand, but also feel more simple than Keil, and the most important free, there is no infringement problems, Interested can read my another blog:
COIDE+GNU tool chain to construct stm32f103xx project

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.