Difference between revisions of "CM-FX6: Linux: Debian"
(→kernel) |
(→Display options) |
||
Line 26: | Line 26: | ||
=== images === | === images === | ||
* {{filename|uImage-cm-fx6}} - ready to run Linux kernel image binary for CM-FX6 | * {{filename|uImage-cm-fx6}} - ready to run Linux kernel image binary for CM-FX6 | ||
− | |||
* {{filename|debian-image.tar.bz2}} - archive of the Debian root file system | * {{filename|debian-image.tar.bz2}} - archive of the Debian root file system | ||
* {{filename|kernel.img}} - Kernel image required for installation onto the NAND flash or the SSD | * {{filename|kernel.img}} - Kernel image required for installation onto the NAND flash or the SSD | ||
Line 122: | Line 121: | ||
* {{cmd|alsamixer}} - set the “''Output Mixer HiFi Playback Switch''” control on with arrow buttons. | * {{cmd|alsamixer}} - set the “''Output Mixer HiFi Playback Switch''” control on with arrow buttons. | ||
or | or | ||
− | * {{cmd|amixer}} - set the “''Output Mixer HiFi Playback Switch''” control on using command line interface:<pre># amixer cset numid=14,iface=MIXER,name='Output Mixer HiFi Playback Switch' on</pre> | + | * {{cmd|amixer}} - set the “''Output Mixer HiFi Playback Switch''” control on using command line interface: |
+ | <pre> | ||
+ | # amixer cset numid=14,iface=MIXER,name='Output Mixer HiFi Playback Switch' on | ||
+ | # alsactl store wm8731audio | ||
+ | </pre> | ||
==== Analog Audio Playback ==== | ==== Analog Audio Playback ==== | ||
In order to play back a sound file make use of the {{cmd|aplay}} application. | In order to play back a sound file make use of the {{cmd|aplay}} application. | ||
<dl> | <dl> | ||
− | {{cmd|aplay -L}} can be used for listing of all pcm devices. | + | * {{cmd|aplay -L}} can be used for listing of all pcm devices. |
</dl> | </dl> | ||
Here is a sample output of {{cmd|aplay -L}} command: | Here is a sample output of {{cmd|aplay -L}} command: | ||
Line 151: | Line 154: | ||
</pre> | </pre> | ||
The above command makes use of the wm8731 audio codec and passes the audio signal to the audio out (J3 on SB-FX6). | The above command makes use of the wm8731 audio codec and passes the audio signal to the audio out (J3 on SB-FX6). | ||
+ | |||
+ | <dl> | ||
+ | * {{cmd|aplay -l}} can be used for list all soundcards and digital audio devices. | ||
+ | </dl> | ||
+ | Here is a sample output of {{cmd|aplay -l}} command: | ||
+ | <pre> | ||
+ | # aplay -l | ||
+ | **** List of PLAYBACK Hardware Devices **** | ||
+ | card 0: wm8731audio [wm8731-audio], device 0: HiFi wm8731-hifi-0 [] | ||
+ | Subdevices: 1/1 | ||
+ | Subdevice #0: subdevice #0 | ||
+ | card 1: imxspdif [imx-spdif], device 0: IMX SPDIF mxc-spdif-0 [] | ||
+ | Subdevices: 1/1 | ||
+ | Subdevice #0: subdevice #0 | ||
+ | card 2: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 [] | ||
+ | Subdevices: 1/1 | ||
+ | Subdevice #0: subdevice #0 | ||
+ | </pre> | ||
+ | |||
+ | The next command can be used for audio play back using the 'hw:card#,device#' notation: | ||
+ | <pre> | ||
+ | # aplay -D hw:0,0 <wav-file> | ||
+ | </pre> | ||
+ | |||
+ | The above command makes use of the wm8731 audio described as the hw:0,0. | ||
==== Recording Audio ==== | ==== Recording Audio ==== | ||
Line 459: | Line 487: | ||
Linux kernel implementation of the CM-FX6 display subsystem (IPU) is described in [[CM-FX6: Linux: Kernel#LCD, DVI, HDMI and LVDS support|LCD, DVI, HDMI and LVDS support]] section. | Linux kernel implementation of the CM-FX6 display subsystem (IPU) is described in [[CM-FX6: Linux: Kernel#LCD, DVI, HDMI and LVDS support|LCD, DVI, HDMI and LVDS support]] section. | ||
− | In the default Linux configuration for CM-FX6, | + | In the default Linux configuration for CM-FX6, four main framebuffers are available: {{filename|/dev/fb0}}, {{filename|/dev/fb2}}, {{filename|/dev/fb3}}, and {{filename|/dev/fb5}}. |
The default mapping is: | The default mapping is: | ||
* LCD/DVI <---> {{filename|/dev/fb0}} | * LCD/DVI <---> {{filename|/dev/fb0}} | ||
* HDMI <---> {{filename|/dev/fb2}} | * HDMI <---> {{filename|/dev/fb2}} | ||
− | * | + | * LVDS0 <---> {{filename|/dev/fb3}} |
+ | * LVDS1 <---> {{filename|/dev/fb5}} | ||
+ | {{Note|If the Evaluation kit is supplied with '''Startek KD050C LCD''' and the LCD output evaluation is needed, please download additional package as described in the [[CM-FX6: Linux: Known Issues]] article.}} | ||
+ | |||
+ | === Starting X Server === | ||
+ | X server has an option to use FRAMEBUFFER environment variable in order to redefine the default frame buffer device. | ||
+ | This variable can be used in order to make the X Server use a specified frame buffer. | ||
+ | Bellow are examples of starting X Server using different frame buffers | ||
+ | * fb2 -> HDMI | ||
+ | <pre> | ||
+ | FRAMEBUFFER=/dev/fb2 startx | ||
+ | </pre> | ||
+ | * fb3 -> LVDS0 | ||
+ | <pre> | ||
+ | FRAMEBUFFER=/dev/fb3 startx | ||
+ | </pre> | ||
+ | * fb5 -> LVDS1 | ||
+ | <pre> | ||
+ | FRAMEBUFFER=/dev/fb5 startx | ||
+ | </pre> | ||
+ | |||
+ | === Setting Desired Frame Buffer Parameters === | ||
+ | ==== Changing Frame Buffer Settings via Kernel Video Parameter ==== | ||
+ | In order to set a desired frame buffer resolution, the following kernel command line parameters can be used: | ||
+ | * For DVI on {{filename|/dev/fb0}}:<pre>video=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32</pre> | ||
+ | * For HDMI on {{filename|/dev/fb2}}:<pre>video=mxcfb2:dev=hdmi,1920x1080M-32@50,if=RGB32</pre> | ||
+ | * For LVDS0 on {{filename|/dev/fb3}}:<pre>video=mxcfb3:dev=ldb,1366x768M-18@60,if=RGB666</pre> | ||
+ | * For LVDS1 on {{filename|/dev/fb5}}:<pre>video=mxcfb5:dev=ldb,1366x768M-18@60,if=RGB666</pre> | ||
+ | |||
+ | ==== Changing Frame Buffer Settings via SYSFS ==== | ||
+ | Here is another approach of changing the frame buffer resolution. Each frame buffer has an entry on sysfs: | ||
+ | <pre> | ||
+ | # ls -al /sys/class/graphics/fb[0-5] | ||
+ | lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb0 -> ../../devices/platform/mxc_sdc_fb.0/graphics/fb0 | ||
+ | lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb1 -> ../../devices/platform/mxc_sdc_fb.0/graphics/fb1 | ||
+ | lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb2 -> ../../devices/platform/mxc_sdc_fb.1/graphics/fb2 | ||
+ | lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb3 -> ../../devices/platform/mxc_sdc_fb.2/graphics/fb3 | ||
+ | lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb4 -> ../../devices/platform/mxc_sdc_fb.2/graphics/fb4 | ||
+ | lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb5 -> ../../devices/platform/mxc_sdc_fb.3/graphics/fb5 | ||
+ | </pre> | ||
+ | |||
+ | * 2-nd frame buffer resolution: | ||
+ | <pre> | ||
+ | # cat /sys/class/graphics/fb2/mode | ||
+ | U:1280x720p-50 | ||
+ | </pre> | ||
+ | |||
+ | * 2-nd frame buffer supported modes: | ||
+ | <pre> | ||
+ | # cat /sys/class/graphics/fb2/modes | ||
+ | U:1280x720p-50 | ||
+ | S:1280x720p-50 | ||
+ | S:720x576p-50 | ||
+ | S:1920x1080p-50 | ||
+ | S:640x480p-60 | ||
+ | S:720x480p-60 | ||
+ | S:720x480p-60 | ||
+ | S:1280x720p-60 | ||
+ | S:1920x1080p-60 | ||
+ | U:1920x1080p-60 | ||
+ | S:1280x1024p-60 | ||
+ | S:1152x864p-75 | ||
+ | V:1280x1024p-75 | ||
+ | V:1024x768p-75 | ||
+ | V:1024x768p-60 | ||
+ | V:800x600p-75 | ||
+ | V:800x600p-60 | ||
+ | V:640x480p-75 | ||
+ | V:640x480p-60 | ||
+ | U:720x400p-70 | ||
+ | D:1920x1080p-60 | ||
+ | V:640x480p-60 | ||
+ | </pre> | ||
+ | |||
+ | * To change mode of the 2-nd frame buffer to "D:1920x1080p-60" | ||
+ | <pre> | ||
+ | echo "D:1920x1080p-60" > /sys/class/graphics/fb2/mode | ||
+ | </pre> | ||
+ | |||
+ | === DVI/HDMI/LVDS Data Output Format === | ||
− | In order to change the mapping, the following kernel command line parameters can be provided: | + | In order to change the default frame buffer mapping, the following kernel command line parameters can be provided: |
− | * For DVI on {{filename|/dev/fb0}}:<pre>video=mxcfb0:dev=dvi,1280x800M- | + | * For DVI on {{filename|/dev/fb0}}:<pre>video=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32</pre> |
− | * For HDMI on {{filename|/dev/fb0}}:<pre>video=mxcfb0:dev=hdmi,1920x1080M- | + | * For HDMI on {{filename|/dev/fb0}}:<pre>video=mxcfb0:dev=hdmi,1920x1080M-32@50,if=RGB32</pre> |
* For LVDS on {{filename|/dev/fb0}}:<pre>video=mxcfb0:dev=ldb,1366x768M-18@60,if=RGB666</pre> | * For LVDS on {{filename|/dev/fb0}}:<pre>video=mxcfb0:dev=ldb,1366x768M-18@60,if=RGB666</pre> | ||
Revision as of 07:51, 21 February 2014
Contents
- 1 Overview
- 2 Package contents
- 3 Using Debian Linux on CM-FX6
- 3.1 Connection and Logging In
- 3.2 Networking
- 3.3 Consoles
- 3.4 X Windows system
- 3.5 Software Management
- 3.6 HDMI Audio
- 3.7 Analog Audio
- 3.8 USB On-The-Go (OTG)
- 3.9 WiFi
- 3.10 Bluetooth
- 3.11 Touchscreen
- 3.12 MMC/SD
- 3.13 Display options
- 3.14 Starting X Server
- 3.15 Setting Desired Frame Buffer Parameters
- 3.16 DVI/HDMI/LVDS Data Output Format
- 3.17 GPIO access
- 4 See also
Overview
The example run-time Linux filesystem image for CM-FX6 is based on Debian GNU/Linux Sid. The CompuLab Linux package for CM-FX6 includes ready to run NAND flash image, Linux kernel configuration and source code patches, and an archive of the root filesystem, used to create the image.
The default Debian Sid Linux image includes more than 400 software packages. Among them:
- Core system
- Debian package management system
- X11 Windowing System
- Enlightenment desktop manager
- Netsurf web browser
- Samba connectivity suite
- SSH and FTP server and client
- ALSA configuration and usage utilities
- CAN Bus utilities
- Bluetooth tools and daemons
The Getting started with Linux on CM-FX6 page provides a brief introduction on how to install the run-time Linux image. This article describes package structure and peripheral device options specific to the CM-FX6.
Package contents
version.txt
The contents of the version.txt identifies the package version.
images
- uImage-cm-fx6 - ready to run Linux kernel image binary for CM-FX6
- debian-image.tar.bz2 - archive of the Debian root file system
- kernel.img - Kernel image required for installation onto the NAND flash or the SSD
- ramdisk.img - Ramdisk image required for installation onto the NAND flash or the SSD
- bootscr.img - U-Boot script used for image installation
kernel
- uImage-3.0.35-cm-fx6-3.bin - ready to run Linux kernel version 3.0.35-cm-fx6-3 for CM-FX6
- linux-3.0.35-cm-fx6-3.config - Linux kernel 3.0.35-cm-fx6-3 configuration file
- linux-3.0.35-cm-fx6-3.patch - patch vs. Linux stable kernel 3.0.35 with support for CM-FX6 peripherals
- patches - ordered collection of patches, that form the single patch above (linux-3.0.35-cm-fx6-3.patch)
- modules_3.0.35-cm-fx6-3.tar.gz - a modules tarball, that matches the ready to run Linux kernel (uImage-3.0.35-cm-fx6-3.bin)
utilities
The utilities directory contains miscellaneous utilities useful for development
- tftpd32.zip - TFTP server for Windows users
- eeprom-util - CompuLab EEPROM utility for reading information found inside the EEPROM on CompuLab boards
- bootscr.src - U-Boot script source used for loading kernel and ramdisk images from MMC/SD card
- debian-image.cfg - configuration file used by ubinize utility for debian-image.ubi generation. For more information about UBIFS images please refer to the Linux Development for ARM modules article.
Using Debian Linux on CM-FX6
Connection and Logging In
Use the following usernames and passwords to login:
Account with administrative privileges:
User: root Password: 111111
Regular user account:
User: user Password: 111111
In addition to these accounts CM-FX6 allows anonymous FTP access. To login into the Linux system, you may use a serial console (ttymxc3) at 115200 bps, or connect through the network, or use a keyboard and DVI/LCD/HDMI display (tty1, tty2, tty3, tty4).
Networking
To configure networking, edit /etc/network/interfaces, /etc/udev/rules.d/70-persistent-net.rules, /etc/resolv.conf, /etc/hostname and /etc/hosts. For more information about Debian Linux network configuration read Network setup chapter in the Debian Reference.
Consoles
The Linux file system image is designed to suit different kernel versions and configurations. Therefore, during the operating system startup, consoles at several serial ports and DVI/LCD display are enabled. Some of these devices may not be supported, either because of kernel versions incompatibilities, or because the kernel was not configured to support these devices. When the console is enabled for such a device, the following or similar message can appear on active console:
INIT: Id "T0" respawning too fast: disabled for 5 minutes
This is not an error message, it is just a warning that can be eliminated by editing /etc/inittab file.
X Windows system
The CompuLab distribution contains full featured X Windows system with Enlightenment 17 window manager. Before starting X Windows, connect USB mouse and keyboard to the system. You can run X Windows by typing startx.
Enlightenment 17 window manager has a built in configuration set up to work best with phones, tablets and similar devices. To activate the "touchscreen" profile, enter Main->Settings Panel->Settings->Profiles. Select the Touchscreen profile.
To switch back to the standard profile, please see the Known Issues article.
Software Management
The Debian Linux image for CM-FX6 includes all the information required to use Debian package management utilities. You can use apt-get and dpkg out of the box.
HDMI Audio
CM-FX6 provides a digital HDMI audio interface, which is registered as a standard ALSA sound card. If the default CM-FX6 configuration is used, the audio drivers are loaded automatically in the boot process.
The HDMI audio will work only if the HDMI cable is plugged in. |
More information about Linux audio subsystem can be found at ALSA project official website.
Analog Audio
CM-FX6 provides an analog audio interface, which is registered as a standard ALSA sound card. If the default CM-FX6 configuration is used, the audio drivers are loaded automatically in the boot process.
-
aplay -l shows list of all soundcards and digital audio devices registered on the system. Here is an aplay -l sample output.
**** List of PLAYBACK Hardware Devices **** card 0: wm8731audio [wm8731-audio], device 0: HiFi wm8731-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0
The 'card 0' is an analog audio device.
Analog Audio Settings
To enable the Analog audio playback, alsamixer or amixer applications can be used.
- alsamixer - set the “Output Mixer HiFi Playback Switch” control on with arrow buttons.
or
- amixer - set the “Output Mixer HiFi Playback Switch” control on using command line interface:
# amixer cset numid=14,iface=MIXER,name='Output Mixer HiFi Playback Switch' on # alsactl store wm8731audio
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:
# aplay -L default:CARD=wm8731audio wm8731-audio, Default Audio Device sysdefault:CARD=wm8731audio wm8731-audio, Default Audio Device default:CARD=imxhdmisoc imx-hdmi-soc, Default Audio Device sysdefault:CARD=imxhdmisoc imx-hdmi-soc, Default Audio Device
The next command can be used for audio play back:
# aplay -D sysdefault:CARD=wm8731audio <wav-file>
The above command makes use of the wm8731 audio codec and passes the audio signal to the audio out (J3 on SB-FX6).
- aplay -l can be used for list all soundcards and digital audio devices.
Here is a sample output of aplay -l command:
# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: wm8731audio [wm8731-audio], device 0: HiFi wm8731-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: imxspdif [imx-spdif], device 0: IMX SPDIF mxc-spdif-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0
The next command can be used for audio play back using the 'hw:card#,device#' notation:
# aplay -D hw:0,0 <wav-file>
The above command makes use of the wm8731 audio described as the hw:0,0.
Recording Audio
CM-FX6 provides recording audio signal from ether “Line In” or “Mic In” sources.
-
Make use of arecord application for capturing audio signal. arecord -L shows all devices that can be used for audio capturing.
The below list of devices is shown on a CM-FX6 module:
# arecord -L default:CARD=wm8731audio wm8731-audio, Default Audio Device sysdefault:CARD=wm8731audio wm8731-audio, Default Audio Device
Audio Input Settings
CM-FX6 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
- Input Mux => Mic
- Mic Boost Volume => 1
- amixer
# amixer cset numid=11,iface=MIXER,name='Input Mux' 1 # amixer cset numid=5,iface=MIXER,name='Mic Boost Volume' 1
Line In
- alsamixer
- Input Mux => Line In
- amixer
# amixer cset numid=11,iface=MIXER,name='Input Mux' 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.
# arecord < -D sysdefault:CARD=wm8731audio > -t wav /tmp/out.wav
The below sample commands record audio signal from the selected 'Input Mux' device.
- Mic Example
# amixer cset numid=11,iface=MIXER,name='Input Mux' 1 # amixer cset numid=5,iface=MIXER,name='Mic Boost Volume' 1 # arecord -t wav /tmp/out.wav
- Line In Example
# amixer cset numid=11,iface=MIXER,name='Input Mux' 0 # arecord -t wav /tmp/out.wav
USB On-The-Go (OTG)
CM-FX6 features a high-speed USB 2.0 OTG controller. CM-FX6 OTG port is USB host and USB device (gadget) capable.
In CM-FX6 default kernel configuration, the USB host driver is compiled into the kernel, whereas USB gadget drivers are compiled as modules.
Gadget drivers should be loaded for OTG support.
- Load a Gadget Driver
# modprobe g_audio g_audio gadget: controller 'fsl-usb2-udc' not recognized; trying Linux USB Audio Gadget g_audio gadget: Hardware params: access 3, format 2, channels 2, rate 48000 g_audio gadget: audio_buf_size 48000, req_buf_size 200, req_count 256 g_audio gadget: Linux USB Audio Gadget, version: Dec 18, 2008 g_audio gadget: g_audio ready Suspend udc for OTG auto detect USB Gadget resume begins fsl_udc_resume, Wait for wakeup thread finishes dr_controller_run: udc out low power mode USB Gadget resume ends fsl-usb2-udc: bind to driver g_audio
Default CM-FX6 kernel configuration enables g_serial, g_file_storage, g_ether and g_audio gadget drivers. More gadget drivers can be enabled in the kernel configuration.
Testing OTG port
Host mode
Connect USB keyboard to OTG port.
usb 1-1: new low speed USB device number 3 using fsl-ehci usb 1-1: device v413c p2107 is not supported input: DELL Dell USB Entry Keyboard as /devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0/input/input5 generic-usb 0003:413C:2107.0003: input,hidraw1: USB HID v1.10 Keyboard [DELL Dell USB Entry Keyboard] on usb-fsl-ehci.0-1/input0
Gadget mode
Load g_audio gadget driver.
# modprobe g_audio g_audio gadget: controller 'fsl-usb2-udc' not recognized; trying Linux USB Audio Gadget g_audio gadget: Hardware params: access 3, format 2, channels 2, rate 48000 g_audio gadget: audio_buf_size 48000, req_buf_size 200, req_count 256 g_audio gadget: Linux USB Audio Gadget, version: Dec 18, 2008 g_audio gadget: g_audio ready
Connect desktop PC to OTG port.
g_audio gadget: high speed config #1: Linux USB Audio Gadget
In case the desktop PC is running Linux, this gadget will show up in the aplay -L list:
hw:CARD=Gadget,DEV=0 Linux USB Audio Gadget, USB Audio Direct hardware device without any conversions plughw:CARD=Gadget,DEV=0 Linux USB Audio Gadget, USB Audio Hardware device with all software conversions
WiFi
CM-FX6 features 802.11b/g/n wireless connectivity solution, implemented with the AzureWave AW-NH387 Wireless controller module.
WiFi Initialization
- WiFi requires no user interaction for being configured. The driver gets loaded automatically.
Make sure that the WiFi driver is loaded:
# lsmod | grep mwifiex mwifiex_sdio 12214 0 mwifiex 113596 1 mwifiex_sdio
The WiFi driver can be loaded manually:
# modprobe mwifiex_sdio mwifiex_sdio mmc1:0001:1: WLAN FW already running! Skip FW download mwifiex_sdio mmc1:0001:1: WLAN FW is active mwifiex_sdio mmc1:0001:1: info: successfully registered wiphy device mwifiex_sdio mmc1:0001:1: info: mlan0: Marvell 802.11 Adapter mwifiex_sdio mmc1:0001:1: driver_version = mwifiex 1.0 (14.57.5.p44)
- wireless-tools can be used to retrieve detailed information about the WiFi interfaces:
# iwconfig mlan0 mlan0 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Retry long limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on
- Sample WiFi scanning:
# iwlist mlan0 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 tunning WiFi interfaces refer to “wpa_supplicant” and “wireless-tools” man pages.
Bluetooth
CM-FX6 features Bluetooth 3.0 + High Speed (HS) interface. Following sections describe the initialization and simple use cases of the Bluetooth interface.
Host Controller Interface (HCI) Initialization
- HCI requires no user interaction for being configured. The driver gets loaded automatically unless this option has been disabled by putting a black list rule for this device.
Make sure that the Bluetooth driver is loaded:
# lsmod | grep btmrvl btmrvl_sdio 9024 0 btmrvl 10572 3 btmrvl_sdio
The Bluetooth driver can be loaded manually:
# modprobe btmrvl_sdio Bluetooth: vendor=0x2df, device=0x911a, class=255, fn=2
- HCI device configuration utility can be run to retrieve detailed information about the Bluetooth interfaces:
# hciconfig -a hci0: Type: BR/EDR Bus: SDIO BD Address: 4C:AA:16:66:C4:E0 ACL MTU: 1021:7 SCO MTU: 120:6 UP RUNNING PSCAN RX bytes:1136 acl:0 sco:0 events:40 errors:0 TX bytes:1546 acl:0 sco:0 commands:39 errors:0 Features: 0xff 0xee 0x8f 0xfe 0x9b 0xff 0x79 0x87 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV3 Link policy: RSWITCH HOLD SNIFF Link mode: SLAVE ACCEPT Name: 'cm-debian-0' Class: 0x4a0100 Service Classes: Networking, Capturing, Telephony Device Class: Computer, Uncategorized HCI Version: 2.1 (0x4) Revision: 0x8300 LMP Version: 2.1 (0x5) Subversion: 0x810 Manufacturer: Marvell Technology Group Ltd. (72)
- If the HCI device is not running, use the below command to enable the HCI device:
# hciconfig hci0 up
A2DP Headphones
- Scan for available devices to find out Headphones BT device address:
# hcitool scan Scanning ... 00:07:A4:F2:B3:CB Motorola HT820
- Add new PCM device by editing /etc/asound.conf:
pcm.btheadphones { type plug slave { pcm { type bluetooth device 00:07:A4:F2:B3:CB profile "auto" } } hint { show on description "BT Headphones" } } ctl.btheadphones { type bluetooth }
- List device names to ensure correct settings in /etc/asound.conf:
# aplay -L null Discard all samples (playback) or generate zero samples (capture) btheadphones BT Headphones default:CARD=wm8731audio wm8731-audio, Default Audio Device sysdefault:CARD=wm8731audio wm8731-audio, Default Audio Device default:CARD=imxhdmisoc imx-hdmi-soc, Default Audio Device sysdefault:CARD=imxhdmisoc imx-hdmi-soc, Default Audio Device
- Put the headphones in the pairing mode.
- Launch bluez-simple-agent application and provide device PIN code on request:
# bluez-simple-agent hci0 00:07:A4:F2:B3:CB RequestPinCode (/org/bluez/1335/hci0/dev_00_07_A4_F2_B3_CB) Enter PIN Code: 0000 Release New device (/org/bluez/1335/hci0/dev_00_07_A4_F2_B3_CB)
- Launch aplay playback tool:
# aplay -D btheadphones sample_audio.wav Playing WAVE 'sample_audio.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo
Touchscreen
The CM-FX6 Evaluation Kit is equipped with DataImage SCF0403852GGU04 LCD touch panel. See LCD, DVI and HDMI support and Touchscreen support sections for kernel configuration details to enable support for the particular touchscreen. The touchscreen driver is modularized if you use default CM-FX6 configuration and is loaded by udev automatically on Linux boot. If the touchscreen driver is not loaded, the following command will load the touchscreen driver:
- For TI TSC2046 touch panel:
modprobe ads7846
- For DataImage SCF0403852GGU04 LCD touch panel (Himax HX8520-C):
modprobe hx8520-c
The X Windows system of CM-FX6 uses tslib X server input driver to get the input from the touchscreen.
Touchscreen calibration
Both supported touchscreen devices can be accessed through symbolic link /dev/input/touchscreen.
The symlink is created by udev rules defined in /etc/udev/rules.d/10-touchscreen.rules.
Calibration utilities require proper setting of the TSLIB_TSDEVICE system variable (pointing to the touchscreen device special file).
This is done automatically by the /etc/profile.d/tslib.sh script.
Touchscreen calibration is performed with the ts_calibrate utility available in package libts-bin. To calibrate the touchscreen:
- Make sure X Server is not running
- Make sure the touchscreen driver is loaded as described in Touchscreen section
- Run the ts_calibrate utility. For proper calibration you are required to touch the touchscreen corners and center in the following order: top-left, top-right, bottom-right, bottom-left, center. The calibration results are saved to file /etc/pointercal.
- Use the ts_test utility to test the calibration results.
MMC/SD
The support for MMC/SD card on CM-FX6 is built into the Linux kernel. To mount a memory card, monitor /proc/partitions to see what partitions were detected on the MMC/SD card. For example, suppose an MMC/SD partition you'd like to mount is mmcblk0p1 then:
if [ ! -d /mnt/mmcblk0p1 ]; then mkdir /mnt/mmcblk0p1; fi mount /dev/mmcblk0p1 /mnt/mmcblk0p1
Display options
CM-FX6 evaluation platform can be used with either of four display interfaces: LCD or DVI, HDMI and LVDS.
Default configuration of Linux kernel and Debian Linux for CM-FX6 uses LCD as primary video output interface.
It is possible to use either the DVI or the LCD interface at the same time. HDMI can be used simultaneously with LVDS and either LCD or DVI interfaces.
Linux kernel implementation of the CM-FX6 display subsystem (IPU) is described in LCD, DVI, HDMI and LVDS support section.
In the default Linux configuration for CM-FX6, four main framebuffers are available: /dev/fb0, /dev/fb2, /dev/fb3, and /dev/fb5. The default mapping is:
- LCD/DVI <---> /dev/fb0
- HDMI <---> /dev/fb2
- LVDS0 <---> /dev/fb3
- LVDS1 <---> /dev/fb5
If the Evaluation kit is supplied with Startek KD050C LCD and the LCD output evaluation is needed, please download additional package as described in the CM-FX6: Linux: Known Issues article. |
Starting X Server
X server has an option to use FRAMEBUFFER environment variable in order to redefine the default frame buffer device. This variable can be used in order to make the X Server use a specified frame buffer. Bellow are examples of starting X Server using different frame buffers
- fb2 -> HDMI
FRAMEBUFFER=/dev/fb2 startx
- fb3 -> LVDS0
FRAMEBUFFER=/dev/fb3 startx
- fb5 -> LVDS1
FRAMEBUFFER=/dev/fb5 startx
Setting Desired Frame Buffer Parameters
Changing Frame Buffer Settings via Kernel Video Parameter
In order to set a desired frame buffer resolution, the following kernel command line parameters can be used:
- For DVI on /dev/fb0:
video=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32
- For HDMI on /dev/fb2:
video=mxcfb2:dev=hdmi,1920x1080M-32@50,if=RGB32
- For LVDS0 on /dev/fb3:
video=mxcfb3:dev=ldb,1366x768M-18@60,if=RGB666
- For LVDS1 on /dev/fb5:
video=mxcfb5:dev=ldb,1366x768M-18@60,if=RGB666
Changing Frame Buffer Settings via SYSFS
Here is another approach of changing the frame buffer resolution. Each frame buffer has an entry on sysfs:
# ls -al /sys/class/graphics/fb[0-5] lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb0 -> ../../devices/platform/mxc_sdc_fb.0/graphics/fb0 lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb1 -> ../../devices/platform/mxc_sdc_fb.0/graphics/fb1 lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb2 -> ../../devices/platform/mxc_sdc_fb.1/graphics/fb2 lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb3 -> ../../devices/platform/mxc_sdc_fb.2/graphics/fb3 lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb4 -> ../../devices/platform/mxc_sdc_fb.2/graphics/fb4 lrwxrwxrwx 1 root root 0 Jan 4 19:46 /sys/class/graphics/fb5 -> ../../devices/platform/mxc_sdc_fb.3/graphics/fb5
- 2-nd frame buffer resolution:
# cat /sys/class/graphics/fb2/mode U:1280x720p-50
- 2-nd frame buffer supported modes:
# cat /sys/class/graphics/fb2/modes U:1280x720p-50 S:1280x720p-50 S:720x576p-50 S:1920x1080p-50 S:640x480p-60 S:720x480p-60 S:720x480p-60 S:1280x720p-60 S:1920x1080p-60 U:1920x1080p-60 S:1280x1024p-60 S:1152x864p-75 V:1280x1024p-75 V:1024x768p-75 V:1024x768p-60 V:800x600p-75 V:800x600p-60 V:640x480p-75 V:640x480p-60 U:720x400p-70 D:1920x1080p-60 V:640x480p-60
- To change mode of the 2-nd frame buffer to "D:1920x1080p-60"
echo "D:1920x1080p-60" > /sys/class/graphics/fb2/mode
DVI/HDMI/LVDS Data Output Format
In order to change the default frame buffer mapping, the following kernel command line parameters can be provided:
- For DVI on /dev/fb0:
video=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32
- For HDMI on /dev/fb0:
video=mxcfb0:dev=hdmi,1920x1080M-32@50,if=RGB32
- For LVDS on /dev/fb0:
video=mxcfb0:dev=ldb,1366x768M-18@60,if=RGB666
GPIO access
Linux provides simple and convenient GPIO access via sysfs interface. A GPIO should be exported using /sys/class/gpio/export. After the GPIO is exported it is possible to change its direction and value using /sys/class/gpio/gpioX/direction and /sys/class/gpio/gpioX/value attributes.
Example
The following example demonstrates how to configure GPIO 140 as output and set value to high:
echo 140 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio140/direction echo 1 > /sys/class/gpio/gpio140/value
The above example assumes that the corresponding pin is set to mux mode 5 and the GPIO 140 is not requested in the Linux kernel. |