基于Ubuntu+Eclipse+GDB+OpenOCD+STlink搭建STM32开发环境
Eclipse下载安装
下载
安装(解压)
tar zxvf 20200127-1311-gnumcueclipse-4.7.2-2019-12-R-linux.gtk.x86_64.tar.gz
Java jdk下载安装
Java SE Development Kit 8 Downloads
tar zxvf jdk-8u251-linux-x64.tar.gz
Eclipse运行
拷贝jdk目录下的jre文件夹到eclipse目录下
cp -r jdk1.8.0_251/jre eclipse
执行
eclipse
编译测试
File->New->Project
一路Next到配置交叉编译工具链路径
编译
OpenOCD下载安装配置
下载
https://github.com/ilg-archived/openocd/releases
安装(解压)
tar zxvf gnu-mcu-eclipse-openocd-0.10.0-12-20190422-2015-centos64.tgz
Debug配置
Config options:
-f "board/st_nucleo_f4.cfg"
-c "gdb_breakpoint_override hard"
Download配置
-f "board/st_nucleo_f4.cfg"
-c init
-c "reset halt"
-c "flash write_image erase Debug/STM32F4.elf"
-c "reset halt"
-c "verify_image Debug/STM32F4.elf"
-c "reset run"
-c shutdown