Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Eclipse how to create a new STM32 document and compile, download and debug

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how eclipse creates a new STM32 document and compiles, downloads and debugs. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

one。 Create a new C _ blank + file

1. File-> New- > CCompact + Project

two。 Select the corresponding chip family class + Cross arm GCC

3. Configure basic properties

Configure according to the size of your chip:

Chip family: the type of pre-selected chip

Flash Size: fill in according to FLASH size

External clock: fill in the practical crystal frequency, or you don't have to fill in the later modification.

Content: generally choose Empty, there is only one example of LED.

4. Select default Group naming

5. Select the CDT (GCC) directory with the correct settings and the directory of the make linking tool

The effect after Finish is as shown in the picture.

6. Configure code optimization level

Press the right mouse button in the location where the file is displayed under Project Explore

The effect is as shown in the picture

7. Add a global macro definition

8. Add .C.H file directory

9. Add a linked file

Test compilation:

It is found that there is still a problem with the compilation, and it is found that it is the path problem of make and toolchain, and then go to Project- > properties- > build- + build- > Tools Paths.

The first path selects the address of make: my address is D:\ Program Files (x86)\ GNU Tools ARM Embedded\ GnuWin32\ bin

The second path selects the address of the link: my address is D:\ Program Files (x86)\ GNU Tools ARM Embedded\ 5.4 2016q3\ bin

Normal compilation was found after modification.

At this point, you also need to debug the download program:

If you want to debug a single-chip microcomputer such as STM32 under Eclipse, you need J-LINK or ST-LINK. Relatively speaking, there may be more tutorials in J-LINK.

But we only have ST-LINK on hand, and we can make the best use of it, so here we introduce how to configure the debugging tool ST-LINK under Eclipse.

two。 Set up the STLINK download debugger

1. Install ST-LINK Utility softwar

Download address for windows version: http://www.st.com/web/en/catalog/tools/PF258168

2.Run-> External Tools

3. Create a new device with a self-defined name

4. Double-click to set downloader properties

Only need to change the [Main] and [Commom] tabs in the options, as shown below.

${workspace_loc:/st_test_one_c}-P "${project_loc} / ${config_name}: ${project_name} / ${project_name} .hex"-V-Rst

[Main] interface

[Commom] interface

You can download it at this time. If you can't download it, use project- > clean to clear the compiled file first, then compile it and download it again.

Then click download:

III. Debug configuration

1. Run-> Debug Configurations

two。 Configure the chip and the details.

3.Debug enters debugging

On "eclipse how to create a new STM32 document and compile, download and debug" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report