文章目录
- 运行环境:
- 1.1 gcc
- 1)下载并解压gcc
- 2)环境配置
- 2.1 openocd
- 1)下载并解压openocd
- 2)环境配置(没有权限就加sudo)
- 3.1 stlink
- 1)下载并双击安装stlink
- 4.1 cubeMX
- 1)下载并解压cubeMX
- 2)生成makefile工程
- 5.1 cortex Debug
- 1)setting设置
- 2)launch设置
- 3)实物展示
运行环境:
ubuntu18.04. melodic
宏基暗影骑士笔记本
1.1 gcc
1)下载并解压gcc
2)环境配置
sudo gedit /etc/profile
export PATH=$PATH:/home/duduzai/Documents/RM/stmpack/gcc-arm-none-eabi-10.3-2021.10/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/duduzai/Documents/RM/stmpack/gcc-arm-none-eabi-10.3-2021.10/lib
# 应用环境变量
source /etc/profile
# 查看是否安装成功
arm-none-eabi-gcc -v
2.1 openocd
1)下载并解压openocd
2)环境配置(没有权限就加sudo)
./bootstrap
./configure
# 编译安装
make
sudo make install
# 验证是否安装成功
openocd -v
3.1 stlink
1)下载并双击安装stlink
4.1 cubeMX
1)下载并解压cubeMX
2)生成makefile工程
5.1 cortex Debug
1)setting设置
{
"[python]": {
"editor.formatOnType": true
},
// "cortex-debug.armToolchainPath": ""
"cortex-debug.gdbPath": "/home/duduzai/Documents/RM/stmpack/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gdb",
"cortex-debug.openocdPath.linux": "/usr/local/bin/openocd",
"cortex-debug.armToolchainPath": "",
"terminal.integrated.enableMultiLinePasteWarning": false,
}
2)launch设置
{
"configurations": [
{
"showDevDebugOutput": "parsed",
"cwd": "${workspaceRoot}",
"executable": "./build/LED11.elf",
"name": "Debug STM32",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"device": "stm32f427",
"configFiles": [
"interface/stlink-v2-1.cfg",
"target/stm32f4x.cfg"
]
}
]
}
3)实物展示
F5 一键烧录调试