The goal of the document is to illustrate how to create an SD card with SP7021 Linux kernel and root file-system. Please follow the following steps.
1.
...
Download source files
Get latest source files from git server of SP7021 (2. HOW TO GET SOURCE FILE AND PACKAGE). Refer to report of ll command for the contents of top folder of source of SP7021:
Code Block |
---|
wellslu@scdiu3:~/q628/sdc$ ll
total 52
drwxr-xr-x 12 wellslu sp 4096 Oct 15 12:08 ./
drwxr-xr-x 19 wellslu sp 4096 Oct 15 12:03 ../
drwxr-xr-x 8 wellslu sp 4096 May 26 17:29 boot/
drwxr-xr-x 4 wellslu sp 4096 Aug 25 17:17 build/
drwxr-xr-x 7 wellslu sp 4096 Aug 19 11:45 crossgcc/
drwxr-xr-x 6 wellslu sp 4096 Sep 9 2019 eCos/
drwxr-xr-x 9 wellslu sp 4096 Jun 5 19:10 freertos/
drwxr-xr-x 8 wellslu sp 4096 Aug 19 11:45 ipack/
drwxr-xr-x 7 wellslu sp 4096 Sep 9 2019 linux/
-r--r--r-- 1 wellslu sp 23 Sep 9 2019 Makefile
drwxr-xr-x 4 wellslu sp 4096 Sep 9 2019 nonos/
drwxr-xr-x 7 wellslu sp 4096 Sep 9 2019 .repo/
drwxr-xr-x 3 wellslu sp 4096 Jun 29 10:43 yocto/ |
2. Configure environment
Get latest source files of SP7021 from git server of SP7021 (2. HOW TO GET SOURCE FILE AND PACKAGE) and run make config command on top folder. After configuration menu pops up, first, choose board you want to build image for. For example, press 4 for SP7021 Demo Board (V3). Second, press 2 to choose to build image for SD card and then enter to start to configure building environment. Refer to screenshot below,
...
make config is starting to configure building environment. It takes 1~2 minutes to complete.
...
3. Build all images
Run make all command to start to create image for SD card. It might take several minutes to complete. After 'make all' completes, you will see screen like:
...
From information on screen, two partitions are created in the image of SD card. The first partition starts at sector 2048 and ends at sector 206847. Its size is 100 MiB and file-system is W95 FAT. The second partition starts at sector 206848 and ends at sector 239615. Its size is 16 MiB and file-system is Linux (ext3).
...
4. Image files
The built image files are stored at out/boot2linux_SDcard/. Refer to screenshot of list of the folder:
...
ISP_SD_BOOOT.img is an image for burning an SD card. It actually contains all files in both partitions.
...
5. Write image to an SD card
Use an application to write image file, ISP_SD_BOOOT.img, to an SD card. The capacity of SD card should be larger than size of image file, ISP_SD_BOOOT.img. For example, if you want to use “Win32 Disk Imager” to write image to an SD card. First, download the it from https://sourceforge.net/projects/win32diskimager/:
...
Another example is using “balenaEtcher”. Refer to screenshot when “balenaEtcher” is writing image file, ISP_SD_BOOOT.img, to an SD card below:
...
...
6. Boot from an SD card
Insert your SD card to SP7021 board and set its DIP-SW to “boot from SD card”. For example, if you are using SP7021 Demo Board (V1/V2/V3), you need to set DIP-SW to ON-ON for booting from SD card. Refer to picture below:
...
Turn on power of SP7021 board to start booting.
...
7. Extend size of root file-system
At the first time, Linux boots from a new SD card. The built-in script of Linux will run fdisk command to extend the size of rootfs partition to the end of SD card and then re-boot. Refer to log while Linux script is extending size of rootfs partition:
...