Giter Club home page Giter Club logo

w801_cmake_template's Introduction

W801 VSCode CMake template

HLK-W801 Vscode 项目模板,使用 VSCode + CMake + Ninja 构建

本处使用的开发板为 HLK-W801-KIT-V1.1

注意:该仓库内的 SDK 有一定的改动,可能与官方的有出入

安装

  • 安装 CMake v3.20+ 以及 Ninja

    • 打开系统的 cmd,执行 cmake --helpninja --help 检查是否已安装完成
  • 克隆源码,在 VSCode 中打开工程文件夹:

    • 在当前工作区打开终端,执行 git submodule initgit submodule update,拉取子模块(此步骤要从 github 克隆仓库,请确保网络通畅
  • 安装 csky 编译器(系统中已安装则可忽略该步骤):

    • 打开工程的目录:sdk/tools/w800/toolchain/

    • csky-elfabiv2-tools-mingw-minilibc-20210423.7z 编译器解压,将解压后的目录移动到你的磁盘其他位置上

    • 打开系统属性->高级->环境变量设置,将解压后编译器的路径 xxx\xx\csky-elfabiv2-tools-mingw-minilibc-20210423\bin 设置到环境变量 Path

    • 保存设置,之后关闭所有 VSCode 实例

  • 再次打开 VSCode,打开工程的目录,在终端中执行 csky-elfabiv2-gcc -v 检查编译器是否已安装

  • 安装 VSCode 插件:CMake Tools


编译

  • 打开 CMake Tools 的工具栏

  • 选择 Configure All Projects 生成配置

  • 选择 w801.fls 为构建目标

  • 之后,点击旁边的 build 图标启动构建

  • 编译完成后,工程根目录下会生成一个 bin 文件夹,固件将存放在其中


烧录

  • 按下 ctrl+shift+B 打开可用任务,选择 flash (select serialport) 回车,之后输入串口名称,回车启动烧录

  • 烧录结束后,将打印如下 log:

  • 由于程序烧录完后立即开始运行,而烧录器串口打开较慢,因此 log 有些缺失,按下复位键重启程序即可看到完整 log:

本例程中,默认开启固件加密以及数字签名,上电后将校验固件签名

w801_cmake_template's People

Contributors

github0null avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

w801_cmake_template's Issues

windows编译提示脚本错误

[ DONE ] build successfully !, elapsed time 0:0:51

[ INFO ] run tasks after build ...

>> make bin             [done]

>> make fls             [failed]

bash ./make_img.sh "w801_eide_template" "d:\Users\workspace\iot\w801_vsc_eide_template\build\Release"

./make_img.sh: line 2: $'\r': command not found
./make_img.sh: line 4: $'\r': command not found
./make_img.sh: line 9: $'\r': command not found
./make_img.sh: line 114: syntax error: unexpected end of file

 *  Terminal will be reused by tasks, press any key to close it. 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.