Preface
This guide document is applicable to the development environment:
Windows development environment: Windows 7 64bit, Windows 10 64bit
Linux development environment: Ubuntu 14.04.3 64bit
Virtual machine: VMware14.1.1
U-Boot: U-Boot-2017.01
Kernel: Linux-4.9.65, Linux-RT-4.9.65
Linux Processor SDK: ti-processor-sdk-linux-rt-am437x-evm-04.03.00.05
Before proceeding with the operations in this document, please follow the documentation on debugging tool installation and Linux development environment construction to install the SecureCRT serial port debugging terminal, VMware virtual machine, Linux Processor SDK and other related software.
This document mainly provides the hardware resource test method of the evaluation board. Without special instructions, UART0 is used as the debugging serial port by default, the system is started using the Linux system boot card, and the network connection with the PC is established through a router.
Evaluation Board Quick Test
System startup test
Connect the power supply and use a Micro USB cable to connect the PC and the USB TO UART0 debugging serial port of the evaluation board.
Figure 1
Open the device manager and confirm the COM port number corresponding to the UART0 debug port of the evaluation board.
Figure 2
Figure 3
Open the serial debugging terminal SecureCRT, select the corresponding COM port number, set the baud rate to 115200, 8N1, no check bit. Establish a serial port connection, as shown in the figure below.
Figure 4
Insert the Linux system boot card into the Micro SD card slot of the evaluation board, and set the DIP switch to 00110 (1-5) according to the silk screen printed on the evaluation board. This position is the SD card boot mode. Power on the evaluation board, and the serial terminal will print the following similar boot information.
Figure 5
Figure 6
Figure 7
The LED changes during system startup are described as follows:
After the evaluation board is powered on, the power indicator D3 lights up; then the first stage of U-Boot starts, and D1 lights up; then the second stage of U-Boot starts, and D2 lights up; until the kernel starts running, D2 goes out and D1 flashes for a heartbeat; when NAND FLASH is read and written, D2 flashes.
After the system starts, the root user will be logged in automatically, indicating that the evaluation board is successfully started using the Linux system startup card.
Figure 8
File transfer test
The common ways to transfer files between a PC and the evaluation board are as follows:
- Copy through storage media such as Linux system startup card and USB disk.
- Copy through network methods such as NFS, TFTP, and OpenSSH.
- Boot the card through Linux system
Insert the matching system startup card into the PC, and then copy the files to be copied to the evaluation board to the BOOT partition of the system startup card, as shown in the figure below.
Figure 9
Insert the system boot card into the evaluation board, start the system and execute the following command to view the partition information. The BOOT partition of the system boot card is mounted in the evaluation board file system directory "/run/media/mmcblk0p1".
Target# df
Target# ls /run/media/mmcblk0p1
Fig.10
OpenSSH is a free and open source implementation of the SSH (Secure SHell) protocol. The SSH protocol family can be used for remote control or to transfer files between computers. The evaluation board file system supports the SSH library by default.
Run the following command in Ubuntu to check whether OpenSSH is installed.
Host# ssh -v
Fig.11
You can see that the system already has OpenSSH installed. If it is not installed, please install OpenSSH correctly first.
Connect the RGMII ETH1 network port of the evaluation board to the router via an Ethernet cable. Execute the following command on the evaluation board to automatically obtain the IP, as shown in the figure below. "-i" is used to specify the network card, eth0 is the name of the network card, please modify it according to the actual situation.
Target# udhcpc -i eth0
Fig.12
Execute the following command to query the IP address. The IP address queried this time is 192.168.0.106.
Target# ifconfig
Fig.13
- Use OpenSSH to transfer files from the PC to the evaluation board
Run the following command to create a new file test1 in Ubuntu, and use the OpenSSH command to copy the test1 file to the root directory of the evaluation board file system.
Host# touch test1 //Create a new file
Host# scp test1 root@192.168.0.106:/
Fig.14
If the prompt "Are you sure you want to continue connecting (yes/no)?" appears, enter: yes.
Execute the following command on the evaluation board to see the files copied from the PC, as shown in the figure below.
Target# ls /
Fig.15
- Using OpenSSH to transfer files from the evaluation board to the PC
Run the following command to create a test file test2 in the root directory of the evaluation board file system.
Target# cd /
Target# touch test2 //Create a new file
Fig.16
Run the following OpenSSH command on Ubuntu to copy the evaluation board test file test2 to the PC's "/home/tronlong/test/" directory. If transferring a folder, add the parameter "-r" after scp.
Host # sudo scp root@192.168.0.106:/test2 /home/tronlong/test/
Host # ls /home/tronlong/test/
Fig.17
- Use OpenSSH to log in to the evaluation board file system
Run the following command in Ubuntu to log in to the evaluation board file system through OpenSSH.
Host# sudo ssh root@192.168.0.106
Fig.18
To log out, execute the exit or logout command.
LED Testing
The corresponding relationship between the LED and GPIO of the evaluation board is shown in the following table.
Table 1
D8
|
D9
|
D10
|
D11
|
GPIO5[10]
|
GPIO5[11]
|
GPIO5[12]
|
GPIO5[13]
|
- Light up the LEDs one by one
Enter the evaluation board file system and execute the following commands to turn on and off the LEDs one by one.
Target# echo 0 > /sys/class/leds/user-led0/brightness //Control D8 to turn off
Target# echo 1 > /sys/class/leds/user-led0/brightness //Control D8 brightness
Target# echo 0 > /sys/class/leds/user-led1/brightness //Control D9 to turn off
Target# echo 1 > /sys/class/leds/user-led1/brightness //Control D9 brightness
Target# echo 0 > /sys/class/leds/user-led2/brightness //Control D10 to turn off
Target# echo 1 > /sys/class/leds/user-led2/brightness //Control the brightness of D10
Target# echo 0 > /sys/class/leds/user-led3/brightness //Control D11 off
Target# echo 1 > /sys/class/leds/user-led3/brightness //Control the brightness of D11
Fig.19
Copy the led_loop.sh script program in the product document "4-Software Documents\Demo\platform-test-demos\led" directory to the evaluation board file system. Enter the script program path and execute the following command to run the script program to light up the LED in a loop.
Target# ./led_loop.sh
Fig. 20
You can press "Ctrl+C" to terminate the script.
When executing the program, if the prompt "-ash: ./led_loop.sh: Permission denied" appears, you can execute the command "chmod 777 led_loop.sh" to obtain execution permission.
Button test
The corresponding relationship between the evaluation board user buttons and GPIO is shown in the following table.
Table 2
KEY0
|
K E
|
GPIO3[7]
|
GPIO3[8]
|
Enter the evaluation board system and execute the following command to view the key event number.
Target# cat /proc/bus/input/devices
Fig.21
From the above figure, you can see that the key event number is event0. Execute the following command to test the key.
Target# od -x /dev/input/event0
Press the two user buttons of the evaluation board in sequence, and you will see the following printed information. Press "Ctrl+C" to terminate the test command.
Fig. 22
Clock Setting Test
The Linux system has a system clock (software clock) and an RTC clock (hardware clock). The system clock will disappear when the power is off, and the RTC clock will run for a long time if a battery is installed.
If you need to use the RTC clock, please install the RTC battery first. The following are common commands related to the clock.
Target# date
Fig.23
Target# hwclock -u
Fig.24
Target# date -s "2020-08-07 15:27:00" //Set time: 15:27:00 on August 7, 2020
Target# date
Fig.25
- Synchronize system clock to RTC clock
Target# hwclock --systohc -u
Target# hwclock -u
Fig.26
- Synchronize RTC clock to system clock
Target# hwclock --hctosys -u
Fig. 27
CAN bus test
The evaluation board has two CAN interfaces. The test method is: connect the two CAN interfaces and test the correctness of data sent and received between the two CAN interfaces.
Fig.28
Please connect the two CAN interfaces as follows.
- CAN0 interface H terminal is connected to CAN1 interface H terminal.
- CAN0 interface L terminal is connected to CAN1 interface L terminal.
- The GND terminal of the CAN0 interface is connected to the GND terminal of the CAN1 interface.
Enter the evaluation board file system and execute the following command to view the CAN device.
Target# cat /proc/net/dev
Fig.29
Execute the following command to view the usage of CAN configuration commands.
Target# canconfig --help
Fig.30
Copy the two scripts canconfig-can0-1.sh and can0-to-can1-test.sh in the product document "4-Software Documents\Demo\platform-test-demos\can_test" folder to any path in the evaluation board file system. Execute the following command in the script path to run the script and test the CAN interface communication function.
Target # ./canconfig-can0-1.sh
Fig.31
Target # ./can0-to-can1-test.sh
Fig.32
The task of the script program is to send 20 frames of preset data from CAN0 to CAN1, and at the same time send 20 frames of preset data from CAN1 to CAN0, and save these two sets of data to can0to1data.txt and can1to0data.txt files.
Fig.33
Open the can0to1data.txt and can1to0data.txt files generated in the current directory and check whether the file contents are consistent with the following figure. If they are consistent, it means that the CAN communication function is normal.
Target# cat can0to1data.txt
Target# cat can1to0data.txt
Fig.34
FRAM read and write test
This section performs read and write tests on the evaluation board's FRAM.
Execute the following command to write the string data to FRAM.
Target# echo "www.tronlong.com" > /sys/devices/platform/44000000.ocp/4819c000.i2c/i2c-2/2-0050/eeprom
Execute the following command to read the data written to FRAM.
Target# head -c 16 /sys/class/i2c-adapter/i2c-2/2-0050/eeprom
Fig.35
DDR read and write test
When the Linux system starts, DDR initialization is completed in the U-Boot stage and the actual DDR capacity is printed, as shown in the following figure.
Fig.36
DDR read and write speeds are affected by actual conditions. The test speed is subject to specific conditions. The following test data is for reference only.
Enter the evaluation board system and execute the following command to test the DDR read speed.
Target# bw_mem 100M rd
Fig.37
The test reads 100MByte of data from DDR, and we can see that the reading speed of this test is about 375.03MB/s.
Enter the evaluation board system and execute the following command to test the DDR write speed.
Target# bw_mem 100M wr
Fig.38
The test writes 100MByte data into DDR, and we can see that the write speed of this test is about 275.43MB/s.
Enter the evaluation board system and execute the following command to test the DDR copy speed.
Target# bw_mem 100M cp
Fig.39
The test copies 100MByte data to DDR, and we can see that the copy speed of this test is about 195.63MB/s.