1.下载安装gcc-arm-none-eabi
参考 https://blog.youkuaiyun.com/zhengyangliu123/article/details/54783443
2.安装stlink驱动
到官网下载https://github.com/texane/stlink.git https://github.com/texane/stlink.git
注意
sudo apt-get install build-essential pkg-config autoconf automake libtool libusb-dev libusb-1.0-0-dev libhidapi-dev
sudo apt-get install cmake
cd stlink/
./autogen.sh
./configure
make
sudo make install
3.下载openocd
git clone git://git.code.sf.net/p/openocd/code openocd
cd openocd
./bootstrap //可以不要这一步
./configure --prefix=/usr --enable-stlink//这一步一定要有
make
sudo make install