[Offline Voice Feature ①] Anxinke's latest offline voice module VC series factory firmware tutorial - SDK open source?


foreword

       The newly released VC series offline voice module of Essence adopts the cloud voice solution, and continuously optimizes and innovates the algorithm in speech recognition technology. The offline recognition algorithm is deeply integrated with the chip architecture to provide customers with ultra-low-cost offline voice recognition solutions. It can be widely and quickly applied to smart home, various smart small appliances, 86 boxes, toys, lamps and other products that require voice control. Specific performance:

  • Support wake-up word self-learning (meaning you can add wake-up words without programming)
  • Support Chinese and English (different firmware)
  • 1~5m far field 90% recognition rate
  • Support RTOS lightweight system
  • Support GPIO control, UART, IIC, SPI and other communication protocols
  • Support serial port upgrade

       There are two modules and their development boards in the VC series. The factory firmware of the development board is different from the factory firmware of the module.

Product number Power Requirements package size Default communication interface
VC-01 module 3.6-5V,I>500mA SMD-24 25.5243.2(±0.2)mm UART1
VC-02 module 3.6-5V,I>500mA SMD-20 18173.2(±0.2)mm UART1
VC-02-Kit development board 5V,I>500mA DIP-19 42.2*35.6(±0.2)mm UART1
VC-01-Kit development board 5V,I>500mA DIP-19 42.2*35.6(±0.2)mm UART1

1. Preparation before use

1. Communication interface connection

       If the module is used for serial connection, it is recommended to use the following interfaces for communication: RX1, TX1.
insert image description here
If you use a development board, you can directly debug it with the USB port. The connection between the module and the microcontroller or TTL module is shown:
insert image description here

UART1 default serial port configuration:

  • Baud rate: 115200
  • Data bits: 8
  • stop bit: 1
  • Check Digit: None
  • flow control: None

UART0(TX0:IOB8)Log output configuration

  • Baud rate: 57600
  • Data bits: 8
  • stop bit: 1
  • Check Digit: None
  • flow control: None

2. Development board hardware description

       VC-01 and VC-02 share a development board:
insert image description here

3. Burning Instructions

       There are two programming methods for VC series:

  • JTAG debugger burning
           JTAG debugger The burning method is to use a dedicated JTAG debugger to burn the complete firmware. The software used is: UniOneDownloadTool.exe, and the file name of the general firmware is:uni_app_release.bin
  • Serial burning
           The serial burning method uses the TTL module to upgrade the firmware. There is no requirement for the module. The software used is: UniOneUpdateTool.exe, and the file name of the general firmware is:uni_app_release_update.bin

The two programming methods will be described in detail below.

(1) JTAG programming wiring and programming introduction

       The JTAG programming method can only use a dedicated JTAG debugger, and does not support programming with debuggers such as J-link.
insert image description here
The connection between the JTAG debugger and the VC series is as follows:
insert image description here
       After the connection is complete, insert the debugger into the computer (the debugger needs to install the driver, please see the installation tutorial: Hummingbird-M-Production-Tool/M_Download_Tool_User_Guide.pdf), open UniOneDownloadTool.exe: the
insert image description here
burning process:
insert image description here

(2) UART serial port upgrade wiring and programming introduction

       The wiring of serial programming is the same as the wiring of communication mode, so there is no special attention. The most important thing is that the firmware to be burned has some requirements:

  • The first time you need to burn the uni_app_release.binfirmware or uni_app_debug.binfirmware under "uni_hb_m_solution\image_demo\Hummingbird-M-Update-Tool". (The factory firmware has been burned)
  • The burned firmware must be generated using the build.sh updatecommanduni_app_release_update.bin
  • The burning tool can only be used: UniOneUpdateTool.exe

The following starts the delay programming process:
insert image description here
insert image description here

Note: The background color of all port numbers successfully opened will be yellow

2. Use of module factory firmware

1. Instruction word and instruction code

       In the module factory firmware, some common commands and their corresponding command codes are written by default.

command word Instruction code (hexadecimal output) response word
Xiao An Xiao An | Xiao An classmate | Hello Xiao An 0x5a 0x0 0x0 0x0 0x5a Master, you say|I am here, you say|I am here
back off | goodbye 0x5a 0x01 0x00 0x00 0x5b call me again
Turn on the lamp|Please turn on the light|Turn on the light|Turn on the light|I'm back 0x5a 0x02 0x00 0x00 0x5c Lighting is turned on for you
Turn off the desk lamp|Please turn off the light|Turn off the light|Sleep|Turn off the light|I'm out 0x5a 0x03 0x00 0x00 0x5d Lighting is turned off for you
brighter | brighter 0x5a 0x04 0x00 0x00 0x5e The lights are turned on
darker | darker 0x5a 0x05 0x00 0x00 0x5f lights dimmed
Adjust to the brightest | the light is the brightest 0x5a 0x06 0x00 0x00 0x60 has been adjusted to the brightest
Dimest | Dimest light 0x5a 0x07 0x00 0x00 0x61 dimmed
Delay off lights | turn off lights after 30 minutes 0x5a 0x08 0x00 0x00 0x62 Lights off for you after thirty minutes
Turn off the lights after ten minutes 0x5a 0x09 0x00 0x00 0x63 Lights off for you after ten minutes
Turn off the lights after 20 minutes 0x5a 0x0a 0x00 0x00 0x64 Lights off for you after twenty minutes
Turn off the lights after forty minutes 0x5a 0x0b 0x00 0x00 0x65 Lights off for you after forty minutes
Turn off the lights after fifty minutes 0x5a 0x0c 0x00 0x00 0x66 Lights off for you after fifty minutes
Turn off the lights after 60 minutes 0x5a 0x0d 0x00 0x00 0x67 Turn off the lights for you after 60 minutes
cancel timer 0x5a 0x0e 0x00 0x00 0x68 Timed light off has been canceled
Turn on the air con 0x5a 0x0f 0x00 0x00 0x69 Air conditioner is on
Turn off the air conditioner 0x5a 0x10 0x00 0x00 0x6a Air conditioner is off
Turn on the fan 0x5a 0x11 0x00 0x00 0x6b The fan has been turned on for you
Turn off the fan 0x5a 0x12 0x00 0x00 0x6c The fan has been turned off for you
Turn on cold light | switch to cold light 0x5a 0x13 0x00 0x00 0x6d The cold light has been turned on for you
turn off cold light | turn off cold light 0x5a 0x14 0x00 0x00 0x6e Cold light has been turned off for you
Turn on warm light | switch to warm light 0x5a 0x15 0x00 0x00 0x6f Warm light has been turned on for you
turn off warm light | turn off warm light 0x5a 0x16 0x00 0x00 0x70 Warm light is turned off for you
start to learn 0x5a 0x17 0x00 0x00 0x71 Start learning wake words…
reset learning 0x5a 0x18 0x00 0x00 0x72 Learning data has been reset
command word learning 0x5a 0x19 0x00 0x00 0x73 Start learning demo commands...
wake word learning 0x5a 0x1a 0x00 0x00 0x74 Start learning wake words…
Clear Learning Command Words 0x5a 0x1b 0x00 0x00 0x75 Command word learning data cleared
Clear Learning Wake Words 0x5a 0x1c 0x00 0x00 0x76 Wake word learning data cleared

2. Instruction code description

       Each instruction code represents the instruction currently recognized by VC, the meaning of the instruction: take "0x5a 0x00 0x00 0x00 0x5a" as an example

start bit instruction number reserved bit 1 reserved bit 2 Check Digit
0x5a 0x00 0x00 0x00 0x5a
  • Start bit: fixed value: 0x5a
  • Command serial number: represents the only command: 0x00 is the serial number of the wake-up word
  • Reserved bit 1: Fixed value: 0x00
  • Reserved bit 2: Fixed value: 0x00
  • Check digit: XOR value of the first four digits, 0x5a XOR0x00 XOR0x00 XOR0x00 =0x5a

3. Use the factory firmware of the development board

       The command words of the factory firmware of the development board are the same as those of the module, except that the LED control function and the button wake-up function are added:
insert image description here

Fourth, the voice control process

Created with Raphaël 2.3.0 开始 说唤醒词 说指令词 是否自动退出 结束 yes no

V. Summary

       The factory firmware already has very good instructions, and the microcontroller can do the corresponding processing according to the corresponding instruction code. The most important byte of the instruction code is the check digit, which can be done in C language:

//假如判断唤醒:0x5a 0x00 0x00 0x00 0x5a
char start_bit=0x5a;
char cmd_num_bit=0x00;
char temp_num1_bit=0x00;
char temp_num2_bit=0x00;
//计算校验位
char check_bit=start_bit^cmd_mun_bit^temp_num1_bit^temp_num2_bit;

       The most important thing is, does it support secondary development? In fact, this article has made it very clear.
insert image description here

6. Links

Official website: https://www.ai-thinker.com
Development of DOCS: https://docs.ai-thinker.com
Official forum: http://bbs.ai-thinker.com
Technical support: [email protected]

Guess you like

Origin blog.csdn.net/Boantong_/article/details/123846788