Step1 准备软件,安装环境:
1. cubemx v6.5.0(可以兼容以前版本的project)
https://www.st.com.cn/zh/development-tools/stm32cubemx.html
STM32CubeMX 默认安装目录, 6.5版本可以兼容老版本
C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX
打开后选择help => 更新Firmware
里面的updater settings
reflash data
manage imbeded software packages 保留最新的一个
2. openocd
openocd-20231002.7z
https://gnutoolchains.com/arm-eabi/openocd/
解压缩到 D:\service\stm32\OpenOCD-20231002-0.12.0
3. arm-none-eabi
gcc-arm-none-eabi-5_4-2016q3-20160926-win32.zip
https://launchpad.net/gcc-arm-embedded/+download
解压缩到 D:\service\stm32\gcc-arm-none-eabi-5_4-2016q3-20160926-win32
4. Mingx64
ref: https://blog.csdn.net/m0_52559040/article/details/131603782
x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev0.7z
https://github.com/niXman/mingw-builds-binaries/releases
- posix:这些压缩包适用于符合POSIX标准的操作系统,如Linux、UNIX等。
(我由于Linux和Windows经常切着用,所以选择posix,如果你只用Windows开发,那么选win32即可)
解压缩到 D:\service\stm32\mingw64
----------------------------------------------------------------------
Step2 环境变量:
搜索 view advanced system settings
打开 高级系统设置 =>环境变量
ARM_NONE_EABI_HOME D:\service\stm32\arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi\arm-none-eabi
OpenOCD_HOME D:\service\stm32\OpenOCD-20231002-0.12.0
MINGW64_HOME D:\service\stm32\mingw64
path add the following:
%ARM_NONE_EABI_HOME%\bin
%OpenOCD_HOME%\bin
%MINGW64_HOME%\bin