Ubuntu环境下载程序到STM32
1 JLink方式
1.0 下载JLink
传送门:SEGGER官网

1.2 安装JLink
双击打开下载文件:JLink_Linux_V644i_x86_64.deb
1.3 检验安装
cd /opt/
文件目录
└── SEGGER
├── JLink
├── JLink_V644i
1.4 执行JLink
cd /opt/SEGGER/JLink
./JLinkExe
未连接开发板

注意
:使用ST-Link连接电路板.
命令行显示
st-util

界面显示
stlink-gui

2.10 生成bin文件
看图说话:

其中配置路径为:
编译文件fromelf.exe路径--bin --output 输出bin文件路径 编译生成的axf源文件
/path/core/ARM/ARMCC/bin/fromelf.exe --bin --output ./OBJ/led.bin ./OBJ/led.axf
2.12 下载文件到芯片
sudo st-flash wirte led.bin 0x8000000

3 查看usb接口
查看usb接口状态
lsusb

查看接口权限
ll /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 5月 21 10:11 /dev/ttyUSB0
查看usb接入状态
dmesg

4 问题
Problem1
st-info: error while loading shared libraries: libstlink.so.1: cannot open shared object file: No such file or directory
plan
sudo ldconfig
[参考文献]
1 https://blog.csdn.net/lc_cc/article/details/66982821
2 https://blog.csdn.net/weixin_40606111/article/details/84636067
3 http://www.cnblogs.com/zjutlitao/archive/2015/12/22/5065322.html
4 https://blog.csdn.net/a13526758473/article/details/60468652
5 https://github.com/texane/stlink/blob/master/doc/compiling.md
6 http://www.stmcu.org.cn/module/forum/thread-618905-1-1.html
7 https://www.cnblogs.com/alanfeng/p/5659253.html