SDK 一键配置命令
Tina Linux SDK 提供 quick_config 功能,执行对应命令,可快速一键修改该功能相关的所有配置项。
备注
本文以 V821 作为示例,其余芯片平台使用方式与 V821 一致
:::
使用 quick_config
在 lunch 后, 输入 quick_config 命令回车:
$ quick_config
_____ _ _ _____ ___ _
| |_ _|_|___| |_| |___ ___| _|_|___
| | | | | | _| '_| --| . | | _| | . |
|__ _|___|_|___|_,_|_____|___|_|_|_| |_|_ |
|__| |___|
=============================================
Quick Config ToolKit: Version 2.0.4
=============================================
Available Quick Config Name:
[CPUCFG]
0 set_cpu_vf_0 : Set cpu 960mhz (0.92v)
1 set_cpu_vf_2 : Set cpu 1200mhz (1.00v)
2 config_v821 : Set driver config for v821
3 config_v821b : Set driver config for v821b
4 config_v821_integrated_wifi : Set wi-fi driver for v821
5 config_v821b_integrated_wifi : Set wi-fi driver for v821b
[DEBUG]
6 disable_sdc0 : Disable sdc0 for rtos uart pinmux
7 debug_linux_function : Open kallsyms and debug_fs for kernel debug
8 close_debug_linux_function : Close kallsyms and debug_fs for kernel debug
9 open_boot0_uart_print : Open boot0 uart print for debug
10 open_linux_uart_print : Open linux uart print for debug
11 open_rtos_uart_console : Open rtos uart for rtos debug
12 open_all_uart_print : Open rtos boot0 linux uart for debug
13 close_boot0_uart_print : Close boot0 uart print
14 close_linux_uart_print : Close linux uart print
15 close_rtos_uart_console : Close rtos uart console
16 close_all_uart_print : Close rtos boot0 linux uart print
[KERNEL]
17 kernel compression lzma : Set kernel compression method to lzma.
18 kernel compression gzip : Set kernel compression method to gzip.
19 kernel compression none : Set kernel compression method to none.
[MPP]
20 mpp_compile_dynamic_lib : Set mpp compile dynamic lib for this board
21 mpp_compile_static_lib : Set mpp compile static lib for this board
22 de_resize_config : Open de resize function for person detection
23 ve_freq_512M : Set ve freq to 512m for this board
24 ipc_demo : Enable ipc demo for this board
25 cdr_demo : Enable cdr demo for this board
26 tuya_demo : Enable tuya ipc demo
27 keyword_spotting_demo : Enable keyword_spotting demo
28 enable_uvc_and_demo : Enable uvc and demo
[SYSTEM]
29 config_debug_baud_115200 : Set debug serial baud to 115200
30 config_debug_baud_1500000 : Set debug serial baud to 1500000
31 memory_optimization : Set memory optimization for kernel, will disable some less commonly used functions
32 product_close_debug_config : Close debug configs for mass production
33 secure_firmware : Set to build secure firmware for this board
[TOOLCAHIN]
34 musl_toolchain : Change this board cross toolchain to musl
35 glibc_toolchain : Change this board cross toolchain to glibc
[WLAN]
36 config_v821b_integrated_bluetooth : Set integrated bluetooth configure, only enable ble-server role
37 config_v821b_integrated_bluetooth_general : Set integrated bluetooth configure, enable ble-server and ble-client role
38 config_v821b_integrated_bluetooth_full : Set integrated bluetooth configure, enable ble all functions
39 v821_smac : Set v821 smac for this board
40 disable_v821_integrated_wifi : Set to disable v821 integrated wifi (for v821l2-xxx)
41 v821_smac_etf : Set v821 smac_etf for this board
42 v821_fmac_etf : Set v821 fmac_etf for this board
43 v821_fmac_etf_on_ext : Set v821 fmac_etf for this board, compile as ko to external storage device
Which would you like?
- 输入
quick_config命令后,根据需要,选择上面序列号并回车,回车输入y(注意输入y后会修改本地环境的一些配置),就会自动修改相关配置文件,具体修改了哪些文件,执行y命令后会全部打印显示出来。请注意留意有些配置项输入y之后会提示一些额外操作,确保配置生效。 - 输入
quick_config命令后,若不需选择,直接回车即可,不会修改任何文件。 - 使用
quick_config命令配置后,这些改动是直接修改SDK中相关的文件,目前不支持清理命令。如果需要清理这些修改,需要手动使用git命令清理,或者根据quick_config命令执行后的提示,恢复相关的配置项。
quick_config 使用示例
切换板级摄像头到双目GC2083
更换摄像头模组为双目模组,可以使用 quick_config 修改配置到双目 GC2083 模组,输入 qucik_config 后可以看到选项 one_gc2083_sensor 编号为22,输入后即可切换配置。
Loading asciinema cast...
切换板级摄像头到双目GC2083
更换摄像头模组为双目模组,可以使用 quick_config 修改配置到双目 GC2083 模组,输入 qucik_config 后可以看到选项 dual_gc2083_sensor 编号为9,输入后即可切换配置。

切换储存介质为 SPI NAND
切换储存器为NAND,输入 quick_config,可以看到用于切换的quick_config 是18,输入 18,之后会出现一个确认项,确认后将会自动执行其配置操作。

切换 MPP 为动态库编译
默认配置下,MPP 是静态库编译的,这里可以用 quick_config 切换到动态库编译。输入 quick_config 选择选项 19,然后确认

在切换后有提示,需要手动清除 mpp 的编译产物重新编译 mpp

切换工具链为glibc库
SDK 默认配置使用的库是 MUSL 库,可以通过 quick_config 切换到使用 glibc 库。输入 quick_config 然后选择选项。
注意部分 quick_config 在执行前需要有其他的操作,请按照提示进行操作,例如切换工具链,会有如下提示。如果没按照要求执行可能会导致SDK无法编译通过,quick_config 也对部分文件做了检查,如果无视提示直接跳过,会直接报错。
例如这里,SDK 提示需要删除编译产物,需要手动执行 make distclean 然后再执行切换工具链的操作。

如果无视,没有执行清理编译产物的操作,则报错退出

执行了 make distclean 后,正常操作

Quick Config 使用说明
整体框架
quick_conf test
|--- 找到 quick_config.json,并解析
|--- 修改内核 ---> 引入fragment
|--- ${TINA_TOPDIR}/build.sh loadconfig lock_defconfig.fragment
|--- ${TINA_TOPDIR}/build.sh saveconfig
|--- 修改uboot的配置
|--- 修改 board.dts ---> 脚本处理
|--- 修改 boot_package_nor.fex ---> 脚本处理
|--- 修改 sys_config.cfg ---> 脚本处理
|--- 修改 uboot-board.dts ---> 脚本处理
|--- 修改 env.dts ---> 脚本处理
|--- 修改 tina defconfig ---> 脚本处理
脚本框架

使用方法
usage: quick_config [-h] [-c [CONFIG]] [-f] [-i [INCLUDE]] [-gd] buildconfig
positional arguments:
buildconfig the buildconfig file
optional arguments:
-h, --help show this help message and exit
-c [CONFIG], --config [CONFIG]
configuration items that need to be loaded (optional)
-f, --force force exec quick config item, no check, use at your own risk
-i [INCLUDE], --include [INCLUDE]
include quick_config config file in default/quick_config
-gd, --gen_dts_base generate quick_config base with given dts node
注意事项
在 JSON 对象 中,元素是以键值对的形式表示的,每个键值对之间使用逗号分隔。最后一个键值对后不加逗号, JSON 规范规定不能在对象的结尾处使用多余的逗号。
在 JSON 数组 中,数组的元素之间用逗号分隔,最后一个元素后也不加逗号。
如果在最后一项后加逗号,可能导致解析错误,特别是在不同语言或工具中处理时。因此,为了确保 JSON 数据的有效性和跨平台的兼容性,最后一项后不加逗号是必须遵守的规范。
在VSCode中,错误使用逗号会显示警告 Trailing comma
