代码库
https://github.com/stlink-org/stlink/

Ubuntu 下安装stlink-v2驱动

root 用户执行

root 用户执行

root 用户执行

apt install git make cmake libusb-1.0-0-dev gcc build-essential -y
git clone https://github.com/stlink-org/stlink
cd stlink
cmake .
make && make install

加载

ldconfig

查看 usb

lsusb

输出

Bus 001 Device 003: ID 0483:3748 STMicroelectronics ST-LINK/V2

st-info --probe 探针

st-info --probe

输出

Failed to parse flash type or unrecognized flash type
Found 1 stlink programmers
  version:    V2J29S7
  serial:     690058000C0000544334544E
  flash:      65536 (pagesize: 1024)
  sram:       20480
  chipid:     0x410
  dev-type:   STM32F1xx_MD

mac 安装 stlink

brew install stlink

或编译安装

git clone https://github.com/stlink-org/stlink
cd stlink
cmake .
make && make install

st-info --probe 探针

st-info --probe

输出

Failed to parse flash type or unrecognized flash type
Found 1 stlink programmers
  version:    V2J29S7
  serial:     690058000C0000544334544E
  flash:      65536 (pagesize: 1024)
  sram:       20480
  chipid:     0x410
  dev-type:   STM32F1xx_MD

其他命令

st-flash erase 擦除抹去

 st-flash erase

输出

st-flash 1.7.0-221-g879e769
Failed to parse flash type or unrecognized flash type
2022-12-29T10:37:26 INFO common.c: STM32F1xx_MD: 20 KiB SRAM, 64 KiB flash in at least 1 KiB pages.
Mass erasing

st-flash reset 重置

st-flash reset

st-info --probe 探针

st-info --probe

输出

Failed to parse flash type or unrecognized flash type
Found 1 stlink programmers
  version:    V2J29S7
  serial:     690058000C0000544334544E
  flash:      65536 (pagesize: 1024)
  sram:       20480
  chipid:     0x410
  dev-type:   STM32F1xx_MD

更多推荐