Debian环境下搭建STM32开发环境

  1. 安装交叉编译工具,解压gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2,并且把交叉编译环境添加到path路径。

2.安装下载工具驱动和下载工具

bash 复制代码
# 安装下载工具openocd
sudo apt -y install openocd

3.下载测试

bash 复制代码
 sudo openocd -f cmsis-dap.cfg -f stm32f4x.cfg   -c "program build/MM.hex" -c "reset"   -c "shutdown"
  • cmsis-dap.cfg :daplink配置文件
  • stm32f4x.cfg:目标配置文件
  • -c "program xxxx.hex" : 烧录固件
  • -c "reset" :烧录完成后复位mcu
  • -c "shutdown" : 烧录完成后退出openocd

注意点:

1.openocd 配置文件默认路径在:/usr/share/openocd/scripts

2.linux下openocd下载需要用到usb接口,需要sudo权限操作。

相关推荐
搬砖的小码农_Sky1 天前
Linux操作系统:Ubuntu和Debian的区别
linux·ubuntu·debian
孪生质数-3 天前
Linux高危漏洞通报Copy Fail - CVE-2026-31431
linux·运维·服务器·ubuntu·网络安全·debian·cve-2026-31431
千百元7 天前
zookeeper启不来了
linux·zookeeper·debian
pray~8 天前
海外Linux Debian环境临时安装依赖包
linux·运维·debian
neo33019 天前
debian MEDIATEK Corp. Device 7925 无线网卡驱动安装
运维·服务器·debian
vortex59 天前
Debian 包管理全指南:从底层 dpkg 到高层 apt 及其日志追踪
linux·运维·debian
chenqianghqu10 天前
debian系统程序自动运行
debian
韩明君12 天前
OpenClaw安全部署实现
linux·人工智能·安全·debian·本地部署·ai agent·openclaw
嘿嘿潶黑黑12 天前
关于Debian源速度慢的解决方法
运维·debian
特长腿特长14 天前
在debian系统上使用kvm、添加网卡设备案例
服务器·debian·php