Linux6.1.99_User’s Compilation Manual_V1.0

Document classification: □ Top secret □ Secret □ Internal information ■ Open

Revision History

Date

Version

Revision History

04/09/2025

V1.0

OK3506B-S12_User’s Compilation Manual Initial Version

Note: This compilation manual is only applicable to OK3506B-S12 development board of Forlinx.

Overview

This manual is designed to help you quickly understand the compilation process and become familiar with the compilation methods for Forlinx Embedded products. Before running applications on the development board, they must be cross-compiled on a Linux operating system. By following the methods outlined in this manual and engaging in hands-on exercises, you will be able to compile their own software code.

The manual starts with instructions on setting up the development environment. Since unexpected issues may arise during this process, it is recommended that beginners use the pre-configured development environment. This approach allows for a faster start, reducing overall development time.

There are generally three installation methods for Linux systems: dual-boot on a physical machine, single-boot on a physical machine, and using a virtual machine. This manual will focus on setting up Ubuntu within a virtual machine.

Hardware Requirements: A minimum of 6GB of RAM is recommended. This will allow you to allocate 2GB or more to the virtual machine while still performing other tasks in Windows. Using less RAM may negatively impact the performance of Windows.

There are total 4 chapters:

  • Chapter 1 covers the installation of VMware, specifically version VMware® Workstation 15 Pro 15.1.0. VMware must be installed before setting up the Ubuntu development environment;

  • Chapter 2 explains how to load the Ubuntu development environment provided by Feilin. The environment is based on 64-bit Ubuntu 22.04;

  • Chapter 3 outlines the process of setting up a new Ubuntu development environment. Using 64-bit Ubuntu 22.04 as an example, this chapter describes the creation of the environment. Due to potential differences in computer configurations, unforeseen issues may arise. Beginners are advised to use the pre-configured environment to avoid complications;

  • Chapter 4 explains how to compile source code for the development board.

The manual includes explanations of some symbols and formats.

Format

Meaning

Note

Note or particularly important information must be read carefully.

📚

Relevant explanations regarding the testing section

️️️🛤️ ️️

Related paths.

Blue font on a gray background

Refers to the command entered on the command line, which needs to be entered manually.

Bold font

Serial output information after command input

Black Bold

Key information in the serial output:

//

Explanation of the input command or output information.

Username@Hostname

root@ok3506-buildroot: The login account information for the development board via serial console;
forlinx@ok3506-buildroot: The login account information for the development board via network;
forlinx@ubuntu: The login account information for the development environment on Ubuntu.

This information helps you identify the operational environment for various tasks.

Example: After packaging the file system, use the ls command to view the generated files.

forlinx@ubuntu:~/3506$ ls                             //List the files in this directory
OK3506_Linux_Source  OK3506_Linux_Source.tar.bz2.00 OK3506_Linux_Source.tar.bz2.01
  • forlinx@ubuntu: The username is forlinx, and the hostname is ubuntu, indicating that the operation is being performed in the development environment on Ubuntu;

  • //: Explanation of the command. No need to enter this when typing the command;

  • Ls: blue font with gray background, indicating the relevant command that needs to be entered manually;

  • OK3506_Linux_Source: The output information after inputting the command is shown in black font, and the key information is in bold font. In this case, it refers to the packaged file system.

1. VMware Virtual Machine Software Installation

This chapter mainly introduces the installation of the VMware virtual machine, using VMware Workstation 15 Pro v15.5.6 as an example to demonstrate the operating system installation and configuration process.

1.1 Downloading and Purchasing VMware Software

Visit the VMware official website at https://www.vmware.com/cn.html to download Workstation Pro and obtain the product key. VMware is paid software that requires individual purchase, or you can choose to use a trial version.

Image

After the download is complete, double-click the setup file to launch the installer.

1.2 VMware Software Installation

Double-click the setup file to enter the installation wizard.

Image

Click “Next.”

Image

Check “I accept the terms in the license agreement” and click “Next.”

Image

Modify the installation location to the partition on your computer where software is typically installed, then click “Next.”

Image

Check, then click “Next.”

Image

Check “Add shortcuts” and click “Next.”

Image

Click “Install.”

Image

Wait for the installation to complete.

Image

After clicking “Finish,” you can start the trial. For long-term use, please purchase from the official website and enter the license key.

2. Loading an Existing Ubuntu Development Environment

Note:

  • It is recommended that beginners directly use the virtual machine environment pre-configured by Forlinx, which already has the cross-compiler and Qt environment installed. After reviewing this chapter, you can skip directly to the compilation chapters;

  • The provided development environment has a regular user account: forlinx, with password: forlinx. The superuser account is: root, with password: root.

  • You can access software and hardware documentation, source code, and the development environment via the cloud storage link provided by Forlinx. Please ask your sales representative for the download link.

There are two ways to use the virtual machine environment in VMware: one is to directly load an existing environment, and the other is to create a new environment. First explain how to load an existing environment.

First, download the development environment provided by Forlinx. The development environment package will include an MD5 checksum file. After downloading the package, you should perform an MD5 checksum verification on the compressed file using the MD5 checksum tool for Windows, which you can find at User Data\Software Tools\3-Tools\md5sums-1.2.zip.

Generate the checksum and compare it with the value in the checksum file. If the checksums match, the downloaded file is valid. If they do not match, the file may be corrupted, and you should download it again.

Image

Select all the compressed packages and right click to extract them to the current folder or your own directory:

Once the extraction is complete, you will obtain a folder named “3568 Development Environment.”

Note: The Ubuntu 22.04 development environment for models 3506, 3562, and 3568 is the same.

The file “3568.vmx” in the “3568 Development Environment” folder is the virtual machine file that needs to be opened.

Open the installed virtual machine software.

Image

Navigate to the directory where the “3568.vmx” file was extracted, and double-click to open the startup file.

Once it has finished loading, click to start the virtual machine, and you can run it and enter the system interface.”

The provided development environment is set to automatically log in to the account forlinx on startup by default.

3. Setting Up a New Ubuntu Development Environment

Note: Beginners should avoid building the system themselves; using the existing virtual machine environment is recommended. You can skip this section if building the environment isn’t necessary.

This chapter mainly explains the setup process of the Ubuntu system and the installation of Qt Creator. If QT is not used, the installation of Qt Creator can be ignored.

3.1 Ubuntu System Setup

The installed Ubuntu version is 22.04, and all the introductions and development in this manual were carried out on Ubuntu 22.04. Download the “ubuntu-22.04.6-desktop-amd64.iso” version from https://releases.ubuntu.com/22.04/ (the specific version to download can be based on your own needs; here we use version 22.04.6 as an example).

Image

3.1.1 Creating an Ubuntu Virtual Machine

Step 1: Open the VMware software and click “Create a New Virtual Machine”. On the following screen, check “Custom (advanced)” and click “Next”:

Image

Step 2: Select the compatibility for the corresponding VMware version (you can view the version under Help -> About VMware Workstation). After confirming, click “Next”:

Image

Choose “Installer disc image file (iso)” and click “Next”:

Image

Enter the full name, username, and password, then click “Next”:

Image

Enter the virtual machine name and configure the installation location, then click “Next”:

Image

Configure the number of cores, then click “Next”:

Image

Configure at least 8GB of memory and select “Next”:

Image

Set the network type, use the default NAT networking, and click “Next”. Subsequent steps remain at their default values until the disk capacity step is specified.

Image

Use the recommended I/O controller and click “Next”:

Image

Use the recommended disk type and click “Next”:

Image

Use the default option, “Create a new virtual disk”, and click “Next”:

Image

Allocate a disk size of 200G and choose “Split virtual disk into multiple files”, then click “Next”:

Image

Use the default settings and click “Next”:

Image

Click “Finish”.

Image

Image

At this point, the virtual machine creation is complete. Afterward, click “Power on this virtual machine” to start installing the image. Please wait patiently. With the above, the Ubuntu system installation is complete.

3.1.2 Basic Configuration of Ubuntu

3.1.2.1 VMware Tools Installation

VMware Tools should be installed automatically after creating the virtual machine. If it is not successful, install it according to the following steps. Without this tool installed, you cannot use copy and paste or drag and drop files between the Windows host and the virtual machine. First, click “Virtual Machine” on the VMware navigation bar, then click “Install VMware Tools” in the dropdown menu.

Image

After completion, enter Ubuntu. A VMware Tools CD will appear on the desktop; click to enter it.

Image

After entering, you will see a compressed file VMware Tools-10.3.10-12406962. tar. gz (different virtual machine versions may be different), and copy the file to the home directory (that is, the directory of the home personal user name).

Image

Press [Ctrl+Alt+T] to bring up the terminal command interface and enter the command to extract it:

Image

After extraction completes, a folder named “vmware-tools-distrib” will appear.

Image

Return to the terminal and type: cd vmware-tools-distrib to enter the directory. Then type: sudo ./vmware-install.pl and press Enter. Enter your password and the installation will begin. When prompted, type yes; otherwise, just press Enter to install the default settings.

Image

After VMware Tools installation is complete, file copy-paste between Windows and Ubuntu will be enabled.

3.1.2.2 Virtual Machine Full-Screen Display

If the virtual machine cannot display in full screen, you can click on “View”, select “Auto-Adjust Size”, and then click “Autofit Guest” to resolve the full-screen issue.

Image

Most system settings can be configured in the location shown in the figure. Many settings requirements on Ubuntu can be completed here.

Image

3.1.2.3 Virtual Machine Sleep Settings

Additionally, the default sleep setting is 5 minutes. If you do not want the system to go to sleep, go to Settings -> Power -> Blank Screen and set it to “Never”.

Image

3.1.3 Virtual Machine Swapfile Configuration

When creating the virtual machine, 8GB of memory was allocated. If 8GB of memory is insufficient during compilation, you need to modify the size of the swapfile.

3.1.4 Virtual Machine Network Configuration

3.1.4.1 NAT Connection Mode

By default, after the virtual machine installation is complete, the network connection mode is set to NAT, as shown in the figure below, sharing an IP address with the host machine. This setting does not need to be changed when installing dependency packages, compiling code, etc. In the virtual machine, when the VMware virtual network adapter is set to NAT mode, the network in the Ubuntu environment should be set to dynamic IP. In this mode, the virtual NAT device connects and communicates with the host’s network card for internet access. This is the most commonly used method for the virtual machine to access the external network.

Image

3.1.4.2 Bridged Connection Mode

When the VMware virtual network adapter device is in bridged mode, the host network card and the virtual machine network card communicate through a virtual network bridge. In the Ubuntu environment, you need to set a network IP in the same subnet as the host. To access the external network, you need to set the DNS to be consistent with the host network card. If using servers like TFTP or SFTP, you need to set the virtual machine’s network connection to Bridged Mode.

Image