在linux上搭建stm32开发环境

寵の児 提交于 2020-02-01 03:00:56

环境:ubuntu18.04

1、官网下载编译链:https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads
我下载的是gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2版本

wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2

2、解压编译链:

tar xjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2

3、添加环境变量:
sudo vim ~/.bashrc
在最后面添加行:

export PATH=$PATH:/home/hpf/Compile_chain/gcc-arm-none-eabi-7-2018-q2-update/bin

或者不添加环境变量也行,只需要在编译时指定对应的编译链(位置)即可;
执行一下:

source ~/.bashrc

4、工程编译(我的github工程):

git clone https://github.com/huangpengfen/stm32f10x_for_linux.git
make clean
make
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!