CL-SOM-AM57x: Yocto Linux: User Space

From Compulab Mediawiki
Jump to: navigation, search

Overview

The example run-time Yocto Linux filesystem image for the CompuLab CL-SOM-AM57x System-on-Module / Computer-on-Module is based on Texas Instruments Arago project.

The Automatic Installation page provides a brief introduction on how to install the run-time Yocto Linux image.

Using Yocto Linux on CL-SOM-AM57x

Connection and Logging In

Use the root username to login:

cl-som-am57x login: root

To login into the Linux system, you may use a serial console (ttyO2) at 115200 bps, or connect through the network, or use a keyboard and HDMI display.

X Windows system

The Arago root filesystem image contains fully featured X server system with Wayland/Weston window manager. On start-up Wayland and the Texas Instruments Matrix is started. Connect USB mouse and keyboard for interaction with Wayland and the Texas Instruments Matrix.

  • Use the following commands to stop the matrix:
/etc/init.d/matrix-gui-2.0 stop
  • Use the following commands to start the matrix:
/etc/init.d/matrix-gui-2.0 start
  • Use the following commands to stop the Weston:
/etc/init.d/weston stop
  • Use the following commands to start the Weston:
/etc/init.d/weston start

Wayland/Weston

Wayland is a protocol that specifies the communication between a display server (called Wayland compositor) and its clients, as well as a reference implementation of the protocol. The Wayland project includes a demo Wayland compositor, called Weston. It's fast, small, and runs on embedded and mobile devices.

Display options

CL-SOM-AM57x evaluation platform has four video output interfaces: HDMI, LCD, DVI, and LVDS. Default configuration of Yocto Linux for CL-SOM-AM57x uses HDMI (SB-SOM-AM57x J4 connector) as primary video output.

Analog Audio

CL-SOM-AM57x provides an analog audio interface, which is registered as a standard ALSA sound card. Use aplay -l to list all soundcards and digital audio devices registered on the system:

root@cl-som-am57x:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: clsomamx57xx [cl-som-amx57xx], device 0: davinci-mcasp.0-wm8731-hifi wm8731-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: H58040000encode [HDMI 58040000.encoder], device 0: HDMI 58040000.encoder snd-soc-dummy-dai-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Analog Audio Settings

To enable the Analog audio playback, alsamixer or amixer applications can be used.

  • alsamixer - set the “Output Mixer” control on.

or

  • amixer - set the “Output Mixer HiFi Playback Switch” control on using command line interface:
root@cl-som-am57x:~# amixer cset numid=14 1
numid=14,iface=MIXER,name='Output Mixer HiFi Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on

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-som-am57x:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=clsomamx57xx
    cl-som-amx57xx, 
    Default Audio Device
sysdefault:CARD=clsomamx57xx
    cl-som-amx57xx, 
    Default Audio Device
dmix:CARD=clsomamx57xx,DEV=0
    cl-som-amx57xx, 
    Direct sample mixing device
dsnoop:CARD=clsomamx57xx,DEV=0
    cl-som-amx57xx, 
    Direct sample snooping device
hw:CARD=clsomamx57xx,DEV=0
    cl-som-amx57xx, 
    Direct hardware device without any conversions
plughw:CARD=clsomamx57xx,DEV=0
    cl-som-amx57xx, 
    Hardware device with all software conversions
default:CARD=H58040000encode
    HDMI 58040000.encoder, 
    Default Audio Device
sysdefault:CARD=H58040000encode
    HDMI 58040000.encoder, 
    Default Audio Device
dmix:CARD=H58040000encode,DEV=0
    HDMI 58040000.encoder, 
    Direct sample mixing device
dsnoop:CARD=H58040000encode,DEV=0
    HDMI 58040000.encoder, 
    Direct sample snooping device
hw:CARD=H58040000encode,DEV=0
    HDMI 58040000.encoder, 
    Direct hardware device without any conversions
plughw:CARD=H58040000encode,DEV=0
    HDMI 58040000.encoder, 
    Hardware device with all software conversions

The next command can be used for audio play back:

root@cl-som-am57x:~# aplay <wav-file>

Audio Input Settings

CL-SOM-AM57x 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
Line Input => 100
Line => off
Mic => on
  • amixer
amixer cset numid=3 31
amixer cset numid=4 0
amixer cset numid=6 1
amixer cset numid=11 1
Line In
  • alsamixer
Line Input => 100
Line => on
Mic => off
  • amixer
amixer cset numid=3 31
amixer cset numid=4 1
amixer cset numid=6 0
amixer cset numid=11 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-som-am57x:~# arecord -f dat -t wav /tmp/out.wav

Bluetooth

CL-SOM-AM57x features Bluetooth 4.1 BLE interface. Following sections describe the initialization and simple use cases of Bluetooth device.

Host Controller Interface (HCI) Initialization

  • Attach the ttyO9 serial port to the HCI Bluetooth subsystem:
root@cl-som-am57x:~# echo "enabled" > /sys/bus/platform/devices/reg-userspace-consumer.0/state
root@cl-som-am57x:~# hciattach -s 115200 /dev/ttyO9 texas 3000000
Found a Texas Instruments' chip!
Firmware file : /lib/firmware/TIInit_11.8.32.bts
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
[   90.623850] Bluetooth: Core ver 2.20
[   90.627498] NET: Registered protocol family 31
[   90.632189] Bluetooth: HCI device and connection manager initialized
[   90.638581] Bluetooth: HCI socket layer initialized
[   90.643663] Bluetooth: L2CAP socket layer initialized
[   90.648764] Bluetooth: SCO socket layer initialized
[   90.656590] Bluetooth: HCI UART driver ver 2.3
[   90.661077] Bluetooth: HCI UART protocol H4 registered
[   90.666237] Bluetooth: HCI UART protocol BCSP registered
[   90.671774] Bluetooth: HCI UART protocol LL registered
[   90.676934] Bluetooth: HCI UART protocol Three-wire (H5) registered
Device setup complete
  • Run HCI device configuration utility to retrieve detailed information about the Bluetooth device:
root@cl-som-am57x:~# hciconfig -a
hci0:   Type: BR/EDR  Bus: UART
        BD Address: 54:4A:16:13:0D:42  ACL MTU: 1021:6  SCO MTU: 180:4
        UP RUNNING PSCAN 
        RX bytes:704 acl:0 sco:0 events:43 errors:0
        TX bytes:1782 acl:0 sco:0 commands:43 errors:0
        Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH HOLD SNIFF 
        Link mode: SLAVE ACCEPT 
        Name: 'cl-som-am57x-sid'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous, 
        HCI Version: 4.1 (0x7)  Revision: 0x0
        LMP Version: 4.1 (0x7)  Subversion: 0xac08
        Manufacturer: Texas Instruments Inc. (13)
  • If the HCI device is not running, use the below command to enable the HCI device:
root@cl-som-am57x:~# hciconfig hci0 up
  • HCI Inquire remote devices.
root@cl-som-am57x:~# hcitool scan
Scanning ...

WiFi

CL-SOM-AM57x features 802.11b/g/n wireless connectivity solution, implemented with the TI WiLink 8 WL1801 Wireless controller module.

WiFi Initialization

  • The driver gets loaded automatically. Make sure that the WiFi driver is loaded:
root@cl-som-am57x:~# lsmod | grep wl
wl18xx                 89863  0 
wlcore                183512  1 wl18xx
mac80211              606845  2 wl18xx,wlcore
cfg80211              491510  3 mac80211,wl18xx,wlcore
wlcore_sdio             6495  0 
  • iwconfig command from wireless-tools package can be used to retrieve detailed information about the WiFi interfaces:
root@cl-som-am57x:~# iwconfig wlan0
wlan0     IEEE 802.11abgn  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:off
  • WLAN interface activating:
root@cl-som-am57x:~# ifconfig wlan0 up
[  180.395059] wlcore: PHY firmware version: Rev 8.2.0.0.232
[  180.504299] wlcore: firmware booted (Rev 8.9.0.0.48)
  • Sample WiFi scanning:
root@cl-som-am57x:~# 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.

MMC/SD

The support for MMC/SD card on CL-SOM-AM57x is built into the Linux kernel. To mount the memory card, monitor /proc/partitions to see what partitions were detected on the MMC/SD card. For example, suppose MMC/SD partition you'd like to mount is mmcblk0p1 then:

mkdir -p /mnt/mmcblk0p1 && mount /dev/mmcblk0p1 /mnt/mmcblk0p1

USB 3.0 Dual-Role-Device

CL-SOM-AM57x has USB DWC3 (XHCI) based controller. It features SuperSpeed (SS) USB 3.0 Dual-Role-Device (DRD) subsystem with integrated SS (USB3.0) PHY and HS/FS (USB2.0) PHY. Current Linux kernel support of DWC3 features does not allow dynamic role (host/device) switching in runtime. By default, host role is assigned to CL-SOM-AM57x USB 3.0 port.

RTC

To set the date and write it into the RTC do the following:

root@cl-som-am57x:~# date -s "31 JUL 2015 10:00:00"
Fri Jul 31 10:00:00 UTC 2015
root@cl-som-am57x:~# /sbin/hwclock --systohc
root@cl-som-am57x:~# hwclock -w
Fri Jul 31 10:00:13 2015  -1.066224 seconds

To access the RTC time and date run:

root@cl-som-am57x:~# hwclock
Fri 31 Jul 2015 10:00:24 AM UTC  -0.083102 seconds

See also