环境:ubuntu16.04 &&STM32
ROS:kinetic
在ROS与STM32通信烧录的过程遇到如下报错。
st-flash --reset write main.bin 0x8000000
st-flash: error while loading shared libraries: libstlink.so.1: cannot open shared object file: No such file or directory
Makefile.include:128: recipe for target 'flash' failed
make: *** [flash] Error 127
dhy@Deng:~/stm32_project/src/stm32f103rc_rosserial$ make flash
st-flash --reset write main.bin 0x8000000
st-flash: error while loading shared libraries: libstlink.so.1: cannot open shared object file: No such file or directory
Makefile.include:128: recipe for target 'flash' failed
make: *** [flash] Error 127
解决方案:
export LD_LIBRARY_PATH=/usr/local/lib
然后
make flash
正常烧录。
执行效果如下:
st-flash --reset write main.bin 0x8000000
st-flash 1.4.0-47-gae717b9
2018-08-16T16:25:41 INFO usb.c: -- exit_dfu_mode
2018-08-16T16:25:41 INFO common.c: Loading device parameters....
2018-08-16T16:25:41 INFO common.c: Device connected is: F1 High-density device, id 0x10036414
2018-08-16T16:25:41 INFO common.c: SRAM size: 0x10000 bytes (64 KiB), Flash: 0x80000 bytes (512 KiB) in pages of 2048 bytes
2018-08-16T16:25:41 INFO common.c: Attempting to write 47084 (0xb7ec) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x0800b000 erased
2018-08-16T16:25:42 INFO common.c: Finished erasing 23 pages of 2048 (0x800) bytes
2018-08-16T16:25:42 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2018-08-16T16:25:42 INFO flash_loader.c: Successfully loaded flash loader in sram
23/23 pages written
2018-08-16T16:25:46 INFO common.c: Starting verification of write complete
2018-08-16T16:25:47 INFO common.c: Flash written and verified! jolly good!
截图如下: