Makefile形式创建项目
新建stm项目
https://blog.csdn.net/Brendon_Tan/article/details/107869664
下载stm32cubemx
https://www.st.com/en/development-tools/stm32cubemx.html
STM32f103C8T6
新建项目
IED makefile
保存到本地
arm gcc是编译的工具链
https://developer.arm.com/downloads/-/gnu-rm
G++配置
编译
Cmake +vscode +MSYS2方式
bilibili
MSYS2 统一环境配置
https://packages.msys2.org/packages/mingw-w64-x86_64-openocd
mingw32-make -> make
改名mingw32-make.exe -> make.exe
windows环境变量
Cmake CmakeList
cmake ..
OR
cmake -G Ninja ..
默认为ninja
nijia 编译输出elf
CMAKE_GENERATOR查询
message(STATUS "==========CMAKE_GENERATOR==========: ${CMAKE_GENERATOR}")
cmake .. -N -L
改为生成makefile文件
cmake -G "Unix Makefiles" ..
生成如下
make编译输出elf
make -j16
elf文件
烧录
openocd -f interface/stlink.cfg -f target/stm32f1x.cfg -c "program G:/WorkSpace_Thing/Stm32Test/build/Debug/Stm32Test.elf verify reset exit""
云调试
wokwi.toml
diagram.json
{
"version": 1,
"author": "Uri Shaked",
"editor": "wokwi",
"parts": [
{
"type": "board-stm32-bluepill",
"id": "stm32",
"top": -174.16,
"left": -262.83,
"attrs": {
}
},
{
"type": "wokwi-led",
"id": "led1",
"top": -174