Difference between revisions of "CM-FX6: Linux: Debian"
(→Overview) |
(→WiFi Initialization) |
||
Line 9: | Line 9: | ||
* X11 Windowing System | * X11 Windowing System | ||
* Enlightenment desktop manager | * Enlightenment desktop manager | ||
− | + | * SSH server and client | |
− | |||
− | * SSH | ||
* ALSA configuration and usage utilities | * ALSA configuration and usage utilities | ||
* CAN Bus utilities | * CAN Bus utilities | ||
Line 26: | Line 24: | ||
=== 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 | + | * {{filename|debian-image.tar.bz2}} - archive of the Debian root file system with: |
− | |||
** FreeScale GPU support libraries | ** FreeScale GPU support libraries | ||
− | ** | + | ** Enlightment window manager |
+ | * {{filename|debian-image-bt-support.tar.bz2}} - archive of the Debian root file system with Bluez 4.x compatible with CM-FX6 Linux kernel | ||
* {{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 | ||
* {{filename|ramdisk.img}} - Ramdisk image required for installation onto the NAND flash or the SSD | * {{filename|ramdisk.img}} - Ramdisk image required for installation onto the NAND flash or the SSD | ||
Line 35: | Line 33: | ||
=== kernel === | === kernel === | ||
− | * {{filename|uImage-3.0.35-cm-fx6-6.bin}} - ready to run Linux kernel version 3.0.35-cm-fx6-6 for CM-FX6 | + | * {{filename|uImage-3.0.35-cm-fx6-6.2.bin}} - ready to run Linux kernel version 3.0.35-cm-fx6-6.2 for CM-FX6 |
− | * {{filename|linux-3.0.35-cm-fx6-6.config}} - Linux kernel 3.0.35-cm-fx6-6 configuration file | + | * {{filename|linux-3.0.35-cm-fx6-6.2.config}} - Linux kernel 3.0.35-cm-fx6-6.2 configuration file |
− | * {{filename|linux-3.0.35-cm-fx6-6.patch}} - patch vs. [http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=839cf7a236278ae358ff12141a168c0982fa0cd9 Linux stable kernel 3.0.35] with support for CM-FX6 peripherals | + | * {{filename|linux-3.0.35-cm-fx6-6.2.patch}} - patch vs. [http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=839cf7a236278ae358ff12141a168c0982fa0cd9 Linux stable kernel 3.0.35] with support for CM-FX6 peripherals |
− | * {{filename|patches}} - ordered collection of patches, that form the single patch above ({{filename|linux-3.0.35-cm-fx6-6.patch}}) | + | * {{filename|patches}} - ordered collection of patches, that form the single patch above ({{filename|linux-3.0.35-cm-fx6-6.2.patch}}) |
− | * {{filename|modules_3.0.35-cm-fx6-6.tar.gz}} - a modules tarball, that matches the ready to run Linux kernel ({{filename|uImage-3.0.35-cm-fx6-6.bin}}) | + | * {{filename|modules_3.0.35-cm-fx6-6.2.tar.gz}} - a modules tarball, that matches the ready to run Linux kernel ({{filename|uImage-3.0.35-cm-fx6-6.2.bin}}) |
=== utilities === | === utilities === | ||
Line 51: | Line 49: | ||
* deb_packages - FreeScale *.deb packages used in CM-FX6 Debian root filesystem | * deb_packages - FreeScale *.deb packages used in CM-FX6 Debian root filesystem | ||
** imx-test_3.0.35-4.0.0_armel.deb - platform specific unit tests for mxc platform | ** imx-test_3.0.35-4.0.0_armel.deb - platform specific unit tests for mxc platform | ||
+ | ** can-utils_0.0.2+gitba9b189-1_armel.deb - CAN Bus utilities | ||
+ | |||
* FreeScale GPU | * FreeScale GPU | ||
** 00-Support | ** 00-Support | ||
+ | *** firmware-imx_3.0.35-4.0.0_armel.deb - Firmware for imx platform | ||
*** gpu-viv-bin-mx6q_3.0.35-4.0.0_armel.deb - GPU driver and application for mx6q | *** gpu-viv-bin-mx6q_3.0.35-4.0.0_armel.deb - GPU driver and application for mx6q | ||
*** imx-lib_3.0.35-4.0.0_armel.deb - platform specific libraries for imx platform | *** imx-lib_3.0.35-4.0.0_armel.deb - platform specific libraries for imx platform | ||
Line 63: | Line 64: | ||
=== Connection and Logging In === | === Connection and Logging In === | ||
− | Use the following | + | Use the following username and password to login: |
Account with administrative privileges: | Account with administrative privileges: | ||
<pre> | <pre> | ||
User: root | User: root | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Password: 111111 | Password: 111111 | ||
</pre> | </pre> | ||
Line 79: | Line 74: | ||
In addition to these accounts CM-FX6 allows anonymous FTP access. | 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). | 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 === | === Networking === | ||
Line 336: | Line 330: | ||
Encryption key:off | Encryption key:off | ||
Power Management:on | Power Management:on | ||
+ | </pre> | ||
+ | * Activate the interface: | ||
+ | <pre> | ||
+ | # ifconfig mlan0 up | ||
</pre> | </pre> | ||
* Sample WiFi scanning: | * Sample WiFi scanning: | ||
Line 441: | Line 439: | ||
* Put the headphones in the pairing mode. | * Put the headphones in the pairing mode. | ||
+ | |||
+ | {{ Warning| Debian Sid example root file system has Bluez 5.x support which is compatible with Linux kernel v3.4 and higher. | ||
+ | In order to apply the commands below, please use {{filename|debian-image-bt-support.tar.bz2}} rootfs image with Bluez 4.x support.}} | ||
+ | |||
* Launch {{cmd|bluez-simple-agent}} application and provide device PIN code on request: | * Launch {{cmd|bluez-simple-agent}} application and provide device PIN code on request: | ||
<pre> | <pre> | ||
Line 476: | Line 478: | ||
Both supported touchscreen devices can be accessed through symbolic link {{filename|/dev/input/touchscreen}}. | Both supported touchscreen devices can be accessed through symbolic link {{filename|/dev/input/touchscreen}}. | ||
The symlink is created by {{filename|udev}} rules defined in {{filename|/etc/udev/rules.d/10-touchscreen.rules}}.<br> | The symlink is created by {{filename|udev}} rules defined in {{filename|/etc/udev/rules.d/10-touchscreen.rules}}.<br> | ||
− | |||
− | |||
− | Touchscreen calibration is performed with the {{cmd| | + | Touchscreen calibration is performed with the {{cmd|xinput_calibrator}} utility available in package {{filename|xinput_calibrator}}. |
To calibrate the touchscreen: | To calibrate the touchscreen: | ||
− | * Make sure X Server is | + | * Make sure X Server is running |
* Make sure the touchscreen driver is loaded as described in [[#Touchscreen|Touchscreen]] section | * Make sure the touchscreen driver is loaded as described in [[#Touchscreen|Touchscreen]] section | ||
− | * Run the {{cmd| | + | * Run the {{cmd|xinput_calibrator}} utility. |
− | + | <pre> | |
+ | DISPLAY=:0 xinput_calibrator | ||
+ | </pre> | ||
+ | * Use a stylus to tap the four registration point indicated in red on screen by the program. | ||
+ | * Follow the instruction at the end of the procedure in order make the calibration permanent. | ||
+ | <pre> | ||
+ | Setting calibration data: 0, 4095, 0, 4095 | ||
+ | Calibrating EVDEV driver for "ADS7846 Touchscreen" id=8 | ||
+ | current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095 | ||
+ | |||
+ | Doing dynamic recalibration: | ||
+ | Setting calibration data: 14, 4099, 21, 4087 | ||
+ | --> Making the calibration permanent <-- | ||
+ | copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's) | ||
+ | Section "InputClass" | ||
+ | Identifier "calibration" | ||
+ | MatchProduct "ADS7846 Touchscreen" | ||
+ | Option "Calibration" "14 4099 21 4087" | ||
+ | Option "SwapAxes" "0" | ||
+ | EndSection | ||
+ | </pre> | ||
=== MMC/SD === | === MMC/SD === | ||
Line 507: | Line 527: | ||
* LVDS0 <---> {{filename|/dev/fb3}} | * LVDS0 <---> {{filename|/dev/fb3}} | ||
* LVDS1 <---> {{filename|/dev/fb5}} | * LVDS1 <---> {{filename|/dev/fb5}} | ||
− | |||
=== Starting X Server === | === Starting X Server === | ||
Line 604: | Line 623: | ||
{{Note|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.}} | {{Note|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.}} | ||
− | == Debian | + | == Debian Sid Linux == |
The purpose of this image is to provide the environment in order to show the FreeScale GPU and camera features. | The purpose of this image is to provide the environment in order to show the FreeScale GPU and camera features. | ||
Line 671: | Line 690: | ||
==== mplayer ==== | ==== mplayer ==== | ||
− | ===== Streaming the camera output | + | |
+ | MPlayer application is not a part of the example root file system image. In order to install it run the following command: | ||
+ | |||
+ | <pre> | ||
+ | apt-get install mplayer | ||
+ | </pre> | ||
+ | |||
+ | ===== Streaming the camera output ===== | ||
<pre> | <pre> | ||
− | # mplayer tv:// -tv driver=v4l2:device=/dev/video0:outfmt=uyvy:width=720:height=524 | + | # mplayer tv:// -tv driver=v4l2:device=/dev/video0:outfmt=uyvy:width=720:height=524 |
− | |||
</pre> | </pre> | ||
Revision as of 14:07, 6 November 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 Debian Sid Linux
- 5 See also
Overview
The example run-time Linux filesystem image for the CompuLab CM-FX6 System-on-Module / Computer-on-Module 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
- SSH 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 with:
- FreeScale GPU support libraries
- Enlightment window manager
- debian-image-bt-support.tar.bz2 - archive of the Debian root file system with Bluez 4.x compatible with CM-FX6 Linux kernel
- 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-6.2.bin - ready to run Linux kernel version 3.0.35-cm-fx6-6.2 for CM-FX6
- linux-3.0.35-cm-fx6-6.2.config - Linux kernel 3.0.35-cm-fx6-6.2 configuration file
- linux-3.0.35-cm-fx6-6.2.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-6.2.patch)
- modules_3.0.35-cm-fx6-6.2.tar.gz - a modules tarball, that matches the ready to run Linux kernel (uImage-3.0.35-cm-fx6-6.2.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.
extra
- deb_packages - FreeScale *.deb packages used in CM-FX6 Debian root filesystem
- imx-test_3.0.35-4.0.0_armel.deb - platform specific unit tests for mxc platform
- can-utils_0.0.2+gitba9b189-1_armel.deb - CAN Bus utilities
- FreeScale GPU
- 00-Support
- firmware-imx_3.0.35-4.0.0_armel.deb - Firmware for imx platform
- gpu-viv-bin-mx6q_3.0.35-4.0.0_armel.deb - GPU driver and application for mx6q
- imx-lib_3.0.35-4.0.0_armel.deb - platform specific libraries for imx platform
- udev-fsl-rules_4.0.0-5_armel.deb - userspace udev rules for imx devices
- 01-Samples
- viv_samples.tar.bz2 - FreeScale Vivante GPU demos
- 00-Support
The debian-image-squeeze rootfs has all deb-packages installed. |
Using Debian Linux on CM-FX6
Connection and Logging In
Use the following username and password to login:
Account with administrative privileges:
User: root 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)
- iwconfig command from wireless-tools package 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
- Activate the interface:
# ifconfig mlan0 up
- 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 tuning 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.
Touchscreen calibration is performed with the xinput_calibrator utility available in package xinput_calibrator. To calibrate the touchscreen:
- Make sure X Server is running
- Make sure the touchscreen driver is loaded as described in Touchscreen section
- Run the xinput_calibrator utility.
DISPLAY=:0 xinput_calibrator
- Use a stylus to tap the four registration point indicated in red on screen by the program.
- Follow the instruction at the end of the procedure in order make the calibration permanent.
Setting calibration data: 0, 4095, 0, 4095 Calibrating EVDEV driver for "ADS7846 Touchscreen" id=8 current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095 Doing dynamic recalibration: Setting calibration data: 14, 4099, 21, 4087 --> Making the calibration permanent <-- copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's) Section "InputClass" Identifier "calibration" MatchProduct "ADS7846 Touchscreen" Option "Calibration" "14 4099 21 4087" Option "SwapAxes" "0" EndSection
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
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. |
Debian Sid Linux
The purpose of this image is to provide the environment in order to show the FreeScale GPU and camera features.
Connection and Logging In
Use the following username and password to login:
Account with administrative privileges:
User: root Password: 111111
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, tty5, tty6).
Serial console (ttymxc3) provides a password less login with the root credentials. |
GPU Demos
This is a FreeScale tarball with the FreeScale GPU demos.
- Unpack viv_samples.tar.bz2 from cm-fx6-linux/extra/FreeScale GPU/01-Samples directory.
- Make the viv_samples.tar.bz2 content available to the CM-FX6 board. Use either nfs-mount or copy the viv_samples.tar.bz2 content to a media available to CM-FX6 board.
- On the CM-FX6 Linux console run:
# startx
- After the X server has started, open a terminal window: Mouse Right Click → Applications → Terminal Emulators → Xterm
- Mount the storage device or an NFS share with the content of viv_samples.tar.bz2 and enter the viv_samples directory:
# cd /path/to/mount/point/viv_samples/opt/viv_samples/vdk/
- Run any of the available tests: ./tutorial[1..7]_es20
# ./tutorial1_es20 # ./tutorial2_es20 # ./tutorial3_es20 # ./tutorial4_es20 # ./tutorial5_es20 # ./tutorial6_es20 # ./tutorial7_es20
Press 'ESC' for exit
Camera
Linux provides a variety of streaming tools for the V4L2 compliant devices. We provide two examples such as: imx-test and mplayer.
imx-test
imx-test is a FreeScale package that can be used to show the Camera Serial Interface (CSI) functionality.
- Unpack imx-test_3.0.35-4.0.0_armel.deb from cm-fx6-linux/extra/deb_packages directory:
# dpkg -x imx-test_3.0.35-4.0.0_armel.deb /path/to/cm-fx6-shared-directory
- Make the /path/to/cm-fx6-shared-directory content available to the CM-FX6 board. Use either nfs-mount or copy the /path/to/cm-fx6-shared-directory content to a media available to CM-FX6 board.
- On the CM-FX6 Linux console run:
# startx
- After the X server has started, open a terminal window: Mouse Right Click → Applications → Terminal Emulators → Xterm
Streaming the camera output to the frame buffer
# /path/to/imx-test_directory/unit_tests/mxc_v4l2_overlay.out -ow 720 -oh 525
Capturing a stills image
# /path/to/imx-test_directory/mxc_v4l2_still.out -f UYVY -w 720 -h 525 -m 1
mplayer
MPlayer application is not a part of the example root file system image. In order to install it run the following command:
apt-get install mplayer
Streaming the camera output
# mplayer tv:// -tv driver=v4l2:device=/dev/video0:outfmt=uyvy:width=720:height=524