Edit online

OneStep 命令详解

14 Nov 2024
Read time: 5 minute(s)
OneStep 是 ArtInChip 对 SCons 工具二次封装的总称,在基础命令上开发了一组更高效和方便的快捷命令, 以实现任意目录、一步即达的目的。根据操作系统的不同,可能需要不同的设置:
  • Windows系统设置

    在 Windows 系统中,OneStep 自动集成到 win_cmd.batwin_env.bat 批处理脚本中。

    在 CMD 或者 ENV 窗口启动后,OneStep 命令已经生效,在其中可以从任意目录执行以下命令,包括:

    • lunch:选择方案

    • m:编译 SDK

    • c:clean SDK

    • cr:跳转到 SDK 根目录

  • Linux 系统设置
    在 Linux 系统中,需要将 OneStep 脚本添加到当前路径中,如执行以下命令:
    source tools/onestep.sh

    在 Ubuntu 终端中,进入 SDK 根目录后,使用 sourcetools/onestep.sh 命令即可查看所有常见命令,包括:

    $ h
    Luban-Lite SDK OneStep commands:
      hmm|h                     : Get this help.
      lunch          [keyword]  : Start with selected defconfig.e.g. lunch mmc
      menuconfig|me             : Config SDK with menuconfig
      m                         : Build all and generate final image
      mc                        : Clean & Build all and generate final image
      mb                        : Build bootloader & app and generate final image
      c                         : Clean all
      croot|cr                  : cd to SDK root directory.
      cout|co                   : cd to build output directory.
      cbuild|cb                 : cd to build root directory.
      ctarget|ct                : cd to target board directory.
      godir|gd       [keyword]  : Go/jump to selected directory.
      list                      : List all SDK defconfig.
      i                         : Get current project's information.
      buildall                  : Build all the *defconfig in target/configs
      rebuildall                : Clean and build all the *defconfig in target/configs
      addboard|ab               : Add new board *defconfig in target/configs
      aicupg                    : Burn image file to target board
    

命令列表

OneStep 提供了一系列子命令,如h|help显示帮助信息,lunch选择和启动指定的项目配置,menuconfig|mebm分别用于应用程序和引导加载程序的配置,m|mb构建引导加载程序和应用并生成最终镜像等。

详细命令列表如下所示:

$ h
Luban-Lite SDK OneStep commands:
    hmm|h                     : Get this help.
    lunch          [keyword]  : Start with selected defconfig.e.g. lunch mmc
    menuconfig|me             : Config application with menuconfig
    bm                        : Config bootloader with menuconfig
    km                        : Config application with menuconfig
    m|mb                      : Build bootloader & application and generate final image
    ma                        : Build application only
    mu|ms                     : Build bootloader only
    c                         : Clean bootloader and application
    mc                        : Clean & Rebuild all and generate final image
    croot|cr                  : cd to SDK root directory.
    cout|co                   : cd to build output directory.
    cbuild|cb                 : cd to build root directory.
    ctarget|ct                : cd to target board directory.
    godir|gd       [keyword]  : Go/jump to selected directory.
    list                      : List all SDK defconfig.
    list_module               : List all enabled modules.
    i                         : Get current project's information.
    buildall                  : Build all the *defconfig in target/configs
    rebuildall                : Clean and build all the *defconfig in target/configs
    addboard|ab               : Add new board *defconfig in target/configs
    aicupg                    : Burn image file to target board
 

查看所有配置

$ list
scons: Reading SConscript files ...
Built-in configs:
d12x_demo68-nand_rt-thread_helloworld_defconfig
0. d12x_demo68-nor_rt-thread_helloworld_defconfig
1. d12x_hmi-nor_rt-thread_helloworld_defconfig
2. d13x_demo68-nor_rt-thread_helloworld_defconfig
3. d13x_demo88-nand_rt-thread_helloworld_defconfig
4. d13x_demo88-nor_rt-thread_helloworld_defconfig
5. d13x_kunlunpi88-nor_rt-thread_helloworld_defconfig
6. d21x_d215-demo88-nand_rt-thread_helloworld_defconfig
7. d21x_d215-demo88-nor_rt-thread_helloworld_defconfig
8. d21x_demo100-nor_rt-thread_helloworld_defconfig
9. d21x_demo128-nand_rt-thread_helloworld_defconfig
10.g73x_demo100-nor_rt-thread_helloworld_defconfig
11.g73x_demo68-nor_rt-thread_helloworld_defconfig
12.g73x_scan_rt-thread_helloworld_defconfig
注: list 命令进行了显示项目精简,隐藏了 bootloader 的项目

加载配置

$ lunch 0
scons: Reading SConscript files ...
Load config from target\configs\d12x_demo68-nor_rt-thread_helloworld_defconfig

查看当前配置

$ i
scons: Reading SConscript files ...
Target app: application/rt-thread/helloworld
Target chip: d12x
Target arch: riscv32
Target board: target/d12x/demo68-nor
Target kernel: kernel/rt-thread
Defconfig file: target/configs/d12x_demo68-nor_rt-thread_helloworld_defconfig
Root directory: xxxxxxxxxxxxxx
Out directory: output/d12x_demo68-nor_rt-thread_helloworld
    Toolchain: toolchain/bin\riscv64-unknown-elf-

修改 RT-Thread 配置

$ me

修改 BootLoader 配置

$ bm

编译固件

$ m

清除编译

$ c