本章节旨在介绍 SDK 提供的 shell 命令及用户操作指南。
SDK 已开放 shell 指令的部分源码,用户可以根据需求调整格式以及增加新的 shell 指令。
通过 csk6 调试串口在 ap 侧按下 Tab 键或者输入 help 可以查看支持的 shell 命令:
player.vol.set player set volume
player.pause.tone player stop tone
player.play.tone player play tone
player.stop.url player stop url
player.resume.url player resume url
player.pause.url player pause url
player.play.url player play url
loglev set all log lev
flash.setloglev lisa log lev (0/1/2/3/4/5)
flash.get.int get int KV from flash
flash.get.string get string KV from flash
flash.set.int set int KV in flash
flash.set.string set string KV in flash
flash.show show flash info
flash.clear clear KV in flash
pa_switch switch pa on / off
pref.flush flush pref cache
algo_work_mode_set algo_mode cmd
algo_restart algo_restart cmd
heart.drop ignore cp heart
wdt.block wdt block evs_event thread by s
switch_mode switch wakeup mode
net.setlogmask set net logmask: [bit0 - bit8]
net.setloglev set net loglev: [0 - 6]
player.setloglev set player loglev
play.gain.digit digit gain [-113db, 30db] step 1db
play.gain.analog analog gain [-24, 6] step 2
clock show system clocks
tasks show system tasks
heapinfo show heap usage information
config system config
reboot system reboot
status system status
version system version
debug debug level(0/N,1/E,2/W,3/I,4/D,5/V,6/A)
help help [cmd]
clear clear console
dump memory dump
run run <addr> [...]
常用 shell 命令:
命令 | 参数 | 功能 | 示例 |
---|---|---|---|
help | 其他命令 | 查看支持的 shell 命令及使用说明 | help / help reboot |
player.vol.set | 音量值 | 设置播放器音量 | player.vol.set 100 |
player.play.tone | 提示音id | 播放本地提示音 | player.play.tone 1 |
player.pause.tone | 无 | 暂停本地提示音 | player.pause.tone |
player.play.url | 在线url | 播放在线url | player.play.url http://***.mp3 |
player.pause.url | 无 | 暂停播放在线url | player.pause.url |
player.resume.url | 无 | 恢复播放在线url | player.resume.url |
player.stop.url | 无 | 停止播放在线url | player.stop.url |
loglev | 日志等级 | 设置所有的日志等级 (system/player/debug) |
loglev 4 |
flash.setloglev | 日志等级 | 设置系统的日志等级 | flash.setloglev 4 |
flash.set.int | key@value | 保存int数据 | flash.set.int K_INT@1 |
flash.get.int | key | 获取int数据 | flash.get.int K_INT |
flash.set.string | key@value | 保存string数据 | flash.set.string K_STRING@1 |
flash.get.string | key | 获取string数据 | flash.get.string K_STRING |
flash.show | 无 | 显示保存的数据 | flash.show |
flash.clear | key | 清除保存的数据 | flash.clear K_INT |
factorytest.uart | 无 | 产测串口测试 | factorytest.uart |
factorytest.mic | 无 | 产测mic喇叭测试 | factorytest.mic |
pa_switch | 0/1 | PA 开关 | pa_switch 0 pa_switch 1 |
algo_work_mode_set | 0/1/3 | 设置工作模式 | ivw模式: algo_work_mode_set 0 esr模式: algo_work_mode_set 1 multiple模式: algo_work_mode_set 3 |
record.ctrl | 1 | 打开CP端I2S录音 | record.ctrl 1 |
demo.gpadc | 无 | gpadc demo | demo.gpadc |
demo.timer | 无 | timer demo | demo.timer |
demo.spi | 无 | spi demo | demo.spi |
demo.player.tone | 提示音id | 播放本地提示音 | demo.player.tone 1 |
demo.player.url | 在线url | 播放在线url | demo.player.url http://***.mp3 |
demo.gpio.int | 无 | gpio输入demo | demo.gpio.int |
demo.gpio.output | 无 | gpio输出demo | demo.gpio.output |
demo.key | 无 | 按键demo | demo.key |
demo.i2c | 无 | i2c demo | demo.i2c |
demo.pwm | 无 | pwm demo | demo.pwm |
demo.ledc | 无 | ledc demo | demo.ledc |
esr_timeout | 秒 | 设置识别模式超时时间 | esr_timeout 10 |
switch_mode | 0/1 | 设置识别模式 | 切换到唤醒模式: switch_mode 0 切换到识别模式: switch_mode 1 |
net.wifi.open | ssid、pwd | 联网命令 | net.wifi.open {\"ssid\":\"hello\",\"pwd\":\"listenai6661818\"} |
net.setloglev | 日志等级 | 设置网络日志等级 | net.setloglev 4 |
player.setloglev | 日志等级 | 设置播放器日志等级 | player.setloglev |
ref.gain.analog | 增益 | 设置参考增益 | ref.gain.analog 12 |
mic.gain.analog | 增益 | 设置MIC增益 | mic.gain.analog 36 |
play.gain.digit | 增益 | 设置DAC数字增益 | play.gain.digit-2 |
play.gain.analog | 增益 | 设置DAC模拟增益 | play.gain.analog -2 |
clock | 无 | 显示clock | clock |
tasks | 无 | 显示task | tasks |
heapinfo | 无 | 显示内存信息 | heapinfo |
reboot | 无 | 重启 | reboot |
version | 无 | 显示版本号 | version |
debug | debug等级 | 设置debug显示日志等级 | debug 4 |
clear | 无 | 清屏 | clear |
dump | 地址 大小 | 输出指定地址、指定大小的数据 | dump 0x0 16 |
run | 地址 | 运行指定地址 | run 0x0 |