Linux is really a very good system for developers. It should be familiar to developers. Usually, it is very convenient for us to develop stm32 under Windows. There are many tools, IDE and other support. As an operating system, Linux development of STM32 is not bad at all.
There are many ways to develop stm32 under Linux:
1. Use makefile
2. Use eclipse
3. Use stm32cubemx+sw4stm32
4....
Some masters use the first method. I have only a superficial understanding of makefile and cannot show it. The second method is to use eclipse for development under Windows. Eclipse has a Linux version, so it should be possible, but I have not tried it. What I want to talk about here is the third method. Of course, in addition to these, online development tools like Mbed can be developed on any platform as long as there is an Internet connection.
I believe everyone is already familiar with stm32cubemx, a graphical configuration and code generation tool based on the hal library launched by st. I don’t remember from which version, this tool added support for linux. st’s ambition to vigorously develop linux users is obvious. In addition, ST and AC6 have launched the STM32 ode, namely SW4STM32, a free integrated development tool for developing STM32. SW4STM32 is developed based on Eclipse. The interface after opening is basically the same as Eclipse. It also supports both Windows and Linux versions, which also shows that the second method is feasible. Now let's really start to build the development environment:
1. Preparation
Download STM32CubeMX
Download sw4stm32
Both of these software are needed, so you need to install JRE first. I won’t explain it here, you can find it by searching on Baidu.
2. Installation
In fact, the installation methods of these two software are very similar to the installation under Windows. You can install them by unzipping and double-clicking. However, since I use the Linux system, I can show off and install them using the command line.
installation steps:
1. After completing the previous download, you will get two files:
en.stm32cubemx.zip install_sw4stm32_linux_64bits-v1.8.run
First, unzip the compressed file package.
unzipen.stm32cubemx.zip
get
Readme.html
SetupSTM32CubeMX-4.15.0.exe
SetupSTM32CubeMX-4.15.0.app
SetupSTM32CubeMX-4.15.0.linux
There are four files. The .exe suffix is the installation file under Windows, which is very familiar. The .linux suffix is the installation file of the Linux system. This file is used for installation here (as mentioned before, you can directly double-click to install). Execute the file directly:
./SetupSTM32CubeMX-4.15.0.linux
(If an error occurs, check whether the file has execution permissions, and then execute it after adding permissions)
The effect is as shown below:
At this time, the graphical installation interface will pop up.
This interface is very familiar to you, just follow the prompts to install it step by step, just click Next all the way. If you double-click to install, you will directly come to this step, and the following steps will be omitted!
At this point, the installation is complete. Find the STM32CubeMX file in the installation folder and double-click it, or start the file through the command line to open the STM32CubeMX software. You will see the familiar interface and the usage is exactly the same as under Windows.
After installing the corresponding library, you can create a project, but we don’t have a development environment yet, so install the development environment first: SW4STM32 software:
Excuting an order
chmod+x install_sw4stm32_linux_64bits-v1.8.run
Add execution permission to install_sw4stm32_linux_64bits-v1.8.run. You may need super permissions. Switch to the root user or add sudo before the command. Then the file will have execution permission (there will be an x in front and the color will change).
Then execute the file
./install_sw4stm32_linux_64bits-v1.8.run
Start the installation, then click Next. You can choose a custom installation path. You may need to enter the root user password during the installation. The installation process is basically the same as Windows.
When this interface appears, congratulations, the installation is complete! ! !
This interface is exactly the same as Eclipse. Those who like Eclipse will be more accustomed to it, but it is more convenient to directly install the plug-in under Eclipse.
Now that STM32CUBEMX and SW4STM32 are installed, let's build a project to test it. I happen to have a Nucleo-F429ZI development board at hand, so I'll use this board to test it. You should be familiar with using Cube to create a new project, so I won't describe it in detail here.
It is generally customary not to check Generate Under Root, so that the file structure is more reasonable
After generating the project, there are these files, which can then be opened with sw4stm32:
选择File->Import->General->Exist Project intoWorkspace
Select the folder of the project just generated, Finish
Compile the project, there are no errors or warnings, and then add a few lines of test code:
Then compile and run, you can see the LD2 blue LED on the board flashing at a frequency of 1 Hz. Open the serial port assistant on the computer and you can receive the test information sent by the board, as shown in the figure below
So far, it means that the environment for writing stm32 programs under Linux has been successfully built, and the first runnable test program has been successfully created. Next, you can happily develop your own stm32 application.
Previous article:How to modify the software configuration of STM32F10X hardware from 8MHz to 24MHz
Next article:How to build stm32 development environment under Linux (Part 2)
- Popular Resources
- Popular amplifiers
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- Choosing the right GaN power amplifier - the design is so simple
- The Perseverance rover landed on Mars. Let’s talk about how demanding space is on equipment.
- Infineon Angle Sensor Application Unlocking Machine See how many you can find? Good gifts are waiting for you!
- FPGA experience talk (Xi'an Datang Telecom).pdf
- EEWORLD University ---- ST MEMS sensor application demonstration video
- Analog Discovery 2 review
- What is the purpose of connecting a 10uF capacitor after the op amp output?
- Who needs WiFi 7?
- 【GD32E230】 EVAL board project creation and lighting
- Composting Fermentation Control Based on GD32E231