STM32 ST-Link CLI microcontroller operations: connect, program, and erase. Before use, STM32 ST-LINK Utility must be installed.
Project description
STM32_ST-link
STM32_ST-link 是基于 STM32 ST-LINK Utility 的一个命令行工具的封装,用于在命令行下对STM32芯片进行烧录、擦除、复位、验证等操作。
可用于无界面批量自动化烧录、测试
环境
win10+python3.8
pip install STM32-ST-link
使用
from STM32_ST_link import STLinkCLI
# 创建STLinkCLI实例
stlink = STLinkCLI()
# 连接到设备
if stlink.connect(): # ST-link 连接单片机
stlink.erase() # 擦除整个芯片(可选)
# 烧录程序
if stlink.program(
# bin_path=r"AT802b/at802bv1r1_baseband_bootloader.bin",
bin_path=r"AT802b/at802bv1r1_baseband.bin", # 烧录的固件
stldr_path=r"AT802b/AT802B_W25Q256_STM32H750.stldr", # 外部flash(可选)
address="0x90000000", # 烧录的地址
# address="0x08000000",
verify=False, # 片上验证
reset=True, # 烧录完成后复位
timeout=10 * 60 # 超时时间
):
print("Programming successful!")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stm32_st_link-1.2.0.tar.gz
(11.9 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stm32_st_link-1.2.0.tar.gz.
File metadata
- Download URL: stm32_st_link-1.2.0.tar.gz
- Upload date:
- Size: 11.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4949154a51e55063440eefb0ceae4a76f305d7edc6136127f7694da98617eea
|
|
| MD5 |
e814085ba1925d44e8543c5d5a203564
|
|
| BLAKE2b-256 |
64775dda10495ae11a90eef6a7b60e182b9b7ee9ae299d89a451a8153edbdfff
|
File details
Details for the file STM32_ST_link-1.2.0-py3-none-any.whl.
File metadata
- Download URL: STM32_ST_link-1.2.0-py3-none-any.whl
- Upload date:
- Size: 12.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a53ad3c8e48e54940e9dc070052c8ceb8ba96104203f331cd74336077f64f68
|
|
| MD5 |
f8da65c0095aaf01616d90f84a750cae
|
|
| BLAKE2b-256 |
27566fb3e040b45bf494e54b6881fbcff0bd5914b3311b511ebf3b81c9ecb966
|