7.4.4. 测试指南

7.4.4.1. 测试环境

7.4.4.1.1. 硬件

  • 开发板

7.4.4.1.2. 软件

  • PC端的串口终端软件,用于PC和开发板进行串口通信

  • test_gpai测试程序

7.4.4.1.3. 软件配置

7.4.4.1.3.1. test_gpai 配置

在 Luban-Lite 根目录下执行 scons --menuconfig,进入menuconfig的功能配置界面,按如下选择:

Drivers options  --->
    Drivers examples  --->
        [*] Enable GPAI driver test command

7.4.4.2. test_gpai 测试

在打开test_gpai的编译后,板子上可直接运行test_gpai命令:

aic /> test_gpai -h
Compile time: Jul 21 2023 09:21:53
Usage: test_gpai [options]:
     -c, --channel        Select one channel in [0, x], default is 0
     -t, --voltage        Modify default voltage
     -h, --help

Example: test_gpai -c 4 -t 3

标准电压:通过 eFuse 获取的电压。不同产品系列的标准电压如下所示:

  • D21x: 3.0 V

  • D13x: 2.5 V

默认电压:无法通过 eFuse 获取电压时才使用的电压。

小技巧

无法获取标准电压时,系统会返回信息提示: Failed to get standard voltage,此时需执行 -t, --voltage 命令配置默认电压。

7.4.4.3. ADC读取测试

ADC数据的读取可以使用shell命令 test_gpai ,每次可读取某一个通道中的当前数据。

aic /> test_gpai -c 4
GPAI ch4: 2432
GPAI ch4-voltage: 1.8043 #未获取到标准电压时,采用默认电压(即 "-t 所配置电压")进行计算
aic /> test_gpai -c 0
[W] hal_gpai_ch_is_valid()320 Ch0 is unavailable! # GPAI0通道没有打开
aic /> test_gpai -c 4 -t 6
GPAI ch4: 2501
GPAI ch4-voltage: 1.8043
aic /> test_gpai -t 6
Please select a channel first #设置标准电压前,需通过-c选择通道