Macro definition and Startup File Selection in stm32 Project Creation

Source: Internet
Author: User

During the learning process of stm32, the first step on the establishment of the stm32 project will be difficult for many people, because it is not like other AVR 51 microcontroller, the configuration in options is more complex, the biggest headache among them is the selection box Preprocessor in the C/C ++ compiler option. Now I will describe the two items, first, I want to help students who want to learn stm32 to learn more quickly. Second, I want to make myself better able to review.

As shown in, the path of the header file in the project needs to be added in the box under Additional include directories. '$ proj_dir $' indicates the path of the project ,'\.. 'indicates returning to the previous directory. You need to add all the header file paths and write a path for each row. The advantage of using the relative path is that it can run correctly after the entire project is copied and moved.

The following defined symbols should select some macro definitions. This is the main reason why I wrote this blog today:

Use_stdperiph_driver // indicates that you want to use the stm32 peripheral library for program development.

Use_000010e_eval // indicates that you want to use the rj_eval file officially provided by stm32. The package contains some simple processing for LEDs and buttons. Of course, we can modify these pins on the opposite side, suitable for our development board

Stm32f10x_ld // stm32f101 series 102 series single-chip microcomputer flash capacity is between 16 K and 32 K

Stm32f10x_ld_vl // The Flash capacity of the stm32f100 series microcontroller is between 16 K and 32 K

*

Stm32f10x_md_vl // The Flash capacity of the stm32f100 series microcontroller is between 64 K and K.

*

Stm32f10x_hd_vl // The Flash capacity of the stm32f100 series microcontroller is between K and K.

Stm32f10x_xl // The Flash capacity of the stm32f101 and 103 series products is between K and K.

Stm32f10x_cl // stm32f105 series and stm32f107 Series

The previous macro definitions can be connected together to facilitate understanding. First, let's talk about the meaning of each symbol:

Ld: indicates the processor with a low-density Flash capacity between 16 K and 32 K.

MD: indicates the processor with Flash capacity of medium density products between 64 K and 128.

HD: indicates the processor with high-density Flash capacity between K and K

XL: The Flash processors of ultra-high-density products with a flash capacity between K and K: stm32f101x and stm32f103x

CL: Internet-based processors include stm32f105x and stm32f105x.

Vl: A value-added processor, that is, the stm32f100 series processor.

Therefore, based on the meaning of each symbol, we can also calculate the macro definitions we need to select when creating a project.

There is also a question about how to select the Startup file. I believe that after reading the meaning of each symbol, I will know which Startup File to choose. For more information, see macro definition selection, if I list them one by one, I will look down on your IQ.

Startup_stm32f10x_ld_vl.s

Startup_stm32f10x_ld.s

Startup_stm32f10x_md_vl.s

Startup_stm32f10x_md.s

Startup_stm32f10x_hd.s

Startup_stm32f10x_xl.s

Startup_stm32f10x_cl.s

I hope this article will help you. This is my first time to write an article. If there is any mistake, I hope you can point it out.

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.