1 JLink方式
1.0 下载JLink
传送门:SEGGER官网
![](https://img2018.cnblogs.com/blog/1470483/201905/1470483-20190521090909913-2088711351.jpg)
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
未连接开发板
![](https://img2018.cnblogs.com/blog/1470483/201905/1470483-20190521092138967-528636486.jpg)
注意
:使用ST-Link连接电路板.
命令行显示
st-util
![](https://img2018.cnblogs.com/blog/1470483/201905/1470483-20190521154417980-913441561.jpg)
界面显示
stlink-gui
![](https://img2018.cnblogs.com/blog/1470483/201905/1470483-20190521153838006-479219812.jpg)
2.10 生成bin文件
看图说话:
![](https://img2018.cnblogs.com/blog/1470483/201905/1470483-20190521174035644-187639825.jpg)
其中配置路径为:
编译文件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
![](https://img2018.cnblogs.com/blog/1470483/201905/1470483-20190521161629691-1140705089.jpg)
3 查看usb接口
查看usb接口状态
lsusb
![](https://img2018.cnblogs.com/blog/1470483/201905/1470483-20190521154702649-2041246619.jpg)
查看接口权限
ll /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 5月 21 10:11 /dev/ttyUSB0
查看usb接入状态
dmesg
![](https://img2018.cnblogs.com/blog/1470483/201905/1470483-20190521155035106-1708336566.jpg)
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