[Experience sharing] How to replace and test the official Ubuntu 16.04 root file system image of Allwinner

 This article is mainly based on the Allwinner A40i development board - TLA40i-EVM, a 4-core ARM Cortex-A7 high-performance and low-power domestic evaluation board designed based on the Allwinner A40i processor, demonstrating the replacement and testing of the Ubuntu root file system image method.

Chuanglong Technology TLA40i-EVM evaluation board is rich in interface resources, leading to dual-channel network ports, dual-channel CAN, dual-channel USB, dual-channel RS485 and other communication interfaces, onboard Bluetooth, WIFI, 4G (optional) modules, and at the same time leading to MIPI LCD , LVDS LCD, TFT LCD, HDMI OUT, CVBS OUT, CAMERA, LINE IN, H/P OUT and other audio and video multimedia interfaces, support dual-screen different display, 1080P@45fps H.264 video hardware encoding, 1080P@60fps H.264 Video hardware decoding, and supports SATA mass storage interface.

The core board adopts 100% domestic components and has been verified by professional PCB layout and high and low temperature tests. It is stable and reliable, and can meet various industrial application environments. Most of the components on the evaluation board adopt domestic solutions, which is convenient for users to quickly conduct product solution evaluation and technology pre-research.

Please install related documents according to debugging tool installation and Linux development environment, install SecureCRT serial port debugging terminal, VMware virtual machine and other related software, and decompress and install LinuxSDK development package to Ubuntu according to Linux system manual. If there is no special instruction, USB TO UART0 is used as the debugging serial port by default, and the system is started using the Linux system boot card (Micro SD mode), and the network is connected to the PC through the router.

Applicable development environment:

Windows development environment: Windows 7 64bit, Windows 10 64bit

Linux development environment: Ubuntu18.04.4 64bit

Virtual machine: VMware15.1.0

U-Boot:U-Boot-2014.07

Kernel:Linux-3.10.65

Ubuntu: Ubuntu16.04 root file system (about 1.5GByte)

LinuxSDK: LinuxSDK_AA_BB_CC_DD (based on T3_LinuxSDK_V1.3_20190122)

The LinuxSDK_AA_BB_CC_DD.tar.gz development package provided by Tronlong Technology has its own official Ubuntu 16.04 root file system image of Allwinner, which is located in the "buildroot-201611/target/ubuntu_16.04/" directory of the LinuxSDK development package (as shown below) , if you need to replace the Ubuntu root file system, please refer to the following chapters for operation.

 

figure 1

1. Ubuntu root file system replacement

1.1 Replace to Linux system boot card

Insert the Linux system boot card into the USB port of the PC through the Micro SD card reader, and mount it to the Ubuntu system. Execute the following command to confirm the device node name of the Linux system boot card in the Ubuntu system, you can see that the Linux system boot card device node is "/dev/sdb", and there are seven partitions, of which "/dev/sdb7" is the file system where the partition is located.

Remarks: The name of the device node is variable. Generally, after plugging and unplugging multiple times or using different cards, it may display sdc or sdd.

Host#sudo fdisk -l

 

figure 2

image 3

In the lichee source code installation directory of LinuxSDK, execute the following command to enter the directory where the Ubuntu root file system image is located, and solidify it to the file system partition of the Linux system boot card.

Host#cdbuildroot-201611/target/ubuntu_16.04/

Host#sudo dd if=ubuntu of=/dev/sdb7 bs=1024 && sync

Figure 4

The curing process is expected to take about 5 minutes, please wait patiently, and the "records in, records out" message will be printed to indicate that the curing is complete.

 

1.2 Replace to eMMC

Insert the U disk into the USB port of the PC, and mount it to the Ubuntu system. In the directory where the Ubuntu root file system image of the LinuxSDK development kit is located, copy it to a USB flash drive.

Figure 5

After the copy is complete, insert the U disk into the USB1 HOST or USB2 HOST interface of the evaluation board, start the system from the Linux system boot card, and execute the following command to view the device node name of the U disk in the file system.

Target#df -h

Figure 6

Execute the following command to solidify the Ubuntu root file system image of the USB flash drive to the eMMC file system partition (mmcblk0p7). It is expected to take about 4 minutes, and the serial port terminal will print "records in, records out" information to indicate that the curing is complete.

Target#time dd if=/mnt/usb/sda/ubuntu of=/dev/mmcblk0p7 bs=1024 && sync

Figure 7

2 Ubuntu system test

Insert the Linux system boot card into the Micro SD card slot of the evaluation board, and turn the DIP switch to 0 according to the silk screen of the evaluation board. This gear will give priority to booting the system from the Linux system boot card. Power on the evaluation board. After the system starts, enter the user account: root, password: 123. After logging in to the system successfully, the serial port terminal will print the following information.

Figure 8

The Ubuntu system officially provided by Allwinner supports most of the peripheral interfaces except for a few interfaces of CVBS OUT, TVIN, CAMERA0, and CAMETA1. The Ubuntu system does not support the GUI operation interface for the time being, and does not support the online installation of tools through the apt-get command, so some peripheral interface tests need to copy and install the corresponding tools by themselves.

The following chapters take LED and buttons as examples to demonstrate the test method of the Ubuntu system. For other peripheral interface tests, please refer to the evaluation board test manual.

2.1 LED test

The corresponding relationship between LED1, LED2 and GPIO pins on the evaluation board is shown in the table below, and they are on by default after the system starts.

Table 1

LED1

LED2

PB4

PB10

Enter the file system of the evaluation board, and execute the following commands to turn off and turn on the LEDs one by one.

Target# echo 0 > /sys/class/leds/user-led0/brightness//Control LED1 off

Target#  echo 1 > /sys/class/leds/user-led0/brightness //Control LED1 to be bright

Target#  echo 0 > /sys/class/leds/user-led1/brightness//Control LED2 off

Target#  echo 1 > /sys/class/leds/user-led1/brightness//Control LED2 to be bright

Figure 9

2.2 Button test

The evaluation board contains 3 user keys: KEY3, KEY4, KEY5. Enter the file system of the evaluation board and execute the following command to view the event number corresponding to the user key.

Target# cat /proc/bus/input/devices

Figure 10

From the figure above, we can see that the key event number corresponding to KEY3 and KEY4 is event1, and the key event number corresponding to KEY5 is event5.

Execute the following command, press KEY3 and KEY4 to test the key, you can see the following print information, where "0094" means KEY3, "0095" means KEY4, press "Ctrl + C" to terminate the test command.

Target#od -x /dev/input/event1

Figure 11

       Execute the following command, press KEY5 to test the key, you can see the following print information, "00ca" means KEY5, press "Ctrl + C" to terminate the test command.

Target#od -x /dev/input/event5

Figure 12

 If you want to know more about embedded applications, welcome to pay attention to Tronlong Chuanglong Technology~

Guess you like

Origin blog.csdn.net/Tronlong/article/details/131410163