一、.vscode配置文件
.cortex-debug.peripherals.state.json
[{"node":"WDOG","expanded":true,"format":0,"pinned":false},{"node":"WDOG.CS","expanded":true,"format":0}]
.cortex-debug.registers.state.json
[]
c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-arm",
"configurationProvider": "ms-vscode.cmake-tools",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
cmake-kits.json
[
{
"name": "S32K Toolchain",
"toolchainFile": ".\\cmake\\arm-gcc-cortex-m4.cmake",
"preferredGenerator": {
"name": "make"
}
}
]
.vscode\configurationCache.log
{"buildTargets":[],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[]},"fileIndex":[]}}
dryrun.log
make.exe --dry-run --keep-going --print-directory
launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug (J-Link)",
"type": "cortex-debug",
"request": "launch",
"servertype": "jlink",
"cwd": "${workspaceFolder}", //work directory
"executable": "./build/fct.elf",
"device": "S32K144",
"interface": "swd",
"serverpath": "C:/Program Files (x86)/SEGGER/JLink/JLinkGDBServerCL.exe",
"svdFile": "${workspaceFolder}/code/SDK/platform/devices/S32K144/S32K144.svd",
// "preLaunchTask": "Build", //先运行Build任务
// "ipAddress": ,
// "serialNumber": ,
}
]
}
settings.json
{
"C_Cpp.default.cStandard": "c11",
"C_Cpp.default.intelliSenseMode": "gcc-arm",
"C_Cpp.experimentalFeatures": "Enabled",
"C_Cpp.intelliSenseEngineFallback": "Enabled",
"files.associations": {
"*.ld": "arm",
"*.bin": "hexdump",
"rthw.h": "c",
"rtconfig.h": "c",
"rtthread.h": "c",
"adc.h": "c",
"task.h": "c",
"interrupt_manager.h": "c",
"kernel.h": "c",
"sim_hal_s32k144.h": "c",
"limits": "c",
"ucom.h": "c",
"ipc_spi_list.h": "c",
"pm.h": "c",
"gpio.h": "c",
"dbg_uart.h": "c",
"edma.h": "c",
"shell.h": "c",
"led.h": "c",
"acc.h": "c",
"config.h": "c",
"ipc_spi.h": "c",
"scom_tl.h": "c",
"pm_mode.h": "c",
"status.h": "c",
"gpio_hal.h": "c"
},
"cmake.copyCompileCommands": "./build",
"cmake.generator": "Ninja",
"cmake.mingwSearchDirs": [],
"cSpell.words": [
"STMIN",
"rpos"
]
}
tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"options": {
"cwd": "${workspaceRoot}/"
},
"command": "${workspaceRoot}/build.bat",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "Clean",
"type": "shell",
"options": {
"cwd": "${workspaceRoot}"
},
"command": "(${workspaceRoot}/clean.bat)",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "Rebuild",
"type": "shell",
"options": {
"cwd": "${workspaceRoot}/"
},
"command": "${workspaceRoot}/rebuild.bat",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
}
]
}
二、编译
工具选择S32K Toolchain
点击build开始编译,如果是移植会提示找不到工具链或者路径不正确,需要删除build文件夹下的文件。
最后结果:生成二进制文件 八进制文件 十六进制文件 map文件 code下面生成三个库文件