当前位置: 首页 > news >正文

海淀深圳网站建设公司企业网站建设费用深圳

海淀深圳网站建设公司,企业网站建设费用深圳,新网站如何才做被百度收录,重庆企业网站建设联系电话安装 JLINK JLINK 官网链接 下载安装后找到安装路径下的可执行文件 将此路径添加到环境变量的 Path 中。 创建 JFlash 项目 打开 JFlash,选择新建项目 选择单片机型号 在弹出的窗口中搜索单片机 其他参数根据实际情况填写 新建完成: 接下来设置…

安装 JLINK

JLINK 官网链接
在这里插入图片描述
下载安装后找到安装路径下的可执行文件
在这里插入图片描述
将此路径添加到环境变量的 Path 中。

创建 JFlash 项目

打开 JFlash,选择新建项目
在这里插入图片描述
选择单片机型号
在这里插入图片描述
在弹出的窗口中搜索单片机
在这里插入图片描述
其他参数根据实际情况填写
在这里插入图片描述
新建完成:
在这里插入图片描述
接下来设置一下项目
在这里插入图片描述
把 Start Application 勾上,复位方式选择通过复位引脚复位。如果没有这个硬件条件则使用软件复位。
在这里插入图片描述
最后保存工程
在这里插入图片描述
在这里插入图片描述

编写 powershell 脚本

新建一个脚本叫 jlink-release-download.ps1

# 项目参数
$project_name = "test"
$cmake_config = "gcc-release"
$project_path = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$workspace_path = Split-Path $project_path -Parent
$build_path = "$workspace_path/out/build/$cmake_config"
$install_path = "$workspace_path/out/install/$cmake_config"# 开始操作
New-Item -Path $build_path -ItemType Directory -Force
Push-Location $build_path
try
{cmake -G "Ninja" $workspace_path `--preset "$cmake_config"if ($LASTEXITCODE){throw "配置失败"}ninja -j12if ($LASTEXITCODE){throw "编译失败"}ninja install
}
finally
{Pop-Location
}Push-Location $install_path
try
{arm-none-eabi-objcopy -O binary `"$install_path/bin/${project_name}.elf" `"$install_path/bin/${project_name}.bin"$jflash_arg_array = @("-openprj${workspace_path}/jflash-project.jflash","-open${install_path}/bin/${project_name}.bin,0x8000000","-auto","-startapp","-exit")$jflash_arg = $jflash_arg_array -join " "$jflash_arg = $jflash_arg.Trim()Write-Host $jflash_argStart-Process -FilePath "JFlash.exe" `-ArgumentList $jflash_arg `-WindowStyle Normal `-Waitif ($LASTEXITCODE){throw "将 ${project_name}.bin 下载到单片机失败。"}Write-Host "将 ${project_name}.bin 下载到单片机成功。"
}
finally
{Pop-Location
}

项目参数部分根据实际情况修改。

为 DEBUG 配置也创建一个 powershell 脚本,叫作 jlink-debug-download.ps1

# 项目参数
$project_name = "test"
$cmake_config = "gcc-debug"
$project_path = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$workspace_path = Split-Path $project_path -Parent
$build_path = "$workspace_path/out/build/$cmake_config"
$install_path = "$workspace_path/out/install/$cmake_config"# 开始操作
New-Item -Path $build_path -ItemType Directory -Force
Push-Location $build_path
try
{cmake -G "Ninja" $workspace_path `--preset "$cmake_config"if ($LASTEXITCODE){throw "配置失败"}ninja -j12if ($LASTEXITCODE){throw "编译失败"}ninja install
}
finally
{Pop-Location
}Push-Location $install_path
try
{arm-none-eabi-objcopy -O binary `"$install_path/bin/${project_name}.elf" `"$install_path/bin/${project_name}.bin"$jflash_arg_array = @("-openprj${workspace_path}/jflash-project.jflash","-open${install_path}/bin/${project_name}.bin,0x8000000","-auto","-startapp","-exit")$jflash_arg = $jflash_arg_array -join " "$jflash_arg = $jflash_arg.Trim()Write-Host $jflash_argStart-Process -FilePath "JFlash.exe" `-ArgumentList $jflash_arg `-WindowStyle Normal `-Waitif ($LASTEXITCODE){throw "将 ${project_name}.bin 下载到单片机失败。"}Write-Host "将 ${project_name}.bin 下载到单片机成功。"
}
finally
{Pop-Location
}

创建 task.json

在 vscode 项目根目录下的 .vscode 目录创建 task.json 文件
在这里插入图片描述
填入以下内容:

{"version": "2.0.0","tasks": [{"label": "stflash-release-download","type": "shell","command": "pwsh","args": ["./stflash-release-download.ps1"],"options": {"cwd": "${workspaceFolder}/test"},"problemMatcher": []},{"label": "stflash-debug-download","type": "shell","command": "pwsh","args": ["./stflash-debug-download.ps1"],"options": {"cwd": "${workspaceFolder}/test"},"problemMatcher": []},{"label": "jlink-debug-download","type": "shell","command": "pwsh","args": ["./jlink-debug-download.ps1"],"options": {"cwd": "${workspaceFolder}/test"},"problemMatcher": []},{"label": "jlink-release-download","type": "shell","command": "pwsh","args": ["./jlink-release-download.ps1"],"options": {"cwd": "${workspaceFolder}/test"},"problemMatcher": []},],
}
  • args 是传递给 pwsh 进程的参数,向它传递 ps1 文件。
  • cwd 是启动 pwsh 进程时赋予它的当前路径,将它改成刚刚创建的 ps1 文件所在的目录。

创建 launch.json

在 vscode 项目根目录的 .vscode 目录创建 launch.json 文件
在这里插入图片描述
填入以下内容

{// 使用 IntelliSense 了解相关属性。// 悬停以查看现有属性的描述。// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387"version": "0.2.0","configurations": [{"name": "ST-Link Debug","preLaunchTask": "stflash-debug-download","cwd": "${workspaceFolder}/out/install/gcc-debug/bin/","executable": "${workspaceFolder}/out/install/gcc-debug/bin/test.elf","request": "launch","type": "cortex-debug","runToEntryPoint": "main","servertype": "stlink","showDevDebugOutput": "raw","liveWatch": {"enabled": true,"samplesPerSecond": 4},},{"name": "JLink Debug","preLaunchTask": "jlink-debug-download","cwd": "${workspaceFolder}/out/install/gcc-debug/bin/","executable": "${workspaceFolder}/out/install/gcc-debug/bin/test.elf","request": "launch","type": "cortex-debug","runToEntryPoint": "main","servertype": "jlink","showDevDebugOutput": "raw","device": "STM32H743II","liveWatch": {"enabled": true,"samplesPerSecond": 4},"serverArgs": ["-if","JTAG"],}]
}

CMakePresets.json

附上我的 CMakePresets.json 文件的内容。这不是本文要讲述的。本文只讲述如何在已经配置好 cmake 和 GNU 工具链的情况下配置 JLINK

{"version": 3,"configurePresets": [{"name": "options","hidden": true,"cacheVariables": {"platform": "arm-none-eabi-cortex-m7","obj_copy": "arm-none-eabi-objcopy","CMAKE_SYSTEM_PROCESSOR": "arm","CMAKE_SYSTEM_ARCH": "armv7-m","CMAKE_SYSTEM_NAME": "Generic","CMAKE_C_COMPILER": "arm-none-eabi-gcc","CMAKE_CXX_COMPILER": "arm-none-eabi-g++","CMAKE_ASM_COMPILER": "arm-none-eabi-gcc","CMAKE_LINKER": "arm-none-eabi-ld","CMAKE_SIZE": "arm-none-eabi-size","CMAKE_STRIP": "arm-none-eabi-ld"},"vendor": {"microsoft.com/VisualStudioSettings/CMake/1.0": {"intelliSenseMode": "linux-gcc-arm","disableExternalAnalysis": true}}},{"name": "gcc-debug","displayName": "gcc-debug","inherits": "options","generator": "Ninja","binaryDir": "${sourceDir}/out/build/${presetName}","installDir": "${sourceDir}/out/install/${presetName}","cacheVariables": {"CMAKE_BUILD_TYPE": "Debug"}},{"name": "gcc-release","displayName": "gcc-release","inherits": "options","generator": "Ninja","binaryDir": "${sourceDir}/out/build/${presetName}","installDir": "${sourceDir}/out/install/${presetName}","cacheVariables": {"CMAKE_BUILD_TYPE": "Release"}}]
}
http://www.yayakq.cn/news/934416/

相关文章:

  • 龙岗营销网站建设专门教人做点心的网站
  • 企业网站源码生成微网站用手机可以做吗
  • 写作网站大全php网站培训机构企业做网站
  • iis5.1怎么发布网站微信网站开发视频教程
  • 中山网站建设思用织梦做网站后面可以改吗
  • 湖州猪八戒做网站用html做个人网站代码
  • 网站后台标签切换泉州网站建设企业
  • 网站布局中医院网站模板
  • 网站开发实例教程广告页面设计软件
  • 求网站建设详细过程英文专业的网站建设
  • 做ppt的图片网站有哪些成立公司协议
  • 网站编辑前端可以做吗网站的落地页
  • 萝岗企业网站建设仿网易考拉网站建设
  • 常州网站推广公司哪家好诸城网站制作
  • 化妆品网站栏目设计音乐网站源码带手机版
  • 女生做a视频的网站是什多少做电路方案设计的网站
  • 企业网站文化建设固原建站公司
  • 免费浏览的网站入口wordpress 网页图标
  • html5做图书馆网站家教辅导培训网站建设
  • 网站建设 选择题互联网推广平台
  • 帝国cms添加网站地图彩票做网站
  • 长春如何建立一个平台网站设建网站
  • 大连哪里做网站怎么使用模板建设网站
  • 金华浦江网站建设山儿网站建设公司
  • 微信手机网站设计6seo分析案例
  • 青岛外贸网站建站公司杭州门户网站建设公司
  • 中国建设部网站查询网新浪微博网页版
  • 企业网站维护建设项目实践报告怎么做网站登录界面
  • 无锡梅村网站建设金顶街网站建设
  • 企业网站的推广阶段和特点怎么看别人的网站有没有做301