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权限操作。

相关推荐
tianyuanwo1 天前
Debian 系统 deb 仓库管理与配置完全指南
debian·deb
WXDcsdn2 天前
新安装的Debian 12系统开启root用户和ssh登录权限
运维·debian·ssh
fiveym3 天前
Debian 12 PXE 安装报错:Bad archive mirror 复合型故障排查全记录
运维·服务器·debian·php
fiveym5 天前
PXE安装Debian报错:GRUB安装失败排查指南
运维·debian
NashSKY5 天前
RK3588 Debian 系统安装与WiFi/SSH配置笔记
debian·ssh·rk3588
小尘要自信6 天前
踩过坑才明白:为什么 ZooKeeper 集群才是正经事
分布式·zookeeper·debian
络合白泽7 天前
Debian 13 + NVIDIA Optimus 笔记本:从零配置 Wayland Explicit Sync 完整指南
运维·debian
键盘上的GG小怪兽GG10 天前
Debian 安装CUPS操作
linux·服务器·debian
AI帮小忙12 天前
Debian/Ubuntu 系操作系统 Kali2026 & 银河麒麟V10 使用对比
ubuntu·debian
韩明君15 天前
Debian12安装RabittMQ 4.3.0
linux·debian·高并发·debian12·rabittmq