Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The goal of the document is to illustrate how to build SP7021 image and install it with Raspbian rootfs on eMMC. Raspbian is a famous and popular Linux distribution. It is based Debian and for running on Raspberry Pi boards. Raspbian is released in form of SD card image. Raspbian image file of SD card can be downloaded from web of Raspbian foundation. Users can then write the image file into an SD card. The SD card image consists of two partitions. One is boot partition which is formatted to DOS/Windows FAT32 file-system and the other is rootfs partition which is formatted to Linux Ext4 file-system. boot partition contains files, including boot-loader, Linux kernel image, and etc, for booting from Raspberry Pi boards. rootfs partition contains files of whole root file-system of Linux. To run Raspbian on eMMC on SP7021 platforms, we need to replace all files of rootfs partition of eMMC with Raspbian’s.

...

Code Block
wells@wells-linux:~/q628/emmc$ cat rpi_rootfs/etc/fstab
proc            /proc           proc    defaults          0       0
#PARTUUID=6c620f41-01  /boot           vfat    defaults          0       2
#PARTUUID=6c620f41-02  /               ext4    defaults,noatime  0       1
wells@wells-linux:~/q628/emmc$

14. Copy Linux modules to rootfs partition of Raspbian

Copy the following files:

linux/rootfs/initramfs/disk/lib/modules/5.4.35-SUNPLUS-v7+/kernel/

linux/rootfs/initramfs/disk/lib/modules/5.4.35-SUNPLUS-v7+/modules.*

to folder:

rpi_rootfs/lib/modules/5.4.35-SUNPLUS-v7+/

where “5.4.35-SUNPLUS-v7+” is Linux kernel release of SP7021.

15. Un-mount the folder of rootfs partition of Raspbian

Refer to log below, use umount command to un-mount the folder of Raspbian image file.

Code Block
wells@wells-linux:~/q628/emmc$ sudo umount rpi_rootfs 
wells@wells-linux:~/q628/emmc$ ll rpi_rootfs
total 8
drwxrwxr-x  2 wells wells 4096 Jul  2 20:30 ./
drwxrwxr-x 14 wells wells 4096 Jul  2 20:30 ../
wells@wells-linux:~/q628/emmc$ 

...

16. Link Raspbian image file to out/rootfs.img

Refer to log below, use rm command remove original out/rootfs.img and use ln command to link Raspbian image file to out/rootfs.img

...

out/rootfs.img was linked to image file of rootfs of Raspbian.

...

17. Build ISP files

Go to out folder and run isp.sh script to build ISP files. Refer to log below:

...

Code Block
wells@wells-linux:~/q628/emmc/out$ ll
total 13865204
drwxrwxr-x  2 wells wells       4096 Jul  2 20:42 ./
drwxrwxr-x 13 wells wells       4096 Jul  2 20:35 ../
-rw-rw-r--  1 wells wells      49152 Jul  2 20:20 a926.img
-rw-rw-r--  1 wells wells     134144 Jul  2 20:17 down_32M.exe
-rw-rw-r--  1 wells wells      20480 Jul  2 20:19 dtb
-rw-rw-r--  1 wells wells 4235740160 Jul  2 20:42 ISPBOOOT.BIN
-rw-rw-r--  1 wells wells 2864709632 Jul  2 20:41 ISPBOOT1.BIN
lrwxrwxrwx  1 wells wells         34 Jul  2 20:17 isp.sh -> /home/wells/q628/emmc/build/isp.sh*
lrwxrwxrwx  1 wells wells         35 Jul  2 20:17 part.sh -> /home/wells/q628/emmc/build/part.sh*
-rw-r--r--  2 root  root  7092568064 Jul  2 20:33 rootfs.img
-rw-rw-r--  1 wells wells     427708 Jul  2 20:20 u-boot.img
-rw-rw-r--  1 wells wells    4261664 Jul  2 20:20 uImage
-rw-rw-r--  1 wells wells      25320 Jul  2 20:20 xboot.img
wells@wells-linux:~/q628/emmc/out$ 

...

18. Copy ISPBOOOT.BIN and ISPBOOTx.BIN to an USB flash drive

Copy the built binary files, ISPBOOOT.BIN, ISPBOOT1.BIN, ISPBOOT2.BIN, … to root directory of an USB flash drive. Note that the USB flash drive should be formatted to DOS/Windows FAT32 file-system. SP7021 can only load files from an USB flash drive which is formatted to FAT32 file-system. Note that FAT32 file-system should be in the first or the sole partition of the USB flash drive.

...

19. Set DIP-SW to “boot from USB”

Set DIP-SW (boot-select switch) to “boot from USB”. For example, if you are using SP7021 Demo Board (V1/V2/V3), please set DIP-SW to ON-OFF (0-1) for booting from USB flash drive. Refer to picture below, DIP-SW is set to ON-OFF.

...

Refer to Selection of boot devices of SP7021 for details of boot selection of SP7021.

...

20. Write all SP7021 images to eMMC device

Plug your USB flash drive which contains ISPBOOOT.BIN, ISPBOOT1.BIN, ISPBOOT2.BIN, … files into an USB socket of SP7021 board. Turn on power of SP7021 board. After power on, SP7021 starts to write the images to eMMC one by one. Wait for writing to complete. Finally, you will see screen like:

...

ISP all: Done” means all images were written to eMMC and verified successfully.

Note that in-system-program (ISP) of SP7021 does not support USB hub. The USB flash drive for ISP should be plugged into USB socket of SP7021 board directly.

If you are using Banana Pi BPI-F2P boards, please plug you USB flash drive to the micro USB socket for ISP. It is the only USB socket that is connected to SP7021 directly.

...

21. Boot Linux from eMMC device

Set DIP-SW (boot select switch) to “boot from eMMC device”. For example, if you are using SP7021 Demo Board (V1/V2/V3), please set DIP-SW to OFF-OFF (1-1) for booting from eMMC device. Refer to picture below:

...