Considerations for compiling stm32 in keil5

Source: Internet
Author: User

Hardware: An stm32 Development Board, St-link/v2

I. hardware related:

1. Pin Connection:

Pin7 <-> swio

Pin9 <-> swclk

Pin20/pin18 <-> Gnd

Pin19 <-> + 3.3 V (if you do not use St-link to power the board, do not connect)

 

2. Set in Keil:

1) In debug, select St-link Debugger

2) Select the St-link debugger and select Settings.

3) select Flash download and add programming algroithm. (I am using a chip of stm32f10x)

 

2. Software related:

Click here:

Then you can see:

Here is an example of gpio. I have added: cmsis-core (required), device-> gpio (gpio initialization), device-> startup (initial code) device-> stdpherphdrivers-> gpio control, device-> stdpherphdrivers-> RCC (clock control ).

If an error is reported during compilation, the Library is missing.

If a compilation error occurs, the file such as stm32f10x_conf.h is missing, and then set it here:

Add use_stdperiph_driver in define, add the directory where your project is located in includepaths, and copy stm32f10x_conf.h to the directory where the project is located. (Stm32f10x_conf.h can be found in the directory of keilv5. Do not direct the file directly, because each project may be modified as needed ).

If your project still fails to be compiled, you can search for it by yourself.

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.