01
VS Code下载地址:https://code.visualstudio.com/
LLVM下载地址:http://releases.llvm.org/download.html
Git下载地址:https://gitforwindows.org/
gcc-arm\-none-eabi-5\_4-2016q3-20160926-win32.exe
(md5)这里是一个2016年的,我目前也是用的这个,好像还有其他的新版的下载,GNU Arm Embedded Toolchain。正常安装后,记得需要将软件的安装目录下的bin文件夹设置进入环境变量PATH中。arm-none-eabi-gcc下载地址:https://launchpad.net/gcc-arm-embedded/+download
OpenOCD下载地址:http://gnutoolchains.com/arm-eabi/openocd/
STM32CubeMX链接:http://www.stm32cube.com/
02
help -> updater settings ->Connection Parameters
设置好网络后,才能下载固件包。.ioc
文件是STM32Cube的工程文件,Inc和Src是供用户修改的源码,Driver里是STM32和ARM CMSIS的库,最好不要修改。
"terminal.integrated.shell.windows": "D:\\Program Files\\Git\\bin\\bash.exe",
"terminal.external.windowsExec": "D:\\Program Files\\Git\\bin\\bash.exe"
c\_cpp\_properties.json
文件的配置文件。c\_cpp\_properties.json
配置文件,用来告诉VS Code我们定义的宏与文件的路径。{
"configurations": [
{
"name": "Win32",
"browse": {
"path": [
"${workspaceFolder}/",
"${workspaceFolder}/Drivers/CMSIS",
"${workspaceFolder}/Drivers/FWlib/inc",
"${workspaceFolder}/Drivers/CMSIS/startup",
"${workspaceFolder}/User/inc",
"${workspaceFolder}/User",
"${workspaceFolder}/ThirdParty/crclib/include"
],
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"${workspaceFolder}/",
"${workspaceFolder}/",
"${workspaceFolder}/Drivers/CMSIS",
"${workspaceFolder}/Drivers/FWlib/inc",
"${workspaceFolder}/Drivers/CMSIS/startup",
"${workspaceFolder}/User/inc",
"${workspaceFolder}/User",
"${workspaceFolder}/ThirdParty/crclib/include"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"__CC_ARM",
"USE_STDPERIPH_DRIVER",
"STM32F10X_HD"
],
"compilerPath": "C:\\Program Files\\LLVM\\bin\\clang-format.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
variable “uint32\_t” is not a type name
不是一个type类型。\_\_CC\_ARM
,如果没有该宏定义,则uint32\_t
类型会报错。并且结构体中使用了uint32\_t
定义的成员,也会补全不了。.c
文件 经过 arm-none-eabi-gcc
编译成 .o
文件.s
文件 经过 arm-none-eabi-as
编译成 .o
文件.o
文件 和 .a
文件 经过 arm-none-eabi-ld
链接成 .elf
文件.elf
文件 经过 arm-none-eabi-objcopy
和 arm-none-eabi-objdump
转换成 hex文件/dis
文件arm-none-eabi-gdb
使用 .elf
文件 进行debug03
openocd –f interface/stlink.cfg –f target/stm32f4.cfg
target remote localhost:3333
{
"version": "0.2.0",
"configurations": [
{
"name": "ARM Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/Build/STM32F103RC_Template.elf",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\5.4 2016q3\\bin\\arm-none-eabi-gdb.exe",
"targetArchitecture": "arm",
"setupCommands": [
{
"description": "选择调试文件(.elf)到gdb",
"text": "file E:/VScode/STM32_VSCode/stm32f103_temp/Build/STM32F103RC_Template.elf",
"ignoreFailures": false
},
{
"description": "连接GDB Server",
"text": "target remote localhost:3333",
"ignoreFailures": false
},
{
"description": "Reset MCU",
"text": "monitor reset",
"ignoreFailures": false
},
{
"description": "Halt",
"text": "monitor halt",
"ignoreFailures": false
},
{
"description":"下载代码到MCU",
"text": "load" ,
"ignoreFailures": false
}
],
"preLaunchTask": "build",
}
]
}
来源: https://blog.csdn.net/qq_33559992/article/details/97548915
声明: