cancel

[EB-IMX8MM] 4. Test and Use an Interface. (Bluetooth A2DP, Ethernet, UART, WiFi, SPK-OUT)

December 03, 2020

After building the Yocto Linux and installing the image from UUU, the functions can start to be tested.

Contents


Bluetooth A2DP function test:

Initialized the Bluetooth module

# hciattach /dev/ttymxc0 bcm43xx 3000000 flow -t 30

Turn on the Bluetooth function controller

# bluetoothct1

Turn on Bluetooth

[bluetooth] #power on

Check the status of Bluetooth function.

[bluetooth] # show

To test Bluetooth A2DP playback, the Pulse audio control module has to be loaded. In order to simplify the operation, turn on another terminal (terminal2) and load the control module to it.

# pulseaudio –D

In the meantime, the Bluetoothctl will load more control modules. Scan Bluetooth in the terminal1.

[bluetooth] # scan on

Stop scanning after you have seen your Bluetooth device.

[bluetooth] # scan off

Connect to the Bluetooth device. (Ex: Bluetooth headphone or speaker)

[bluetooth] # connect BT-addr

Check the terminal to see whether A2DP is supported after connecting the Bluetooth device.

# pactl info

Start to play music for testing.

# gat-launch-1.0 playbin uri=file:///path

 


 

Ethernet test:

Use the PING command to test network connections.

# ping –c 10 www.google.com

iPerf3 network bandwidth test. Normally, when testing the network by iPerf3, you will need to prepare a server-side and client-side to test the iPerf3 simultaneously.
First, start iPerf3 on the server-side.

# Server-side

# iperf3 –s

Secondly, start iPerf3 on the client-side.

# Client-side

# iperf3 –c SERVER IP

The SERVER_IP on the client-side should be set to the server-side’s IP or device name.
When iPerf3 is testing, both server-side and client-side will display the data (testing results shown below):

 


 

UART Overview:

There are 4x UART on the EBOX-IMX8MM with default settings below:

UART1 is connected to the WLAN/Bluetooth module

UART2 is connected to the console function

UART3 is connected to the J19 connector on the board

UART3 is connected to the J21 connector on the board.

If the EBOX does not have WLAN or Bluetooth, UART1 will be connected to the J15 connector.

 

UART naming under Linux:

UART 1: /dev/ttymxc0

UART 2: /dev/ttymxc1

UART 3: /dev/ttymxc2

UART 4: /dev/ttymxc3

 

Put the UART testing tool file in the root file of Linux (Contact info@icop.com.tw for the testing tool)

 

Testing UART3:

# ./linux-serial-test –p /dev/ttymxc2 –o 5 –i 6 –c

Testing UART4:

# ./linux-serial-test –p /dev/ttymxc3 –o 5 –i 6 –c

 


 

Wi-Fi Function Test:

To connect SSID, turn off wlan0 with the command below:

# ifconfig wlan0 down

Connect to the SSID and input the SSID password:

# iwconfig wlan0 essid “SSID” key “SSIDPASSWORD”

Turn on wlan0:

# ifconfig wlan0 up

Request IP address from DHCP server:

# udhcpc –i wlan0

Use the PING command to test network connections:

# ip=$(ifconfig wlan0 | grep “inet addr” | cut –f 1 –d B | sed ‘s/inet addr://g’);ping –c 5 S $ip www.google.com.tw

 


 

Headphone SPK-OUT Test:

Plug in cable and use path below:

# gst-launch-1.0 playbin uri=file:///path audio-sink=alsasink

The path can be WAV, MP3, FLAC, etc.
After inputting the file, audio should be playing from Headphone or SPK-OUT.

If you need to set PCM volume (Audio decoder’s main volume), the range can be set between 0 to 127.

# amixer set Headphone 80

 


 

Recording Test:

Plug the MIC into the MIC-IN connector and input the command below to start recording. After recording is finished, it will generate an audio file named test.wav:

# arecord –D hw:0, 0 –r 48000 –c 2 –f S16_LE test.wav

Play test.wav with the command below:

# aplay test.wav