Bitmain Sophon Neural Network Software Development Kit (SDK), such as bmtap2-bm1880-usb-x.y.z.tar.gz or bmtap2-bm1880-usb_x.y.z.run, you can download the compression package from https://www.sophon.cn/drive/36.html​

Set the DIP switch to bit[1:8]=11000001 to config the usb port work in device mode.

The script will install the BMNNSDK to default directory: /opt/bmtap2, and Symbolic Link will be created in the system content:

// you will see the installation folder in the/opt/bmtap2 after successful installation

$ ls /opt/bmtap2

​

// symbolic link will be found in /usr/bin、/usr/lib、/usr/include

$ ls -alh /usr/bin/bm*

$ ls –alh /usr/lib/bm*

$ ls –alh /usr/include/bmtap2

​

// if the host has BM1880 NNS，you will find device foldin the directory/dev

$ ls /dev/ttyACM*

/dev/ttyACM0

To uninstall the BMNNSDK ,simply execute the uninstall script in the installation directory.

$ sudo /opt/bmtap2/bm1880-usb-x.y.z/uninstall.sh

Package Installation

Installation package is a self-extracting file that can be run directly. Please copy the installation package to x86 host and run it.

$ chmod +x bmtap2-bm1880-usb_x.y.z.run

$ sudo ./bmtap2-bm1880-usb -x.y.z.run

The installation package will install the BMNNSDK to default directory: /opt/bmtap2, and Symbolic Link will be created in the system content, it also will automatically compile and load the BM1880’s USB device by DKMS, which will drive the bmdnn.ko:

// you will see the installation folder in the directory /opt/bmtap2 after successful installation

$ ls /opt/bmtap2

​

// symbolic link will be found in /usr/bin、/usr/lib、/usr/include

$ ls -alh /usr/bin/bm*

$ ls –alh /usr/lib/bm*

$ ls –alh /usr/include/bmtap2

​

// if the host has BM1880 NNS, you will find the device filein the /dev directory

$ ls /dev/ttyACM*

/dev/ttyACM0

To uninstall the BMNNSDK ,simply execute the uninstall script in the installation directory.

$ sudo /opt/bmtap2/bm1880-usb-x.y.z/uninstall.sh

Step 3: Basic function testing

The Basic function testing use the network model and data include in the installation package for Neural Network inference, the test results will be output to the out subdirectory of the current directory, please make sure that the user has the write rights to the current directory.

Set the DIP switch to bit[1:8]=10100010 to config the usb OTG port work in host mode.(SD boot mode)

https://github.com/BM1880-BIRD/bm1880-system-sdk.git

Before you start to install the BMNNSDK in SoC mode, you need setup the EDB's linux environment at first. How to setup EDB's linux environment you can visit this section to get the steps

Compression package installation

Compression package contains the installation script, please copy it to the SoC board, unzip and execute the script install.sh in the directory.

$ tar zxvf bmtap2-bm1880-SoC-x.y.z.tar.gz

$ cd bmtap2-bm1880-SoC-x.y.z

$ sudo ./install.sh

The script will install the BMNNSDK to default directory: /opt/bmtap2, and Symbolic Link will be created in the system content, it also will load the BM1880’s TPU driver by insmod, which will drive the bmdnn.ko:

// you will see the installation folder in the/opt/bmtap2 after successful installation

​

$ ls /opt/bmtap2

​

// symbolic link will be found in /usr/bin、/usr/lib、/usr/include

$ ls -alh /usr/bin/bm*

$ ls –alh /usr/lib/libbm*

$ ls –alh /usr/include/bmtap2

​

// use lsmod to find driver information

$ lsmod |grep bmnpu

bmnpu

// you will find device filein the /dev directory

$ ls /dev/bm*

/dev/bm-npu

​

To uninstall the BMNNSDK ,simply execute the uninstall script in the installation directory.

$ sudo /opt/bmtap2/bm1880-SoC-x.y.z/uninstall.sh

Package installation

Installation package is a self-extracting file that can be run directly. Please copy the installation package to BM1880 SoC board and run it.

$ chmod +x bmtap2-bm1880-SoC_x.y.z.run

$ sudo ./bmtap2-bm1880-SoC-x.y.z.run

The installation package will install the BMNNSDK to default directory: /opt/bmtap2, and Symbolic Link will be created in the system directory, it also will load the BM1880’s TPU device by insmod, which will drive the bmdnn.ko:

// you will see the installation folder in the directory /opt/bmtap2 after successful installation

$ ls /opt/bmtap2

​

// symbolic link will be found in /usr/bin、/usr/bin、/usr/include

​

$ ls -alh /usr/bin/bm*

$ ls –alh /usr/lib/libbm*

$ ls –alh /usr/include/bmtap2

​

// use lsmod to find driver information

$ lsmod |grep bmnpu

bmnpu

​

// you will find the device filein the /dev directory

$ ls /dev/bm*

/dev/bm-npu

​

To uninstall the BMNNSDK ,simply execute the uninstall script in the installation directory.

$ sudo /opt/bmtap2/bm1880- SoC-x.y.z/uninstall.sh

Step 3: Basic function testing

The Basic function testing use the network model and data include in the installation package for Neural Network inference, the test results will be output to the out subdirectory of the current directory, please make sure that the user has the write rights to the current directory.

eMMC Boot

Extract the file edb_emmc_boot.tar.gz (can't download from github yet, coming soon). Please prepare a SD card first, and make two FAT32 partitions on the SD card：

One 128M, put into fip.bin.

The other partition should larger than the size of the upgrade image bm_update.img, put in bm_update.img.

Start the board with the SD boot mode and stop at u-boot command line：

copy bm_update.img to the sd card.

connect the sd card to the board.

ecutes the bm_update command.

After the programming is completed: select BootMode to "BOOT_SEL[2:0] = 3'b100". Press the reset button to boot from the eMMC, the first time the system will into recovery mode, press the reset button again , the second time will boot into normal mode.