In this article, we will guide you through the process of downloading and compiling the SP7350 code. The source code for SP7350 is automatically updated on both GitHub and Gitee every day, ensuring users have access to the latest developments.
...
Table of Contents | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Install Necessary Software Packages
Before downloading or compiling the SP7350 code, ensure the following software packages, libraries, and Python3 packages are installed:
Packages:
bison
flex
git
make
mtd-utils
mtools
openssl
pv
python3-pip
u-boot-tools
Libraries:
libncurses*
libgmp-dev
libmpc-dev
libssl-dev
Python3 Packages:
crypto
pycryptodomex
pyelftools
...
Code Block |
---|
sudo apt install bison flex git make mtd-utils mtools openssl pv python3-pip u-boot-tools sudo apt install libncurses* libgmp-dev libmpc-dev libssl-dev pip install crypto pycryptodomex pyelftools |
Download Code from GitHub or Gitee.
Clone the repository from GitHub:
...
By following these steps, your Q654 environment will be up to date with the latest stable code.
Configure Building Environment
Navigate to the top folder of your Q654 project. Run the following command to initiate the configuration menu.
...
Choose the board you want to build the image for. For instance, press 2 to select "SP7350 IO Board."
Choose the device from which the system will boot. For example, press 2 to specify booting from the SD card.
Choose root file-system of Linux. For example, press 5 7 to opt for “Ubuntu MATE 2224.04.04” 1” as root file-system.
Choose boot modes. Press 1 to select building “Normal boot” images.
Once you have completed the configuration selections in the menu, the system will start configuring the building environment. This process may take tens seconds or even a few minutes, depending on your computer's performance. Please wait patiently for the configuration process to conclude.
Please note that the system takes additional time to complete its initial run during the configuration process, as it requires the download of the toolchain.
Configure X-Boot Features (optional)
If you want to activate additional features or deactivate specific ones within the X-Boot, run the following command to initiate the configuration menu of X-Boot.
...
Once you have made the necessary adjustments in the menu, please ensure to save the changes before exiting the menu.
Configure U-Boot Features (optional)
To customize U-Boot settings, run the following command to initiate the configuration menu of U-Boot.
...
After making the necessary adjustments in the menu, please be sure to save the changes before exiting.
Configure Linux Kernel Features (optional)
For those who want to configure specific features in the Linux kernel, run the following command to initiate the configuration menu of Linux kernel.
...
After making the necessary adjustments in the menu, please ensure to save the changes before exiting.
Build Code
After completing all configurations, you are ready to initiate the code build. Execute the following command to commence the build process:
...
The screenshot provides details about two partitions created in the SD card image. The first partition spans from sector 2,048 to sector 526,335, with a size of 256 MB and a W95 FAT file system. The second partition extends from sector 526,336 to sector 1,627,959, with a size of 537.9 MB and a Linux (ext4) file system.
Resulting Images for SD Card
Upon completion of the build process, the resulting image files are stored in the out/boot2linux_SDcard/
directory. Refer to the list below:
...
ISPBOOOT.BIN: Binary file storing X-Boot, the first-stage boot-loader responsible for DDR SDRAM initialization and training, loading images of TF-A, OP-TEE, U-Boot, and initiating the execution of TF-A.
fip.img: Image file comprising images of Trusted Firmware-A (TF-A) and Open Portable Trusted Execution Environment (OP-TEE).
u-boot.img: Image file of the U-Boot boot-loader, the second-stage boot-loader responsible for loading and running the Linux kernel image.
uEnv.txt: Environment file for U-Boot. U-Boot imports environment variables from this file after initialization. If the uenvcmd command is defined in uEnv.txt, U-Boot executes the specified command after importing uEnv.txt.
uImage: Image file of the compressed Linux kernel with the U-Boot header.
ISP_SD_BOOOT.img: Image file for burning an SD card, containing all files in both partitions.
Create SD Card
To create your SD card for booting SP7350 platforms, you can copy write the image file, ISP_SD_BOOOT.img, to an SD card directly using the dd command. For instance:
...
Depend on system you are using, you may need to unmount the SD card:
umount /dev/sda
Booting Your SP7350 Platform
After creating your SD card, insert it into the SD card socket on your SP7350 platform.
Set the boot-switch to "Boot from SD card".
Connect the cable of your UART console.
Power on your SP7350 platform.
The platform will initiate booting from the SD card.
Once booted, you can enter your commands in the console.
For boot-switch selection guidance, please consult:
https://sunplus.atlassian.net/wiki/spaces/C3/pages/1994621039/A+Guide+to+In-system+Programming+Flash+Devices#Appendix
For example, if you are using SP7350 Evaluation Board, please set boot-selection switch SW2 to all OFF (1111) and SW3 to OFF-OFF-ON-ON (1100) for booting from SD card.
...
In-system Programming a Flash Device and Booting from It.
If you intend to in-system program a flash device (e.g., eMMC) on the SP7350 platform and boot from it, please refer to:
A Guide to In-system Programming Flash Devices
Log of Booting from SD Card
Refer to the log generated during the system booting from the SD card. After the boot process is complete, the 'df -hT' command is issued to display disk space usage on your SP7350 platform.
...