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

How to develop STM32 under macOS

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article focuses on "how to develop STM32 under macOS". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to develop STM32 under macOS"!

Install sw4stm32

On the OpenSTM32 website, scroll down to Step 1, where there is a download here.

After clicking in, you can download the version of macOS, install_sw4stm32_macos_64bits_v2.3.run. Of course, this is the version I currently downloaded, and different versions may have different version numbers.

After downloading, open the terminal, drag the program to the terminal to run the installation program, pay attention to enter the password when installing (permission is required).

Install brew$ ruby-e "$(curl-fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" install stlink

Stlink is a command line tool. You need to use the command line installation tool. Brew is recommended.

Brew install stlink installs the Eclipse plug-in for STM32CubeMX

Introduction to STM32CubeMX:

Stm32 code automatic generation tool, which can generate mainstream IDE (Keil (MDKv4,v5) / EWARM/TrueSTUDIO/sw4stm32/Makefile) projects

The pin and clock can be configured, as well as peripherals (such as SPI/I2C/RTC/UART). After the configuration is successful, the initialization code will be generated automatically.

It also comes with a FreeRTOS, which you can check to support threads in the software, which is relatively simple and has a default defaultTask for reference.

The software also supports power consumption calculation.

On the controller home page of ST

There is a Tools & software on the right.

Under the Software Development Tools tab, click STM32 Configurators and Code Generators (8)

When you go inside, you can find STSW-STM32095 in the list below, which is the Eclipse plug-in for CubeMX.

Full address: http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stsw-stm32095.html (not guaranteed to be available all the time)

Install the CubeMX plug-in to sw4stm32

Extract the plug-in downloaded in the previous step

In the sw4stm32 menu, go to Help and click Install New Software...

Click Add to enter a new window, and then click Local..., to select the folder where the plug-in is unzipped. You can enter STM32CubeMX in the Name field.

You will be prompted to restart sw4stm32 after a successful installation.

Enter sw4stm32 and there is an Open perspecttive near the upper right corner. After clicking on it, you can find STM32CubeMX, and open it to create a stm32 project.

Of course, it is also available in the menu: Window- > Perspective- > Open Perspective- > Other..., has the same effect as the button near the upper right corner.

Use st-flash to download the program

There are three programs in the stlink tool: st-info,st-flash,st-util.

St-info

This is mainly used to view some information about stm32. You can see its parameters by typing st-info directly on the command line.

St-util

It is understood that this tool can be used to do gdb debugging, namely gdbServer

St-flash

Download tool: st-flash write test.bin 0x8000000

This command means that the test.bin (sw4stm32 project is in the Debug directory) file is downloaded to the starting address of memory and the program is run automatically

At this point, I believe you have a deeper understanding of "how to develop STM32 under macOS". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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