In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to use CMake to build a STM32 project". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use CMake to build a STM32 project".
CMake is a cross-platform automated build system that uses a file called CMakeLists.txt to describe the build process and can produce standard build files, such as Unix's Makefile or Windows Visual Studio's projects/workspaces.
Use CMake to build the STM32 project, generate different build files, such as Visual Studio or Eclipse project files, and then configure the compilation environment, we can choose IDE to develop the STM32 project according to our personal preferences.
Configure toolchain
First create the / opt/stm32-toolchain directory, where all the required tool resources will be placed.
Install GCC ARM Embedded
The first step in configuring toolchain is to install the GCC for ARM Cortex-M and Cortex-R, including a range of tools such as precompilers, compilers, and linkers. The latest version of GCC ARM can be downloaded from launchpad. Here, gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 is downloaded and unzipped in the / opt/stm32-toolchain/gcc-arm directory.
Install STM32Cube
STM32Cube is a comprehensive software platform that includes every series of ST products. STM32CubeF4 is aimed at the STM32F4 series. Choose stm32cubef4.zip here, and the latest version can be downloaded at ST. Download and unzip it in the / opt/stm32-toolchain/stm32-cube directory.
Install stm32-cmake
Stm32-cmake is an open source project that uses CMake, GCC and STM32CubeMX to develop STM32 applications.
Cd / opt/stm32-toolchain/git clone https://github.com/ObKo/stm32-cmake.git to build STM32 Project
First of all, the version of CMake,CMake must be installed at least 2.8. After installing CMake, create the required CMakeLists.txt files in the STM32 project you need to build. After the CMakeLists.txt required for the project project has been written, use stm32-cmake to build the project. The following command generates a project file for Eclipse:
Cmake-DSTM32_CHIP=STM32F407IG-DCMAKE_TOOLCHAIN_FILE=/opt/stm32-toolchain/stm32-cmake/cmake/gcc_stm32.cmake-DCMAKE_BUILD_TYPE=Debug-DTOOLCHAIN_PREFIX=/opt/stm32-toolchain/gcc-arm/gcc-arm-none-eabi-4_9-2015q3-DSTM32Cube_DIR=/opt/stm32-toolchain/stm32-cube/STM32Cube_FW_F4_V1.9.0-DCMAKE_MODULE_PATH=/opt/stm32-toolchain/stm32-cmake/cmake-G "Eclipse CDT4-Unix Makefiles" Thank you for reading The above is the content of "how to use CMake to build STM32 project". After the study of this article, I believe you have a deeper understanding of how to use CMake to build STM32 project, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.