Build development environment*
VSP needs to be compiled in Linux environment. This article mainly introduces how to build SDK development and compilation environment
1. Operating system*
- Ubuntu 16.04
- Windows Ubuntu can be installed using a virtual machine
- Do not You are advised to use the USB burning and UAC functions on the VM, which may cause device identification problems
2. MCU compilation tool chain*
-
csky-abiv2-elf-toolchain-v3.10.15.tar.gz
-
Create a suitable path and extract the toolchain to it
Then edit$ sudo mkdir -p /opt/csky-abiv2-elf/; cd /opt/csky-abiv2-elf/; $ sudo tar xvf csky-abiv2-elf-toolchain-v3.10.15.tar.gz;
~/.profile
or~/.bashrc
and add/opt/csky-abiv2-elf/bin
to the PATH pathRun the following command. If the following information is displayed, the installation is successfulecho "export PATH=\$PATH:/opt/csky-abiv2-elf/bin" >> ~/.profile or echo "export PATH=\$PATH:/opt/csky-abiv2-elf/bin" >> ~/.bashrc
$ csky-abiv2-elf-gcc -v Using built-in specs. COLLECT_GCC=csky-abiv2-elf-gcc COLLECT_LTO_WRAPPER=/ext/opt/avdev/csky-abiv2-elf/bin/../libexec/gcc/csky-elfabiv2/6.3.0/lto-wrapper Target: csky-elfabiv2 Configured with: /ldhome/software/toolsbuild/slave/workspace/tools3_rc_build_64_elf_v2/source//gcc/configure x86_64-linux --enable-languages=c,c++ --disable-threads --enable-sjlj-exceptions --disable-shared --enable-libssp --target=csky-elfabiv2 --prefix=/ldhome/software/toolsbuild/slave/workspace/tools3_rc_build_64_elf_v2/install/ --with-headers=/ldhome/software/toolsbuild/slave/workspace/tools3_rc_build_64_elf_v2/install//csky-elfabiv2/include --with-lib=/ldhome/software/toolsbuild/slave/workspace/tools3_rc_build_64_elf_v2/install//csky-elfabiv2/lib/ --with-mpfr=/ldhome/software/toolsbuild/slave/workspace/tools3_rc_build_64_elf_v2/lib-for-gcc-x86_64-linux/ --with-gmp=/ldhome/software/toolsbuild/slave/workspace/tools3_rc_build_64_elf_v2/lib-for-gcc-x86_64-linux/ --with-mpc=/ldhome/software/toolsbuild/slave/workspace/tools3_rc_build_64_elf_v2/lib-for-gcc-x86_64-linux/ --with-cskyabi=abiv2 --with-pkgversion='C-SKY Tools V3.10.15 Minilibc abiv2 B20190929' --disable-tls --enable-threads=posix Thread model: posix gcc version 6.3.0 (C-SKY Tools V3.10.15 Minilibc abiv2 B20190929)
3. DSP compilation tool chain*
-
GXHifi4_170719A_G1708_linux_redist.tgz
Xplorer-7.0.8-linux-installer.bin
Please contact our sales
-
If you choose to install the 64-bit version of Ubuntu, you will need to install the 32-bit support pack:
$ sudo dpkg --add-architecture i386 $ sudo apt-get update $ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 libx11-6:i386 gtk2-engines:i386 lib32ncurses5 lib32z1 libxtst6:i386 libgtk2.0-0:i386 lib32ncurses5 libcanberra-gtk3-0:i386
- Run the following command and install the VM as prompted (Recommended installation path ~/xtensa/):
chmod +x Xplorer-7.0.8-linux-installer.bin ./Xplorer-7.0.8-linux-installer.bin
-
Adding a License:
Click
Help
-Xplorer License Keys
on the menu bar, clickInstall Software Keys
on the pop-up dialog box, enter the License (please ask for it from contact Sales), and clickFinish
.If you can see the red box in the figure, the addition is successful.
-
Add CORE:
The DSP processor core we are currently using is GXHifi4_170719A_G1708, which needs to be added to Xplorer manually.
Right click on
Configurations
in theSystem Overview
window, selectFind and Install a Configuration Build
, In the window that appears clickBrowser
and select the configuration file (gxhifi4_170719a_g1708_Linux_redid.tgz for linux, If windows is GXHifi4_170719A_G1708_win32.tgz), click OK.You can find the newly added GXHifi4_170719A_G1707 in the Configurations of the System Overview window, as shown in the red box below.
-
Command line configuration: To facilitate the use of the compilation tool from the command line, you can add the toolchain to the system PATH.
When using the toolchain, you need to specify the name and path of the core, which can be specified through environment variables.~/.bashrc add: export PATH="$PATH:${XTENSA_PATH}/XtDevTools/install/tools/RG-2017.8-linux/XtensaTools/bin" # XTENSA_PATH indicates the installation path of xtensa
~/.bashrc add: export XTENSA_CORE=GXHifi4_170719A_G1708 export XTENSA_SYSTEM=${XTENSA_PATH}/XtDevTools/install/builds/RG-2017.8-linux/${XTENSA_CORE}/config # XTENSA_PATH indicates the installation path of xtensa
- When Xplorer IDE opens, it takes up license and prevents others from compiling, so keep Xplorer closed
4. ARM compiler tool chain*
- Run the following command:
sudo apt-get install gcc-arm-linux-gnueabihf
5. Source code acquisition*
- VSP code is hosted in
gitlab
, you need to register the gitlab account and provideuser name or email
to our sales manager, and ourproject manager
will release the code of the account. - Please use
git
for code management, execute the following command to pull the source code:git@gitlab.com:nationalchip/vsp_sdk.git
6. compile*
- Take the GX8008C as an example
-
First go to the root directory of vsp_sdk and execute:
Then apply the reference compilation configuration$ make distclean
$ cp configs/nationalchip_public_version/8008c_wukong_prime_2mic_16k_16bit_10ms_record_bypass.config .config $ make menuconfig
Note
If you encounter the error ncurses.h:no such file or directory during execution, please execute the following command to install the ncurses library.
sudo apt-get install libncurses5-dev
To make the compilation configuration take effect, double-click [ESC] and select Save. Then run the following command:
Compile the output at$ make $ ls -l output
./output/
7. burn*
- Take GX8008C as an example, Ubuntu uses bootx burning, Windows burning tool please click here
- Run the following command to view the bootx help information
bootx -h
7.1 USB burning*
- To use bootx for USB burning, run the following command:
sudo ./tools/bootx/bootx -m leo_mini -t u -c "download 0 output/vsp.bin;reboot"
- Then press and hold the boot key of the development board, and then restart or power on the board
- If the following information appears in the terminal, the burning is successful:
Version : v1.5.35 (20211018) NationalChip AIoT Download Tools Copyright (C) 2001-2021 NationalChip Co., Ltd ALL RIGHTS RESERVED! Please press BOOT button and power on or restart the board... downloading [1/2] : [==========][100%] downloading [2/2] : [==========][100%] Excute cmd : download 0 output/vsp.bin [==========][100%] done Excute cmd : reboot done
7.2 Serial burning*
- Run the following command:
sudo ~/bootx -m leo_mini -t s -d /dev/ttyUSB0 -c "download 0 output/vsp.bin;reboot"
- Then restart or power on the board
- If the following information appears in the terminal, the burning is successful:
$ sudo ~/bootx -m leo_mini -t s -d /dev/ttyUSB0 -c "download 0 output/vsp.bin;reboot" [sudo] jialp 的密码: Version : v1.5.18 (20200624) NationalChip GX8010 Download Tools Copyright (C) 2001-2019 NationalChip Co., Ltd ALL RIGHTS RESERVED! wait ROM request... please power on or restart the board... Found serial: /dev/ttyUSB0 downloading [1/2] : [==========][100%] downloading [2/2] : [==========][100%] Excute cmd : download 0 output/vsp.bin downloading [1/4] [==========][100%] downloading [2/4] [==========][100%] downloading [3/4] [==========][100%] downloading [4/4] [==========][100%] done Excute cmd : reboot done
- If burning fails, please try
restart PC
8. Serial tool*
- Take the GX8008C as an example
- minicom is recommended for linux
$ ls -l /dev/ttyUSB* $ minicom -D /dev/ttyUSB0 # Pass the correct serial port number as required
- Select the Windows serial port tool. It is not recommended
- Connect the board serial port to the computer
- After the previous item is successfully burned, the following information will be output from the serial port:
Voice Signal Preprocess Copyright (C) 2001-2019 NationalChip Co., Ltd ALL RIGHTS RESERVED! Hello MCU! MCU <-> DSP Message Version: [20180517] Board Model:[leo_mini_gx8008c_wukong_prime_1v] MCU Version:[v1.3.0-rc1-60-gedcac09] Build Date: [2022-04-03, 17:24:18] CHIP NAME: [8008C-NNNB] PUBLIC ID: [cc7416000000007e] Flash JEDEC = 0xef4016, model = w25q32. [IMAGEINFO]image version 0x10001 [IMAGEINFO]image crc32 0x620dbcc [IMAGEINFO]imageinfo crc32 0x9cf7c7b7 [UAC]Init UAC mode Flash JEDEC = 0xef4016, model = w25q32. [VPA] dsp_header.magic = 50534456 [VPA] dsp_header.message_version = 20180517 [VPA] dsp_header.xip_size = 0 [VPA] dsp_header.ptcm_size = 65536 [VPA] dsp_header.dtcm_size = 65536 [VPA] dsp_header.sram_size = 10368 [VPA] dsp_header.sram_base = 42800 downstream : max packet size : 192, packet size : 0 upstream : max packet size : 384, packet size : 192 Suspend [UAC]Init UAC mode done with 328 ms Reset Reset [UAC/CORE] playback : off, record : off [UAC/CORE] playback : off, record : off [UAC/CORE] playback : on, record : off [UAC/CORE] playback : off, record : off [UAC/CORE] playback : on, record : off
At this point, the development environment is set up with your favorite editing tools.