Ubuntu环境下使用Vscode+STM32CubeMX的环境配置

准备

1、下载vscode,官网链接:https://code.visualstudio.com/Download
2、下载STM32CubeMX,官网链接:https://www.st.com/zh/development-tools/stm32cubemx.html

环境配置

1、arm-none-eabi-gcc

交叉编译器

sudo apt-get install gcc-arm-none-eabi

2、arm-none-eabi-gdb

调试器

sudo apt install gdb-multiarch
sudo ln -s /usr/bin/gdb-multiarch /usr/bin/arm-none-eabi-gdb

3、GCC & Make

sudo apt-get install make gcc

4、Openocd

先安装依赖

sudo apt-get install build-essential pkg-config autoconf automake libtool libusb-dev libusb-1.0-0-dev libhidapi-dev
sudo apt-get install libtool libsysfs-dev

下载Openocd源码

git clone git://git.code.sf.net/p/openocd/code openocd
cd openocd
./bootstrap
./configure
sudo make
sudo make install

检查是否安装成功

openocd --version

STlink

先安装依赖

sudo apt-get install libusb-1.0 cmake libgtk-3-dev

下载源码并安装

git clone https://github.com/stlink-org/stlink.git
cd stlink
make
make release
make debug
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
cd Release
sudo make install
sudo ldconfig
cd ../..
sudo cp config/udev/rules.d/49-stlinkv2.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
sudo cp src/st-flash/* /usr/bin

检查是否安装成功

st-info -version # 有输出即可

你可能感兴趣的:(ubuntu,vscode,stm32)