【前言】
最近调通了gd32f527的Zephyr工程,然后国产的雅特力还没有人接手做Zephyr的移植,我准备把手上的开发板利用起来,给国产的芯片移植到Zephyr生态贡献一份力量。
要移植Zephyr,那么首先需要整理好在vscode下面开发板的基础工作。雅特力刚好提供了vscode的模工程,此次是下载官方的vscode模版库,然后完成配置,实现在vscode下面的开发、下载、调试等工作。
首先下载官方的AN0130_AT32_MCU_Develop_With_VSCode_V2.0.5.zip库,这个库我上传到附件。
解压后,使用vscode打开at32f423的模版库
工具链目录结构D:\AT32F423\SourceCode\software_tool\tool_for_windows\ ├── OpenOCD_V2.0.2\ # OpenOCD 调试器 │ ├── bin\openocd.exe │ └── scripts\ │ ├── interface\atlink.cfg │ └── target\at32f423xx.cfg └── gcc-arm-none-eabi-10.3-2021.10-win32.exe C:\Users\liujianhua\.eide\tools\gcc_arm\bin\ └── arm-none-eabi-gcc.exe # GCC 编译工具链修改配置如下:
{
"configurations": [
{
"cwd": "${workspaceRoot}",
"type": "cortex-debug",
"request": "launch",
"name": "openocd-launch",
"armToolchainPath": "C:/Users/liujianhua/.eide/tools/gcc_arm/bin",
"gdbPath": "C:/Users/liujianhua/.eide/tools/gcc_arm/bin/arm-none-eabi-gdb.exe",
"interface": "swd",
"servertype": "openocd",
"serverpath": "D:/AT32F423/SourceCode/software_tool/tool_for_windows/OpenOCD_V2.0.2/bin/openocd.exe",
"configFiles": [
"D:/AT32F423/SourceCode/software_tool/tool_for_windows/OpenOCD_V2.0.2/scripts/interface/atlink.cfg",
"D:/AT32F423/SourceCode/software_tool/tool_for_windows/OpenOCD_V2.0.2/scripts/target/at32f423xx.cfg"
],
"executable": "build/at32f423_template.elf",
"svdFile": "project/misc/AT32F423xx_v2.svd",
"runToEntryPoint": "main"
}
]
}{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "make",
"args": ["-j4"],
"problemMatcher": []
},
{
"label": "clean",
"type": "shell",
"command": "make",
"args": ["clean"],
"problemMatcher": []
},
{
"label": "download code",
"type": "process",
"command": "D:/AT32F423/SourceCode/software_tool/tool_for_windows/OpenOCD_V2.0.2/bin/openocd.exe",
"args": [
"-f", "D:/AT32F423/SourceCode/software_tool/tool_for_windows/OpenOCD_V2.0.2/scripts/interface/atlink.cfg",
"-f", "D:/AT32F423/SourceCode/software_tool/tool_for_windows/OpenOCD_V2.0.2/scripts/target/at32f423xx.cfg",
"-c", "program build/at32f423_template.hex",
"-c", "exit"
],
"problemMatcher": []
}
]{
"configurations": [
{
"name": "Win32",
"includePath": [
"C:/Users/liujianhua/.eide/tools/gcc_arm/arm-none-eabi/include",
"${workspaceFolder}/project/inc",
"${workspaceFolder}/project/board",
"${workspaceFolder}/libraries/cmsis/cm4/core_support",
"${workspaceFolder}/libraries/cmsis/cm4/device_support",
"${workspaceFolder}/libraries/drivers/inc",
"${workspaceFolder}",
"${workspaceFolder}/libraries/cmsis/cm4/device_support"
],
"defines": [
"_DEBUG", "UNICODE", "_UNICODE",
"AT_START_F423_V1",
"AT32F423VCT7",
"USE_STDPERIPH_DRIVER"
],
"compilerPath": "C:/Users/liujianhua/.eide/tools/gcc_arm/bin/arm-none-eabi-gcc.exe",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}3. 调试: F5 或点击调试按钮
附:工程模板
at32f423.zip