Difference between revisions of "CL-SOM-iMX7: Yocto Linux: User Space"

From Compulab Mediawiki
Jump to: navigation, search
(WiFi)
imported>Uri.mashiach
 
Line 2: Line 2:
 
The example run-time Yocto Linux filesystem image for the CompuLab CL-SOM-iMX7 System-on-Module / Computer-on-Module is based on NXP Community Yocto Project BSP for i.MX based boards.
 
The example run-time Yocto Linux filesystem image for the CompuLab CL-SOM-iMX7 System-on-Module / Computer-on-Module is based on NXP Community Yocto Project BSP for i.MX based boards.
  
The [[CL-SOM-iMX7: Yocto Linux: Manual Installation: SD card|Yocto Linux manual installation on SD card]] page provides a brief introduction on how to install the run-time Yocto Linux image.
+
[[CL-SOM-iMX7: Yocto Linux: Creating Live-SD card|Creating Live SD-card]] article provides a brief introduction on how to create and use the live Yocto Live-SD card.
  
{{Note|The article uses {{cmd|cl-rootfs}} hostname. A real hostname may be different.}}
+
{{:Transclusion: CL-SOM-iMX7: Yocto Linux: User Space}}
 
 
== Using Yocto Linux on CL-SOM-iMX7 ==
 
 
 
=== Connection and Logging In ===
 
Use the root username to login:
 
 
 
<pre>
 
cl-rootfs login: root
 
</pre>
 
 
 
=== Networking ===
 
The networking configuration in the example Yocto Linux image is almost the same as in the [[CL-SOM-iMX7: Linux: Debian#Networking |Debian Linux image]].
 
 
 
=== Analog Audio ===
 
{{:Transclusion: Debian: CL-SOM-iMX7: Analog Audio}}
 
 
 
=== WiFi ===
 
CL-SOM-iMX7 features 802.11b/g/n wireless connectivity solution, implemented with a TI WiLink8 Combo module. The device driver name is {{cmd|wl18xx}}.<br>
 
UCM-iMX7 features 802.11b/g/n wireless connectivity solution, implemented with a Broadcom BCM4343W chipset. The device driver name is {{cmd|bcmdhd}}.<br>
 
By default all wireless interfaces are soft blocked. Use the {{cmd|rfkill}} utility to block/unblock wireless interfaces and display their status.
 
 
 
==== WiFi Initialization ====
 
* The {{cmd|wl18xx}} driver gets loaded automatically. Make sure that the WiFi driver is loaded.
 
<pre>
 
root@cl-rootfs:~# lsmod | grep wl18xx
 
wl18xx                84190  0
 
</pre>
 
<blockquote>
 
The {{cmd|wl18xx}} driver can be loaded manually:
 
<pre>
 
root@cl-rootfs:~# modprobe wl18xx
 
</pre>
 
</blockquote>
 
* The {{cmd|bcmdhd}} should be loaded manually:
 
<blockquote>
 
The driver options are specified in an options file:
 
<pre>
 
root@cl-rootfs:~# cat /etc/modprobe.d/bcmdhd.conf
 
options bcmdhd firmware_path=/lib/firmware/brcm/1DX/fw_bcmdhd.bin
 
options bcmdhd nvram_path=/lib/firmware/brcm/1DX/bcmdhd.1DX.SDIO.cal
 
options bcmdhd dhd_msg_level=0x1
 
</pre>
 
Load the {{cmd|bcmdhd}} driver module:
 
<pre>
 
root@cl-rootfs:~# modprobe bcmdhd
 
dhd_module_init in
 
...
 
Register interface [wlan0]  MAC: b0:72:bf:09:b5:fc
 
</pre>
 
</blockquote>
 
 
 
* Configure wpa_supplicant to connect to SSID with no key management. Put the network name into the "ssid" fields:
 
<pre>
 
root@cl-rootfs:~# cat << EOF > /etc/wpa_supplicant.conf
 
network={
 
        scan_ssid=1
 
        ssid="wireless_network_name"
 
        key_mgmt=NONE
 
}
 
EOF
 
</pre>
 
:or with key management. Put the network name and the password into the "ssid/psk" fields:
 
<pre>
 
root@cl-rootfs:~# cat << EOF > /etc/wpa_supplicant.conf
 
network={
 
        scan_ssid=1
 
        ssid="wireless_network_name"
 
        key_mgmt=WPA-PSK
 
        psk="wireless_network_password"
 
}
 
EOF
 
</pre>
 
* Unblock the interface:
 
<pre>
 
root@cl-rootfs:~# rfkill unblock 1
 
root@cl-rootfs:~# rfkill list 1
 
1: phy0: wlan
 
        Soft blocked: no
 
        Hard blocked: no
 
</pre>
 
* Bring the wireless interface up:
 
<pre>
 
root@cl-rootfs:~# ifup wlan0
 
</pre>
 
* Obtain an IP address:
 
<pre>
 
root@cl-rootfs:~# udhcpc -i wlan0
 
</pre>
 
  
 +
== See also ==
 +
* [[CL-SOM-iMX7: Evaluation Kit: Getting Started|Getting started with CL-SOM-iMX7 Evaluation Kit]]
 +
* [[CL-SOM-iMX7: Evaluation Kit: Hardware Guide|CL-SOM-iMX7 Evaluation Kit Hardware Guide]]
 +
* [[CL-SOM-iMX7: Yocto Linux: Creating Live-SD card|Creating a Live-SD card]]
 +
* [[CL-SOM-iMX7: Yocto Linux: Building|Building Yocto Linux images for CL-SOM-iMX7]]
 
[[Category:Linux]]
 
[[Category:Linux]]
 
[[Category:Yocto]]
 
[[Category:Yocto]]

Latest revision as of 14:37, 23 January 2019

Overview

The example run-time Yocto Linux filesystem image for the CompuLab CL-SOM-iMX7 System-on-Module / Computer-on-Module is based on NXP Community Yocto Project BSP for i.MX based boards.

Creating Live SD-card article provides a brief introduction on how to create and use the live Yocto Live-SD card.


Admolition note.png The article uses cl-rootfs hostname. A real hostname may be different.

Using Yocto Linux

Connection and Logging In

Use the root username to login:

cl-rootfs login: root

Networking

The networking configuration in the example Yocto Linux image is almost the same as in the Debian Linux image.

Analog Audio

Use aplay -l to list all sound cards and digital audio devices registered on the system:

root@cl-rootfs:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: clsomimx7 [cl-som-imx7], device 0: 308a0000.sai-wm8731-hifi wm8731-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Analog Audio Playback

In order to play back a sound file make use of the aplay application.

  • aplay -L can be used for listing of all pcm devices.

Here is a sample output of aplay -L command:

root@cl-rootfs:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=clsomimx7
    cl-som-imx7, 
    Default Audio Device
sysdefault:CARD=clsomimx7
    cl-som-imx7, 
    Default Audio Device
dmix:CARD=clsomimx7,DEV=0
    cl-som-imx7, 
    Direct sample mixing device
dsnoop:CARD=clsomimx7,DEV=0
    cl-som-imx7, 
    Direct sample snooping device
hw:CARD=clsomimx7,DEV=0
    cl-som-imx7, 
    Direct hardware device without any conversions
plughw:CARD=clsomimx7,DEV=0
    cl-som-imx7, 
    Hardware device with all software conversions

The next command can be used for audio play back:

root@cl-rootfs:~# aplay -D sysdefault <wav-file>

Audio Input Settings

CL-SOM-iMX7 provides an audio capturing feature from either Mic or Line In input sources. alsamixer or amixer can be used in order to switch between these inputs.

Mic
  • alsamixer
Capture Volume => 100
Line Capture Switch => off
Mic Capture Switch => on
Input Mux => Mic
  • amixer
amixer cset numid=1 65536
amixer -c 0 cset numid=3 31,31
amixer -c 0 cset numid=4 0
amixer -c 0 cset numid=6 1
amixer -c 0 cset numid=14 1
Line In
  • alsamixer
Capture Volume => 100
Line Capture Switch => on
Mic Capture Switch => off
Input Mux => Line In
  • amixer
amixer cset numid=1 65536
amixer -c 0 cset numid=3 31
amixer -c 0 cset numid=4 1
amixer -c 0 cset numid=6 0
amixer -c 0 cset numid=14 0

Sample Audio Recording

As soon as the correct input values have been set, audio signal can be captured. Here is a sample command that shows the arecord usage for capturing audio signal from the selected input line.

root@cl-rootfs:~# arecord -D sysdefault -d 10 -f dat -t wav /tmp/out.wav

WiFi

CL-SOM-iMX7 features 802.11b/g/n wireless connectivity solution, implemented with a TI WiLink8 Combo module. The device driver name is wl18xx.
By default all wireless interfaces are soft blocked. Use the rfkill utility to block/unblock wireless interfaces and display their status.

WiFi Initialization

  • WiFi requires no user interaction for being configured. The driver gets loaded automatically.

Make sure that the WiFi driver is loaded:

root@cl-som-imx7:~# lsmod | grep wl18xx
wl18xx                 70950  0

The WiFi driver can be loaded manually:

root@cl-som-imx7:~# modprobe wl18xx
	wlcore: ERROR could not get configuration binary ti-connectivity/wl18xx-conf.bin: -2
	wlcore: WARNING falling back to default config
	wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
	wlcore: loaded
  • iwconfig command from wireless-tools package can be used to retrieve detailed information about the WiFi interfaces:
root@cl-som-imx7:~# iwconfig wlan0
wlan0     IEEE 802.11  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
  • Unblock the interface:
root@cl-som-imx7:~# rfkill unblock wifi
wlcore: PHY firmware version: Rev 8.2.0.0.236
wlcore: firmware booted (Rev 8.9.0.0.69)
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
  • Activate the interface:
root@cl-som-imx7:~# ifconfig wlan0 up
  • Sample WiFi scanning:
root@cl-som-imx7:~# iwlist wlan0 scan

The output will show the list of Access Points and Ad-Hoc cells in range. For more information about connecting to wireless networks and tuning WiFi interfaces refer to “wpa_supplicant” and “wireless-tools” man pages.

wpa_supplicant

  • Configure wpa_supplicant to connect to SSID with no key management. Put the network name into the "ssid" fields:
root@cl-som-imx7:~# cat << EOF > /etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
network={
        ssid="wireless_network_name"
        key_mgmt=NONE
}
EOF
or with key management. Put the network name and the password into the "ssid/psk" fields:
root@cl-som-imx7:~# cat << EOF > /etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant

network={
        ssid="wireless_network_name"
        key_mgmt=WPA-PSK
        psk="wireless_network_password"
}
EOF
  • Sample run
root@cl-som-imx7:~# ifconfig wlan0 up
root@cl-som-imx7:~# wpa_supplicant -B -Dwext -c /etc/wpa_supplicant.conf -i wlan0
root@cl-som-imx7:~# dhclient wlan0

See also