FCU1501_User’s Compilation Manual_FlB22.04
Document classification: □ Top secret □ Secret □ Internal information ■ Open
Copyright
The copyright of this manual belongs to Baoding Folinx Embedded Technology Co., Ltd. Without the written permission of our company, no organizations or individuals have the right to copy, distribute, or reproduce any part of this manual in any form, and violators will be held legally responsible.
Forlinx adheres to copyrights of all graphics and texts used in all publications in original or license-free forms.
The drivers and utilities used for the components are subject to the copyrights of the respective manufacturers. The license conditions of the respective manufacturer are to be adhered to. Related license expenses for the operating system and applications should be calculated/declared separately by the related party or its representatives.
1. VMware Software Installation
This chapter mainly introduces the installation of the VMware virtual machine, using VMware Workstation 17 Pro 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 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.

After the download is complete, double-click the setup file to launch the installer.
1.2 VMware Software Installation
Double-click the programme to launch the installation wizard, then click “Next”.

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

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

Check, then click “Next.”

Check “Add shortcuts” and click “Next.”

Click “Install.”

Wait for the installation to complete.

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 regular user account for the development environment is: “forlinx”, and the corresponding password is: “forlinx”;
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 includes an MD5 checksum file. After downloading the package, you should verify the integrity of the compressed file by performing an MD5 checksum check. You can either use an online MD5 verification tool or download a dedicated MD5 verification tool, depending on your preference. Compare the checksum that you generate with the one listed in the checksum file. If they match, the downloaded file is intact. If they do not match, the file may be corrupted, and you will need to download it again.

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 “ELF-RK3506_Ubuntu22.04”.
**Note: **
The Ubuntu 22.04 development environment for models 3506, 3562, and 3568 is the same;
The file “3506.vmx” in the “3506 Development Environment” folder is the virtual machine file that needs to be opened.
Open the installed virtual machine software.

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

Once it has finished loading, click to start the virtual machine, and you will be able to run it and enter the system interface.

The default account for auto-login upon system boot in the development environment is: “forlinx”, with the password: “forlinx..
3. New Ubuntu Development Environment Setup
Note:
It is not recommended for beginners to build the system by themselves. It is recommended to use the existing virtual machine environment. This section can be skipped if there is no need to build the environment;
This chapter mainly explains the setup process of the Ubuntu system.
3.1 Ubuntu System Setup
The installed Ubuntu version is 22.04.5 LTS, and all the introductions and development in this manual were carried out on it. Download the “ubuntu-22.04.5-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 Ubuntu22.04.5 LTS as an example).

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”:

Step 2: Choose the compatibility for the corresponding VMware version. The version can be found under Help ->About VMware Workstation. Click ‘’Next.’’

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

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

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

Set the number of processors according to your needs.

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

Similarly, set the memory size according to your needs. It is recommended to use 16GB.

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

Choose the default LSI for the IO controller type.

Similarly, select SCSI as the default here.

Choose to create a new virtual disk:

Set the disk size to 200GB and select the disk’s format, then click ‘Next’ to complete.

Specify the disk file, the default setting is fine here.

Click ‘’Finish’’ by default to complete.

At this point, the virtual machine creation is complete.
Once the virtual machine is created, wait for the installation interface to appear as shown below.:
The default language of Ubuntu is English, but others can also be selected.

The default language can be changed later. After making your selection, click “Continue”.

Next, choose the default option, click Continue to proceed with the installation. The process will take some time. Then click “Continue” again.

Click Install Now by default, and a prompt will appear. Click “Continue”. In any subsequent pop-up windows, simply click “Continue”.

Choose your timezone. Here, you can click Shanghai or type Shanghai to select the timezone (choose a different timezone based on your location if needed), and click Continue.
Finally, set your username and password, choose between automatic login and logging in with your username and password, and click “Continue” to start the installation.

If your internet connection is poor, you can click “Skip”—this won’t affect the installation.

Click “Restart Now” to restart the system.

Once Ubuntu starts up, click “Skip” when this pop-up appears.

Click “Next”.

Click “Next”.

Click “Next”.

Click “done”.

Ubuntu is successfully installed.
3.1.2 Basic Configuration of Ubuntu
After installing the Ubuntu 20.04 operating system, some configurations need to be done.
Open a terminal and use the system’s built-in open-vm-tools:
sudo apt update && sudo apt install open-vm-tools open-vm-tools-desktop –y
Ubuntu 22.04 uses Wayland by default, but the copy-and-paste functionality of VMware Tools currently does not work well with it. You need to switch to Xorg.
From the menu that appears when Ubuntu starts, select “Ubuntu on Xorg” or “Xorg”

to enable copying and pasting files between Windows and Ubuntu.
Full-screen display for the virtual machine:
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.

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

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”.

3.1.3 Virtual Machine Network Configuration
3.1.3.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.

3.1.3.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.

5. Ubuntu Application Development
This chapter explains how to set up the Ubuntu application development environment, develop Qt applications, and use the FCU1501 development board as a real device for program debugging. It is highly suitable for Ubuntu beginners to learn and reference.
Note: The Ubuntu system image will not auto-expand. You need to refer to the documentation to complete the capacity expansion process (please ask your sales representative for it).
5.1 Ubuntu Application Development Environment Setup
Download and install relevant tools.
forlinx@ubuntu: ~/work/fcu1501-linux-source$ sudo apt update && sudo apt install qemu-user-static
[sudo] password for elf:
Get:1 https://packages.microsoft.com/repos/code stable InRelease [3,590 B]
Hit:2 http://mirrors.huaweicloud.com/repository/ubuntu jammy InRelease
Get:3 http://mirrors.huaweicloud.com/repository/ubuntu jammy-updates InRelease [128 kB]
Hit:4 http://mirrors.huaweicloud.com/repository/ubuntu jammy-backports InRelease
Get:5 http://mirrors.huaweicloud.com/repository/ubuntu jammy-security InRelease [129 kB]
Get:6 https://packages.microsoft.com/repos/code stable/main amd64 Packages [29.7 kB]
Get:7 http://mirrors.huaweicloud.com/repository/ubuntu jammy-updates/main amd64 Packages [3,721 kB]
Get:8 http://mirrors.huaweicloud.com/repository/ubuntu jammy-updates/main i386 Packages [1,060 kB]
Get:9 http://mirrors.huaweicloud.com/repository/ubuntu jammy-updates/main Translation-en [554 kB]
Get:10 http://mirrors.huaweicloud.com/repository/ubuntu jammy-updates/restricted Translation-en [1,229 kB]
Get:11 http://mirrors.huaweicloud.com/repository/ubuntu jammy-security/main i386 Packages [880 kB]
Get:12 http://mirrors.huaweicloud.com/repository/ubuntu jammy-security/main amd64 Packages [3,448 kB]
Get:13 http://mirrors.huaweicloud.com/repository/ubuntu jammy-security/main Translation-en [486 kB]
Get:14 http://mirrors.huaweicloud.com/repository/ubuntu jammy-security/restricted amd64 Packages [6,174 kB]
Get:15 http://mirrors.huaweicloud.com/repository/ubuntu jammy-security/restricted Translation-en [1,186 kB]
Fetched 19.0 MB in 9s (2,181 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
qemu-user-static is already the newest version (1:6.2+dfsg-2ubuntu6.31).
The following package was automatically installed and is no longer required:
p7zip
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Mount armubuntu and copy the program source code.
forlinx@ubuntu:~/work/fcu1501-linux-source$ cd ubuntu/
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu$ mkdir ubuntufs
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu$ sudo mount jammy-rootfs.img ubuntufs // Mount the ARM Ubuntu root filesystem image
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu$ cd ubuntufs/
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu/ubuntufs$ ls // You can see the directory structure below is identical to that on the development board
apps bin boot build.sh debian-base.sh dev etc forlinx-base.sh home lib lost+found media mnt opt proc root run sbin srv sys tmp usr var
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu/ubuntufs$ cd ../../ // Switch to the source code root directory
forlinx@ubuntu:~/work/fcu1501-linux-source/$ sudo cp -r app/forlinx/forlinx_cmd_demo/fltest_watchdog ubuntu/ubuntufs/home/forlinx // Copy the program demo from the source directory to the home/forlinx path under the mounted Ubuntu virtual environment
Enter the Ubuntu virtual environment.
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu/ubuntufs$ sudo mount -t proc /proc proc/
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu/ubuntufs$ sudo mount -t sysfs /sys sys/
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu/ubuntufs$ sudo mount -o bind /dev dev/
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu/ubuntufs$ sudo mount -o bind /dev/pts dev/pts
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu/ubuntufs$ sudo mount -o bind /run run/
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu/ubuntufs$ sudo chroot .
Compile the program and import fltest_watchdog to the development board.
root@ubuntu:/# cd /home/forlinx
root@ubuntu:/home/forlinx# cd fltest_watchdog/
root@ubuntu:/home/forlinx/fltest_qt_rtc# make
root@ubuntu:/home/forlinx/fltest_qt_rtc# ls
Makefile fltest_watchdog fltest_watchdog.c


Unmount and exit.
root@ubuntu:/home/forlinx/rtc# exit
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu/ubuntufs$ cd ..
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu$sudo umount ubuntufs/proc
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu$sudo umount ubuntufs/sys
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu$sudo umount ubuntufs/dev/pts
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu$sudo umount ubuntufs/dev
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu$sudo umount ubuntufs/run
forlinx@ubuntu:~/work/fcu1501-linux-source/ubuntu$sudo umount ubuntufs




