cmake编译S32K的bin文件(4)

一、.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下面生成三个库文件

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值