Versions Compared

Key

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

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.

It's recommended to have the latest version of Ubuntu installed on your computer. This choice is optimal for compatibility and ensures a seamless compilation process. Additionally, to enhance performance and reduce compilation time, your PC should be equipped with a minimum of 4 GB DRAM.

Table of Contents

Table of Contents
minLevel1
maxLevel6
include
outlinefalse
indent
exclude
typelist
class
printablefalse

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

  • u-boot-toolsmtd-utils

  • mtools

  • openssl

  • bison

  • flex

  • mtd-utilspv

  • python3-pippv

  • u-boot-tools

Libraries:

  • libssllibncurses*

  • libgmp-dev

  • libmpc-dev

  • libgmplibssl-dev

Python3 Packages:

  • crypto

  • pycryptodomex

  • pyelftoolscrypto

If not yet installed, use the following commands:

Code Block
sudo apt install bison flex git make u-boot-toolsmtd-utils mtools openssl bison flex mtd-utils pv python3-pip pvu-boot-tools
sudo apt install libssllibncurses* libgmp-dev libmpc-dev libgmplibssl-dev
pip install crypto pycryptodomex pyelftools crypto

Download Code from GitHub or Gitee.

Clone the repository from GitHub:

...

Code Block
# Navigate to the Q654 directory
cd Q654

# UpdateInitialize the code and itsupdate submodules
git submodule update --init --recursive

# Ensure all submodules are on the master branch
git submodule foreach git checkout master

Update to the latest code after the initial download:

Code Block
# Navigate to the Q654 directory
cd Q654

# Pull the latest changes from the repository
git pull

# Pull updates for all submodules
git submodule foreach git pull

...

This structure confirms that you have successfully updated the Q654 codebase, and your development environment is now aligned with the latest changesenvironment is now aligned with the latest changes.

While the master branch contains the latest development code, stable versions of the code are maintained in branches such as v1.0 and v1.1.

To switch to a stable branch, use the following commands:

Code Block
# Checkout the desired branch for all submodules
git submodule foreach git checkout v1.1

# Pull the latest updates for the specified branch
git submodule foreach git pull

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.

...

Upon executing this command, a configuration menu will appear, providing several options for customization: image-20240305-040354.pngImage Removed

...

In the configuration menu:

  1. Choose the board you want to build the image for. For instance, press 1 2 to select "SP7350 Ev IO Board."

  2. Choose the device from which the system will boot device. For example, press 5 2 to specify booting from the SD card.

  3. Choose root file-system of Linux. For example, press 1 7 to opt for “BusyBox 1.31“Ubuntu MATE 24.04.1” as root file-system.

  4. Choose image securityboot modes. Press 1 to select building “No secure” “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:

make

Alternatively, if you're not using the English version of Ubuntu, use:

LANG=C make

This command instructs make to avoid using your native language.

make will then proceed to compile the code based on your chosen configurations. The duration of this process depends on your computer's performance, typically taking a few minutes. Kindly exercise patience and allow the system to complete the build.

...

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

  1. After creating your SD card, insert it into the SD card socket on your SP7350 platform.

  2. Set the boot-switch to "Boot from SD card".

  3. Connect the cable of your UART console.

  4. Power on your SP7350 platform.

  5. The platform will initiate booting from the SD card.

  6. 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+inIn-system+programmingProgramming+flash+devices+on+the+SP7350+platforms#AppendixFlash+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 on the SP7350 platforms

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.

...