Environment Setup

Version 2.0


1. Build Compilation Environment

We develop and debug by cross-compilation, that is, "host + target". The host and target are connected by serial port or network, as shown below:

Note:

  1. In addition to debugging, Sigmastar's debug tool can also read registers and program empty flash through PC tool.

  2. For debugging only, the serial port device can be used to connect the debugging line sequence (con3), and the line sequence should be aligned with the schematic diagram.

  3. To read Register or burn bare Flash, you need to use the debug tool.

  4. Purchase debug tool by yourself according to your demands. Click here for purchase.


2. Install Linux Build Code

It is recommended to use Ubuntu 16.04, which has been verified, if you encounter environmental problems with other versions, we will not provide assistance.


2.1. Install Ubuntu 16.04 Server

  1. Download for 1604 server version

  2. Install VMware Worksation;

  3. Select 1604 iso;

  4. Click Finish button for easy mode installation and the system will automatically install it;

  5. Install VMtools for coping and sharing windows direction to ubuntu, Click here for reference.

After ubuntu is successfully installed, you need to set up the development environment.


2.2. Add New Accounts

  1. Set password

    The newly installed ubuntu first needs to set the root password. Enter the system to set the root password: # sudo passwd, enter the password continuously until the prompt is successful;

  2. Add a new user

    Use command # sudo adduser xxx --force to recreate a new user after entering the system, when prompt to enter some information of account, keep pressing Enter;

  3. Install related tools and compilation environment

    Execute # sudo apt-get install libncurses5-dev libncursesw5-dev, when prompted that the current user cannot execute sudoers, please modify as follows:

    sudo chmod u+w /etc/sudoers
    
    vi /etc/sudoers
    

    Reference: root ALL=(ALL:ALL) ALL,

    Add: xxx ALL=(ALL:ALL) ALL

    sudo chmod u-w /etc/sudoers
    

Re-execute sudo, it is recommended to execute #sudo apt-get update after installation.

2.3. Install samba

samba is used to share Linux files to windows.

# sudo apt-get install samba samba-common

# sudo smbpasswd -a xxx (Add a samba account for windows to access the linuxsamba)

Modify /etc/samba/smb.conf

[xxx]

path=/home/xxx

public=yes

writable=yes

valid users=xxx

available=yes

browseable=yes

guest ok = yes

After completed samba config, restart the samba service and test access to samba from windows: \\192.168.1.11 (your ubuntu ip).

2.4. Install ssh

ssh is used to log in and debug.

sudo apt-get install openssh-server;

2.5. Other Tools

To avoid SDK compilation failure, some tools need to be installed. For convenience, you can install all before compiling

# sudo apt-get install libc6-dev-i386

# sudo apt-get install lib32z1 lib32ncurses5

# sudo apt-get install libuuid1:i386

# sudo apt-get install cmake

# sudo apt-get install libncurses5-dev libncursesw5-dev

# sudo apt install bc

# sudo apt-get install xz-utils

# sudo apt-get install automake

# sudo apt-get install libtool

# sudo apt-get install libevdev-dev

# sudo apt-get install pkg-config

2.6. Modify sh

If the default is sh, you need to change sh to bash.

sudo rm /bin/sh

sudo ln s /bin/bash /bin/sh

2.7. Install toolchain

  • copy gcc-sigmastar-9.1.0-2020.07-x86_64_arm-linux-gnueabihf.tar.xz to /tools/toolchain/, custom directory.

  • Unzip toolchain

  • Set the toolchain to the environment variable to avoid manual export every time;

  • Add export PATH=/tools/toolchain/gcc-sigmastar-9.1.0-2020.07-x86_64_arm-linux-gnueabihf/bin/:$PATH in /etc/profile

  • After completing the configuration, confirm whether the gcc version has been switched to 9.1.0 as follows.

  • After the compilation environment is set up, compile the SDK.


3. SDK Compilation Steps


3.1. Code Obtain

Obtain the corresponding SDK from FTP.


3.2. Boot Compilation

  • spi-nor

    glibc:

    #declare -x ARCH="arm" or export ARCH=arm  
    #declare -x CROSS_COMPILE="arm-linux-gnueabihf-" or export CROSS_COMPILE=arm-linux-gnueabihf- 
    #make pioneer3_dualenv_defconfig(Env double backup and USB upgrade are enabled by default from V011) or make pioneer3_defconfig;
    #make clean;make
    

    The image generated after compilation:

    pioneer3_defconfig: boot/u-boot.xz.img.bin, replace it with project/board/p3/boot/nor/uboot/u-boot.xz.img.bin and recompile the project;

    pioneer3_dualenv_defconfig: boot/u-boot.xz.img.bin, replace it with project/board/p3/boot/nor/uboot/u-boot_dualenv.xz.img.bin and recompile the project;

  • spi-nand

    glibc:

    #declare -x ARCH="arm" or export ARCH=arm  
    #declare -x CROSS_COMPILE="arm-linux-gnueabihf-" or export CROSS_COMPILE=arm-linux-gnueabihf- 
    #make pioneer3_dualenv_spinand_defconfig(Env double backup and USB upgrade are enabled by default from V011) or make pioneer3_spinand_defconfig;
    #make clean;make
    

    The image generated after compilation:

    pioneer3_spinand_defconfig: boot/u-boot_spinand.xz.img.bin, replace it with project/board/p3/boot/spinand/uboot/u-boot_spinand.xz.img.bin and recompile the project;

    pioneer3_dualenv_spinand_defconfig: boot/u-boot_spinand.xz.img.bin, replace it with project/board/p3/boot/spinand/uboot/u-boot_dualenv_spinand.xz.img.bin and recompile the project;

    Flash Type Other Defconfig
    SPI-NOR Basic pioneer3_defconfig
    SPI-NAND Basic pioneer3_spinand_defconfig
    SPI-NOR Add ENV double backup mechanism on the basis of default pioneer3_dualenv_defconfig
    SPI-NAND Add ENV double backup mechanism on the basis of default pioneer3_dualenv_spinand_defconfig

3.3. Kernel Compilation

Compiling alkaid will compile the kernel by default, which is different from Takoyaki. It is recommended to compile directly under the project after modifying the relevant kernel, the content of the kernel will be compiled by default, and there is no need to manually release to the path under the project.

#declare -x ARCH="arm" or export ARCH=arm  
#declare -x CROSS_COMPILE="arm-linux-gnueabihf-" or export CROSS_COMPILE=arm-linux-gnueabihf-
Chip Packaging Memory Flash Type Toolchain Other Defconfig
SSD210 QFN68 64M SPI-NOR glibc NA pioneer3_ssc021a_s01a_demo_defconfig
SSD212 QFN128 64M SPI-NOR glibc NA pioneer3_ssc020a_s01a_demo_defconfig
SSD212 QFN128 64M SPI-NOR glibc sdio wifi pioneer3_ssc020a_s01a_demo_wifi_defconfig
SSD222 QFN128 64M SPI-NOR glibc NA pioneer3_ssc020a_s01a_demo_camera_defconfig
SSD222 QFN128 64M SPI-NOR glibc sdio wifi pioneer3_ssc020a_s01a_demo_camera_wifi_defconfig
SSD222D QFN128 128M SPI-NOR glibc NA pioneer3_ssc020a_s01a_demo_camera_defconfig
SSD222D QFN128 128M SPI-NOR glibc sdio wifi pioneer3_ssc020a_s01a_demo_camera_wifi_defconfig
SSD210 QFN68 64M SPI-NAND glibc NA pioneer3_ssc021a_s01a_spinand_demo_defconfig
SSD212 QFN128 64M SPI-NAND glibc NA pioneer3_ssc020a_s01a_spinand_demo_defconfig
SSD212 QFN128 64M SPI-NAND glibc sdio wifi pioneer3_ssc020a_s01a_spinand_demo_wifi_defconfig
SSD222 QFN128 64M SPI-NAND glibc NA pioneer3_ssc020a_s01a_spinand_demo_camera_defconfig
SSD222 QFN128 64M SPI-NAND glibc sdio wifi pioneer3_ssc020a_s01a_spinand_demo_camera_wifi_defconfig
SSD222D QFN128 128M SPI-NAND glibc NA pioneer3_ssc020a_s01a_spinand_demo_camera_defconfig
SSD222D QFN128 128M SPI-NAND glibc sdio wifi pioneer3_ssc020a_s01a_spinand_demo_camera_wifi_defconfig
SSD221 QFN68 64M SPI-NOR glibc NA pioneer3_ssc021a_s01a_demo_camera_defconfig
SSD221 QFN68 64M SPI-NAND glibc NA pioneer3_ssc021a_s01a_spinand_demo_camera_defconfig
SSD222 QFN128 64M SPI-NAND glibc 2lane sensor pioneer3_ssc020a_s01a_spinand_demo_camera_2lane_defconfig
#make clean;make -j8
  • If there are new kernel modules in the kernel, you need to add the corresponding module to kernel_mod_list/kernel_mod_list_late (the ko in kernel_mod_list_late will be loaded after mi module)

  • Path:project/kbuild/customize/$(KERNEL_VERSION)/$(CHIP)/$(PRODUCT)/kernel_mod_list


3.4. SDK Compilation

Before compiling the SDK by default, build kernel, the first compilation command is make clean;make image -j8, then if you don't need build kernel, use make image-fast instead of make image.

#declare -x ARCH="arm" or export ARCH=arm

#declare -x CROSS_COMPILE="arm-linux-gnueabihf-" or export CROSS_COMPILE=arm-linux-gnueabihf-
Chip Packaging Memory Flash Type Toolchain Other Defconfig
SSD210 QFN68 64M SPI-NOR glibc NA make dispcam_p3_nor.glibc-9.1.0-squashfs.s01a.64.qfn68.demo_defconfig
SSD212 QFN128 64M SPI-NOR glibc NA make dispcam_p3_nor.glibc-9.1.0-squashfs.s01a.64.qfn128.demo_defconfig
SSD212 QFN128 64M SPI-NOR glibc sdio wifi make dispcam_p3_nor.glibc-9.1.0-squashfs.s01a.64.qfn128.demo_wifi_defconfig
SSD222 QFN128 64M SPI-NOR glibc NA make dispcam_p3_nor.glibc-9.1.0-squashfs.s01a.64. qfn128.demo_camera_defconfig
SSD222 QFN128 64M SPI-NOR glibc sdio wifi make dispcam_p3_nor.glibc-9.1.0-squashfs.s01a.64.qfn128.demo_camera_wifi_defconfig
SSD222D QFN128 128M SPI-NOR glibc NA make dispcam_p3_nor.glibc-9.1.0-squashfs.s01a.128.qfn128.demo_camera_defconfig
SSD222D QFN128 128M SPI-NOR glibc sdio wifi make dispcam_p3_nor.glibc-9.1.0-squashfs.s01a.128.qfn128.demo_camera_wifi_defconfig
SSD210 QFN68 64M SPI-NAND glibc NA make dispcam_p3_spinand.glibc-9.1.0-s01a.64.qfn68.demo_defconfig
SSD212 QFN128 64M SPI-NAND glibc NA make dispcam_p3_spinand.glibc-9.1.0-s01a.64.qfn128.demo_defconfig
SSD212 QFN128 64M SPI-NAND glibc sdio wifi make dispcam_p3_spinand.glibc-9.1.0-s01a.64.qfn128.demo_wifi_defconfig
SSD222 QFN128 64M SPI-NAND glibc NA make dispcam_p3_spinand.glibc-9.1.0-s01a.64.qfn128.demo_camera_defconfig
SSD222 QFN128 64M SPI-NAND glibc sdio wifi make dispcam_p3_spinand.glibc-9.1.0-s01a.64.qfn128.demo_camera_wifi_defconfig
SSD222D QFN128 128M SPI-NAND glibc NA make dispcam_p3_spinand.glibc-9.1.0-s01a.128.qfn128.demo_camera_defconfig
SSD222D QFN128 128M SPI-NAND glibc sdio wifi make dispcam_p3_spinand.glibc-9.1.0-s01a.128.qfn128.demo_camera_wifi_defconfig
SSD221 QFN68 64M SPI-NOR glibc NA make dispcam_p3_nor.glibc-9.1.0-squashfs.s01a.64.qfn68.demo_camera_ defconfig
SSD221 QFN68 64M SPI-NAND glibc NA make dispcam_p3_spinand.glibc-9.1.0-s01a.64.qfn68.demo_camera_defconfig
SSD222 QFN128 64M SPI-NAND glibc 2lane sensor make dispcam_p3_spinand.glibc-9.1.0-s01a.64.qfn128.demo_camera_2lane_defconfig
make clean; make image -j8

The image generated after compilation is in project/image/output/images.

Defconfig above V011 switches to the env dual backup mechanism by default:

  1. uboot uses the bin generated by dual backup config by default.

  2. Use dual backup configuration for partition files

The non-dual env backup version and the dual env backup version cannot be upgraded directly through tftp. It must start with the isp tool burning boot, and then upgrade through tftp.

Version Flash Type boot partition
Before V011 NOR project/board/p3/boot/nor/uboot/u-boot.xz.img.bin nor.squashfs.partition.dispcam.config
Before V011 NAND project/board/p3/boot/spinand/uboot/u-boot_spinand.xz.img.bin spinand.ubifs.partition.dispcam.config
After V011 NOR project/board/p3/boot/nor/uboot/u-boot_dualenv.xz.img.bin nor.squashfs.partition.dualenv.dispcam.config
After V011 NAND project/board/p3/boot/spinand/uboot/u-boot_dualenv_spinand.xz.img.bin spinand.ubifs.partition.dualenv.dispcam.config

4. Demo Board Connection Diagram

Fig 4-1 SSD221 SSD210 SSC9211 demo board connection diagram

Fig 4-2 SSD212 demo board connection diagram

Fig 4-3 SSD222 demo board connection diagram


5. Burn Image To The Board

5.1. Burn Empty Flash

Empty board burning (or boards that cannot be run by uboot) need to be connected to burning with isp tool (this is only for the development stage, the official production uses the burner to burn the master), the specific method is as follows:

Please disconnect the serial port before using isptool to connect to avoid failure. The disconnection steps are as follows:

  • Enter debug under uboot console, and then close the serial terminal;

  • Enter 11111 under the kernel, and when the serial port displays disable uart, close the serial port terminal.

After closing uart, use isptool to burn as follows.

5.1.1. Burn SPI NOR Flash

For the new flash architecture, nor flash only needs to burn boot.bin, and nand flash only needs to burn cis.bin and boot.bin. The specific method is as follows:

  1. Open isptool, select SPINAND, click connect, then confirm successful connection.

  2. Follow the steps below to select the boot.bin to be burned and the corresponding flash address, and then click run. If pass is displayed, the burn is successful.

    Binary file offset Binary storage directory
    boot.bin 0x00000 ${ALKAID}\project\image\output\images\boot.bin

5.1.2. Burn SPI NAND Flash

For the new flash architecture, nor flash only needs to burn boot.bin, and nand flash only needs to burn cis.bin and boot.bin. The specific method is as follows:

  1. Open isptool, select spinor, click connect, then confirm successful connection.

  2. Follow the steps below to select the cis.bin to be burned and the corresponding flash address, and then click run. If pass is displayed, the burn is successful.

    Binary file offset Binary storage directory
    cis.bin 0x00000 ${ALKAID}\project\image\output\images\cis.bin
    cis.bin 0x20000 ${ALKAID}\project\image\output\images\cis.bin
    boot.bin 0x140000 ${ALKAID}\project\image\output\images\boot.bin

  3. Repeat the above step to burn cis.bin(Note that the address is different from the first time, do not check Erase Device) and boot.bin(do not check Erase Device), fill in the flash address of the corresponding partition:

After burning uboot, close the isptool and reconnect the serial port, power off the board and restart it to enter the uboot terminal and use tftp to upgrade the main program.

5.2. tftp Burn Image

Using tftp network to burn image requires the board with uboot program, if not, please refer to isptool burning method to burn uboot, and then use tftp to burn as follows.

  1. Open the tftp tool and select the image path: SDK\project\image\output\images\, and select the correct network adapter.

  2. The board is connected to the network and is in the same network segment as the PC (close the PC firewall)

  3. Boot the board, press and hold Enter to enter the uboot terminal.

  4. The IP address needs to be set for the first burning

    #setenv gatewayip 192.168.1.1
    #setenv ipaddr 192.168.1.127       //Set the IP used by FTP Client (EVB)
    #setenv netmask 255.255.255.0
    #setenv serverip 192.168.1.100     //Set the IP of the FTP server (PC)
    #saveenv
    

    Note:

    1. Please use a static IP to prevent the IP address from jumping during burning.

    2. You can use an independent network adapter, connect PC to demo board, fix the internal network IP of the network adapter, and set the demo board as described above.

    3. Use the following command to burn in the uboot terminal

      #estart
      
      #estar (OR: estar auto_update.txt, you can also specify a line in auto_update.txt to burn one of the partitions)