Difference between revisions of "CM-T3517: Linux: Debian"
(→Socket CAN utilities) |
|||
Line 2: | Line 2: | ||
The example run-time Linux filesystem image for CM-T3517 is based on Debian GNU/Linux Sid. The CompuLab Linux package for CM-T3517 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 example run-time Linux filesystem image for CM-T3517 is based on Debian GNU/Linux Sid. The CompuLab Linux package for CM-T3517 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 | + | The default Debian Sid Linux image includes more than 400 software packages. Among them: |
* Core system | * Core system | ||
Line 11: | Line 11: | ||
* Samba connectivity suite | * Samba connectivity suite | ||
* SSH and FTP server and client | * SSH and FTP server and client | ||
+ | * ALSA configuration and usage utilities | ||
+ | * CAN Bus utilities | ||
+ | * Bluetooth tools and daemons | ||
+ | * The Graphics SDK including the Linux graphics (SGX) drivers and ready to run SGX functionality demos | ||
− | The [[CM-T3517: Linux: Getting started|Getting started with Linux on CM-T3517]] 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-T3517. | + | The [[CM-T3517: Linux: Getting started|Getting started with Linux on CM-T3517]] 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-T3517. | ||
− | == CM-T3517 | + | == Package contents == |
+ | |||
+ | === version.txt === | ||
+ | The contents of the {{filename|version.txt}} identifies the package version. | ||
+ | |||
+ | === images === | ||
+ | * {{filename|uImage-cm-t3517}} - ready to run Linux kernel image binary for CM-T3517 | ||
+ | * {{filename|debian-image.ubi}} - ready to run Debian Linux UBI image for installation onto the NAND flash | ||
+ | * {{filename|debian-image.tar.bz2}} - archive of the Debian root file system | ||
+ | * {{filename|kernel.img}} - Kernel image required for NAND image installation | ||
+ | * {{filename|ramdisk.img}} - Ramdisk image required for NAND image installation | ||
+ | * {{filename|bootscr.img}} - U-Boot script used for image installation | ||
+ | |||
+ | === kernel === | ||
+ | * {{filename|uImage-3.5.7-cm-t3517-2.bin}} - ready to run Linux kernel version 3.5.7-cm-t3517-2 for CM-T3517 | ||
+ | * {{filename|linux-3.5.7-cm-t3517-2.config}} - Linux kernel 3.5.7-cm-t3517-2 configuration file | ||
+ | * {{filename|linux-3.5.7-cm-t3517-2.patch}} - patch vs. [http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commit;h=f2b152564afdf9c9917c17d1c41c1082c82067bd Linux stable kernel 3.5.7] with support for CM-T3517 peripherals | ||
+ | * {{filename|patches}} - ordered collection of patches, that form the single patch above ({{filename|linux-3.5.7-cm-t3517-2.patch}}) | ||
+ | |||
+ | === utilities === | ||
+ | The {{filename|utilities}} directory contains miscellaneous utilities useful for development | ||
+ | * {{filename|tftpd32.zip}} - TFTP server for Windows users | ||
+ | * {{filename|eeprom-util}} - CompuLab EEPROM utility for reading information found inside the EEPROM on CompuLab boards | ||
+ | * {{filename|bootscr.src}} - U-Boot script source used for loading kernel and ramdisk images from MMC/SD card | ||
+ | * {{filename|debian-image.cfg}} - configuration file used by {{filename|ubinize}} utility for {{filename|debian-image.ubi}} generation. For more information about UBIFS images please refer to the [[Linux_Development_for_ARM_modules#UBIFS_images|Linux Development for ARM modules]] article. | ||
+ | |||
+ | === extra === | ||
+ | The {{filename|extra}} directory contains files that are not directly connected to the Linux kernel | ||
+ | |||
+ | {{filename|Graphics_SDK_04.06.00.03}} - directory contains graphics (SGX) related files: | ||
+ | * {{filename|graphics_sdk_04.06.00.03-cm-t3517-2.patch}} - patch to fix the Graphics SDK v04.06.00.03 compile time errors | ||
+ | |||
+ | |||
+ | == Using Debian Linux on CM-T3517 == | ||
=== Connection and Logging In === | === Connection and Logging In === | ||
Line 32: | Line 70: | ||
In addition to these accounts CM-T3517 allows anonymous FTP access. | In addition to these accounts CM-T3517 allows anonymous FTP access. | ||
− | To login into the Linux system, you may use a serial console ( | + | 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 DVI/LCD display (tty1, tty2, tty3). |
=== Networking === | === Networking === | ||
Line 48: | Line 86: | ||
Before starting X Windows, connect USB mouse and keyboard to the system. | Before starting X Windows, connect USB mouse and keyboard to the system. | ||
You can run X Windows by typing '''''startx'''''. | You can run X Windows by typing '''''startx'''''. | ||
+ | |||
+ | === Software Management === | ||
+ | |||
+ | Debian Linux image for CM-T3517 includes all the information required to use Debian package management utilities. You can use [http://linux.die.net/man/8/apt-get apt-get] and [http://www.wlug.org.nz/dpkg(8) dpkg] out of the box. | ||
=== Audio === | === Audio === | ||
CM-T3517 uses the TLV320AIC23B (TI) audio codec. | CM-T3517 uses the TLV320AIC23B (TI) audio codec. | ||
− | + | If the default CM-T3517 configuration is used, the audio drivers are modularized and are loaded automatically in the boot process. | |
− | + | ||
− | + | Codec driver {{filename|snd_soc_tlv320aic23}} must be loaded before audio driver {{filename|snd-soc-cm-t3517}}. | |
− | + | A workaround could be adding {{cmd|snd-soc-cm-t3517}} entry into {{filename|/etc/modprobe.d/alsa-base-blacklist.conf}} and {{filename|/etc/modules}}. | |
+ | |||
More information about Linux audio subsystem can be found at [http://www.alsa-project.org ALSA project official website]. | More information about Linux audio subsystem can be found at [http://www.alsa-project.org ALSA project official website]. | ||
Line 66: | Line 109: | ||
The X Windows system of CM-T3517 uses tslib X server input driver to get the input from the touchscreen. | The X Windows system of CM-T3517 uses tslib X server input driver to get the input from the touchscreen. | ||
− | === Touchscreen calibration === | + | ==== Touchscreen calibration ==== |
Touchscreen calibration can be performed with '''''ts_calibrate''''' utility available in package ''libts-bin''. To calibrate the touchscreen: | Touchscreen calibration can be performed with '''''ts_calibrate''''' utility available in package ''libts-bin''. To calibrate the touchscreen: | ||
* Make sure X Server is not running | * Make sure X Server is not running | ||
Line 84: | Line 127: | ||
mount /dev/mmcblk0p1 /mnt/mmcblk0p1 | mount /dev/mmcblk0p1 /mnt/mmcblk0p1 | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
=== Controller–area network (CAN) === | === Controller–area network (CAN) === | ||
Line 93: | Line 132: | ||
===== Loading CAN modules ===== | ===== Loading CAN modules ===== | ||
− | If TI HECC driver and/or Raw CAN protocol compiled as module(s), they must be loaded prior to enabling CAN interface. | + | If the TI HECC driver and/or Raw CAN protocol compiled as module(s), they must be loaded prior to enabling CAN interface. |
− | Load Raw CAN protocol module: | + | * Load Raw CAN protocol module: |
<pre> | <pre> | ||
root@cm-debian:~# modprobe can-raw | root@cm-debian:~# modprobe can-raw | ||
Line 103: | Line 142: | ||
root@cm-debian:~# | root@cm-debian:~# | ||
</pre> | </pre> | ||
− | Load TI HECC driver module: | + | * Load TI HECC driver module: |
<pre> | <pre> | ||
root@cm-debian:~# modprobe ti_hecc | root@cm-debian:~# modprobe ti_hecc | ||
Line 112: | Line 151: | ||
</pre> | </pre> | ||
− | For information on enabling CAN kernel support, please, see [[CM-T3517: Linux: Kernel#Controller | + | For information on enabling CAN kernel support, please, see the [[CM-T3517: Linux: Kernel#Controller.E2.80.93area_network_.28CAN.29_support|Linux Kernel for CM-T3517]] page. |
===== CAN interface configuration ===== | ===== CAN interface configuration ===== | ||
− | It is recommended configure the CAN interface, with the {{filename|iproute2}} utilities. To make sure the right {{filename|ip}} utility is used, run: | + | It is recommended configure the CAN interface, with the {{filename|iproute2}} utilities. |
+ | |||
+ | * To make sure the right {{filename|ip}} utility is used, run: | ||
<pre> | <pre> | ||
root@cm-debian:~# ip -V | root@cm-debian:~# ip -V | ||
Line 122: | Line 163: | ||
</pre> | </pre> | ||
− | Configure CAN interface bit-rate to 125 Kbits/sec (values of up to 1Mbit/sec are supported): | + | * Configure the CAN interface bit-rate to 125 Kbits/sec (values of up to 1Mbit/sec are supported): |
<pre> | <pre> | ||
root@cm-debian:~# ip link set can0 type can bitrate 125000 | root@cm-debian:~# ip link set can0 type can bitrate 125000 | ||
Line 128: | Line 169: | ||
</pre> | </pre> | ||
− | Enable CAN interface: | + | * Enable the CAN interface: |
<pre> | <pre> | ||
root@cm-debian:~# ip link set can0 up | root@cm-debian:~# ip link set can0 up | ||
Line 135: | Line 176: | ||
</pre> | </pre> | ||
− | ===== | + | ===== Send/Receive packets ===== |
− | + | ||
− | |||
Use {{filename|cansend}} and {{filename|candump}} utilities to send and receive packets via CAN interface. | Use {{filename|cansend}} and {{filename|candump}} utilities to send and receive packets via CAN interface. | ||
− | Send standard CAN frame (on the first device): | + | * Send standard CAN frame (on the first device): |
<pre> | <pre> | ||
− | + | root@cm-debian:/usr/local/can-utils# cansend can0 111#1122334455667788 | |
− | root@cm-debian:/usr/local/can-utils# | ||
root@cm-debian:/usr/local/can-utils# | root@cm-debian:/usr/local/can-utils# | ||
</pre> | </pre> | ||
− | Send extended CAN frame (on the first device): | + | |
+ | * Send extended CAN frame (on the first device): | ||
<pre> | <pre> | ||
− | root@cm-debian:/usr/local/can-utils# | + | root@cm-debian:/usr/local/can-utils# cansend can0 11111111#1122334455667788 |
root@cm-debian:/usr/local/can-utils# | root@cm-debian:/usr/local/can-utils# | ||
</pre> | </pre> | ||
− | Dump all received data frames as well as error frames (on the second device): | + | |
+ | * Dump all received data frames as well as error frames (on the second device): | ||
<pre> | <pre> | ||
− | root@cm-debian:/usr/local/can-utils# | + | root@cm-debian:/usr/local/can-utils# candump any,0:0,#FFFFFFFF |
can0 111 [8] 11 22 33 44 55 66 77 88 | can0 111 [8] 11 22 33 44 55 66 77 88 | ||
can0 11111111 [8] 11 22 33 44 55 66 77 88 | can0 11111111 [8] 11 22 33 44 55 66 77 88 | ||
</pre> | </pre> | ||
− | == | + | === USB On-The-Go (OTG) === |
+ | |||
+ | CM-T3517 features a Mentor Graphic's USB OTG2.0 high-speed USB On-The-Go (OTG) controller. CM-T3517 OTG port is USB host and USB device (gadget) capable. | ||
+ | |||
+ | Host and Gadget drivers are compiled as modules with default CM-T3517 kernel configuration. Both should be loaded for OTG support. | ||
+ | |||
+ | * Load Host driver: | ||
+ | <pre> | ||
+ | root@cm-debian:~# modprobe am35x | ||
+ | musb-hdrc: version 6.0, ?dma?, otg (peripheral+host) | ||
+ | <6>Waiting for PHY clock good... | ||
+ | musb-hdrc musb-hdrc: >USB OTG mode controller at d0eca000 using PIO, IRQ 71 | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | * Load Gadget driver: | ||
+ | <pre> | ||
+ | root@cm-debian:~# modprobe g_serial | ||
+ | gadget: >Gadget Serial v2.4 | ||
+ | gadget: >g_serial ready | ||
+ | musb-hdrc musb-hdrc: >MUSB HDRC host driver | ||
+ | musb-hdrc musb-hdrc: >new USB bus registered, assigned bus number 2 | ||
+ | usb usb2: >New USB device found, idVendor=1d6b, idProduct=0002 | ||
+ | usb usb2: >New USB device strings: Mfr=3, Product=2, SerialNumber=1 | ||
+ | usb usb2: >Product: MUSB HDRC host driver | ||
+ | usb usb2: >Manufacturer: Linux 3.5.7-cm-t3517+ musb-hcd | ||
+ | usb usb2: >SerialNumber: musb-hdrc | ||
+ | hub 2-0:1.0: >USB hub found | ||
+ | hub 2-0:1.0: >1 port detected | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | Default CM-T3517 kernel configuration enables {{filename|g_serial}}, {{filename|g_mass_storage}}, {{filename|g_ether}} and {{filename|g_zero}} gadget drivers. | ||
+ | More gadget drivers can be enabled in the kernel configuration. | ||
+ | |||
+ | ==== Testing OTG port ==== | ||
+ | |||
+ | * Host mode. Connect USB keyboard to OTG port. | ||
+ | <pre> | ||
+ | usb 2-1: >new low-speed USB device number 3 using musb-hdrc | ||
+ | usb 2-1: >device v413c p2107 is not supported | ||
+ | usb 2-1: >New USB device found, idVendor=413c, idProduct=2107 | ||
+ | usb 2-1: >New USB device strings: Mfr=1, Product=2, SerialNumber=0 | ||
+ | usb 2-1: >Product: Dell USB Entry Keyboard | ||
+ | usb 2-1: >Manufacturer: Dell | ||
+ | input: Dell Dell USB Entry Keyboard as /devices/platform/musb-am35x/musb-hdrc/usb2/2-1/2-1:1.0/input/input4 | ||
+ | hid-generic 0003:413C:2107.0004: >input: USB HID v1.10 Keyboard [Dell Dell USB Entry Keyboard] on usb-musb-hdrc-1/input0 | ||
+ | </pre> | ||
+ | |||
+ | * Gadget mode. Connect desktop PC to OTG port. | ||
+ | <pre> | ||
+ | gadget: >high-speed config #2: CDC ACM config | ||
+ | </pre> | ||
+ | |||
+ | === Bluetooth === | ||
+ | |||
+ | CM-T3517 features Bluetooth 4.0 interface. Following sections describe the initialization and simple use cases of Bluetooth device. | ||
+ | |||
+ | ==== Host Controller Interface (HCI) Initialization ==== | ||
+ | |||
+ | * Attach the ttyO1 serial UART to the HCI Bluetooth stack: | ||
+ | <pre> | ||
+ | root@cm-debian:~# hciattach -s 115200 /dev/ttyO1 texas 3000000 | ||
+ | Found a Texas Instruments' chip! | ||
+ | Firmware file : /lib/firmware/TIInit_7.6.15.bts | ||
+ | Loaded BTS script version 1 | ||
+ | texas: changing baud rate to 3000000, flow control to 1 | ||
+ | Bluetooth: HCI UART driver ver 2.2 | ||
+ | Bluetooth: HCI H4 protocol initialized | ||
+ | Bluetooth: HCI BCSP protocol initialized | ||
+ | Bluetooth: HCILL protocol initialized | ||
+ | Bluetooth: RFCOMM TTY layer initialized | ||
+ | Bluetooth: RFCOMM socket layer initialized | ||
+ | Bluetooth: RFCOMM ver 1.11 | ||
+ | Device setup complete | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | * Run HCI device configuration utility to retrieve detailed information about the Bluetooth device: | ||
+ | <pre> | ||
+ | root@cm-debian:~# hciconfig -a | ||
+ | hci0: Type: BR/EDR Bus: UART | ||
+ | BD Address: 1C:45:93:3E:5D:86 ACL MTU: 1021:4 SCO MTU: 180:4 | ||
+ | UP RUNNING PSCAN | ||
+ | RX bytes:6085 acl:38 sco:0 events:279 errors:0 | ||
+ | TX bytes:118688 acl:164 sco:0 commands:78 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 PARK | ||
+ | Link mode: SLAVE ACCEPT | ||
+ | Name: 'cm-debian-0' | ||
+ | Class: 0x080100 | ||
+ | Service Classes: Capturing | ||
+ | Device Class: Computer, Uncategorized | ||
+ | HCI Version: 4.0 (0x6) Revision: 0x0 | ||
+ | LMP Version: 4.0 (0x6) Subversion: 0x1f29 | ||
+ | Manufacturer: Texas Instruments Inc. (13) | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | ==== A2DP Headphones ==== | ||
+ | |||
+ | * Scan for available devices to find out Headphones BT device address: | ||
+ | <pre> | ||
+ | root@cm-debian:~# hcitool scan | ||
+ | Scanning ... | ||
+ | 00:07:A4:F2:B3:CB Motorola HT820 | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
− | + | * Add new PCM device by editing {{filename|/etc/asound.conf}}: | |
+ | |||
+ | <pre> | ||
+ | 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 | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | * List device names to ensure correct settings in {{filename|/etc/asound.conf}}: | ||
+ | <pre> | ||
+ | root@cm-debian:~# aplay -L | ||
+ | null | ||
+ | Discard all samples (playback) or generate zero samples (capture) | ||
+ | btheadphones | ||
+ | BT Headphones | ||
+ | default:CARD=cmt3517 | ||
+ | cm-t3517, | ||
+ | Default Audio Device | ||
+ | sysdefault:CARD=cmt3517 | ||
+ | cm-t3517, | ||
+ | Default Audio Device | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | * Put the headphones in the pairing mode and launch {{filename|bluez-simple-agent}} application and provide device PIN code on request: | ||
+ | <pre> | ||
+ | root@cm-debian:~# 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) | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | * Launch {{filename|aplay}} playback tool: | ||
+ | <pre> | ||
+ | root@cm-debian:~# aplay -D btheadphones sample_audio.wav | ||
+ | Playing WAVE 'sample_audio.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo | ||
+ | </pre> | ||
+ | |||
+ | ==== Obex FTP service ==== | ||
+ | |||
+ | The OBject EXchange protocol (OBEX) can be used to exchange all kind of objects like files, pictures, calendar entries (vCal) and business cards (vCard) over bluetooth, IrDA, USB and serial cable links. | ||
+ | CM-T3517 Linux example root file system contains file transfer utility for devices that use the OBEX protocol. Following examples demonstrate its usage with mobile phone device. | ||
+ | |||
+ | * Enable bluetooth on the phone. On CM-T3517, scan for available devices to find out phone's BT address: | ||
+ | <pre> | ||
+ | root@cm-debian:~# hcitool scan | ||
+ | Scanning ... | ||
+ | 00:15:2A:20:63:94 Nokia 6230i | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | * Ensure the phone supports Obex FTP service: | ||
+ | <pre> | ||
+ | root@cm-debian:~# sdptool search FTP | ||
+ | Inquiring ... | ||
+ | Searching for FTP on 00:15:2A:20:63:94 ... | ||
+ | Service Name: OBEX File Transfer | ||
+ | Service RecHandle: 0x100de | ||
+ | Service Class ID List: | ||
+ | "OBEX File Transfer" (0x1106) | ||
+ | Protocol Descriptor List: | ||
+ | "L2CAP" (0x0100) | ||
+ | "RFCOMM" (0x0003) | ||
+ | Channel: 10 | ||
+ | "OBEX" (0x0008) | ||
+ | Language Base Attr List: | ||
+ | code_ISO639: 0x656e | ||
+ | encoding: 0x6a | ||
+ | base_offset: 0x100 | ||
+ | Profile Descriptor List: | ||
+ | "OBEX File Transfer" (0x1106) | ||
+ | Version: 0x0100 | ||
+ | |||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | * Pair the device - provide PIN code upon request and confirm permission request on the phone: | ||
+ | <pre> | ||
+ | root@cm-debian:~# bluez-simple-agent hci0 00:15:2A:20:63:94 | ||
+ | RequestPinCode (/org/bluez/1285/hci0/dev_00_15_2A_20_63_94) | ||
+ | Enter PIN Code: 1937 | ||
+ | Release | ||
+ | New device (/org/bluez/1285/hci0/dev_00_15_2A_20_63_94) | ||
+ | |||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | {{Note|You can launch {{cmd|bluez-simple-agent}} with no parameters. The agent is tracking requests to all bluetooth devices and triggers pin code confirmation when needed.}} | ||
+ | |||
+ | * List phone's root folder: | ||
+ | <pre> | ||
+ | root@cm-debian:~# obexftp -b 00:15:2A:20:63:94 --list | ||
+ | Browsing 00:15:2A:20:63:94 ... | ||
+ | Connecting..\done | ||
+ | Tried to connect for 579ms | ||
+ | Receiving "(null)".../<?xml version="1.0"?> | ||
+ | <!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd" | ||
+ | [ <!ATTLIST folder mem-type CDATA #IMPLIED> ]> | ||
+ | <folder-listing version="1.0"> | ||
+ | <folder name="EXTENTSION" user-perm="RW" mem-type="MMC"/> | ||
+ | <folder name="Images" created="19800101T000000" user-perm="R" mem-type="DEV"/> | ||
+ | <folder name="Video clips" created="19800101T000000" user-perm="R" mem-type="DEV"/> | ||
+ | <folder name="Music files" created="19800101T000000" user-perm="R" mem-type="DEV"/> | ||
+ | <folder name="Themes" created="19800101T000000" user-perm="RW" mem-type="DEV"/> | ||
+ | <folder name="Graphics" created="19800101T000000" user-perm="R" mem-type="DEV"/> | ||
+ | <folder name="Tones" created="19800101T000000" user-perm="R" mem-type="DEV"/> | ||
+ | <folder name="Recordings" created="19800101T000000" user-perm="R" mem-type="DEV"/> | ||
+ | </folder-listing> | ||
+ | done | ||
+ | Disconnecting..-done | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | * Transfer a file from CM-T3517 to the phone: | ||
+ | <pre> | ||
+ | root@cm-debian:~# obexftp -b 00:15:2A:20:63:94 --put test_file.txt | ||
+ | Browsing 00:15:2A:20:63:94 ... | ||
+ | Connecting..\done | ||
+ | Tried to connect for 380ms | ||
+ | Sending "test_file.txt"...|done | ||
+ | Disconnecting../done | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | * Retrieve a file from the phone to CM-T3517: | ||
+ | <pre> | ||
+ | root@cm-debian:~# obexftp -b 00:15:2A:20:63:94 --get test_file.txt | ||
+ | Browsing 00:15:2A:20:63:94 ... | ||
+ | Connecting..\done | ||
+ | Tried to connect for 267ms | ||
+ | Receiving "test_file.txt".../done | ||
+ | Disconnecting..-done | ||
+ | root@cm-debian:~# | ||
+ | </pre> | ||
+ | |||
+ | === Display options === | ||
+ | CM-T3517 evaluation platform has four video output interfaces: LCD, DVI, LVDS and TV-out. Default configuration of Debian Linux for CM-T3517 uses LCD as primary video output. It is possible to switch between the DVI and LCD interfaces on the fly. TV-out can be used simultaneously with LCD or DVI interface.<br> | ||
+ | Linux implementation of the OMAP3 display subsystem is described in detail in {{filename|[http://gitorious.org/linux-omap-dss2/linux/blobs/master/Documentation/arm/OMAP/DSS Documentation/arm/OMAP/DSS]}} file in the Linux kernel source tree. | ||
+ | |||
+ | ==== Display resolutions ==== | ||
+ | * The Toppoly LCD supplied with CM-T3517 evaluation kit supports 480x640 resolution with 18 bits per color | ||
+ | * DVI output can be configured for standard resolutions using kernel command line parameter {{parameter|omapfb.mode}}: | ||
+ | *: 1024x768 - omapfb.mode=dvi:1024x768-24@60 | ||
+ | *: 800x600 - omapfb.mode=dvi:800x600-24@60 | ||
+ | *: 640x480 - omapfb.mode=dvi:640x480-24@60 | ||
+ | * TV-out supports PAL and NTSC standards | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * Switch from LCD to DVI | ||
+ | <pre> | ||
+ | echo 0 > /sys/devices/platform/omapdss/display0/enabled | ||
+ | echo "dvi" > /sys/devices/platform/omapdss/manager0/display | ||
+ | fbset -fb /dev/fb0 -xres 1024 -yres 768 | ||
+ | echo 1 > /sys/devices/platform/omapdss/display1/enabled | ||
+ | </pre> | ||
+ | |||
+ | * Switch from DVI to LCD | ||
+ | <pre> | ||
+ | echo 0 > /sys/devices/platform/omapdss/display1/enabled | ||
+ | echo "lcd" > /sys/devices/platform/omapdss/manager0/display | ||
+ | fbset -fb /dev/fb0 -xres 480 -yres 640 | ||
+ | echo 1 > /sys/devices/platform/omapdss/display0/enabled | ||
+ | </pre> | ||
+ | |||
+ | === GPIO access === | ||
+ | Linux provides simple and convenient GPIO access via {{filename|sysfs}} interface. A GPIO should be exported using {{filename|/sys/class/gpio/export}}. After the GPIO is exported it is possible to change its direction and value using {{filename|/sys/class/gpio/gpioX/direction}} and {{filename|/sys/class/gpio/gpioX/value}} attributes. | ||
+ | |||
+ | ==== Example ==== | ||
+ | The following example demonstrates how to configure GPIO 140 as output and set value to high: | ||
+ | <pre> | ||
+ | echo 140 > /sys/class/gpio/export | ||
+ | echo out > /sys/class/gpio/gpio140/direction | ||
+ | echo 1 > /sys/class/gpio/gpio140/value | ||
+ | </pre> | ||
+ | {{Note|The above example assums that the corresponding pin is set to mux '''mode 4''' and the GPIO 140 is '''not''' requested in the Linux kernel.}} | ||
+ | |||
+ | === Graphics SDK === | ||
+ | The CM-T3517 Linux package contains pre-built and ready to run SGX functionality demo programs. | ||
+ | * The SGX configuration script must be run on CM-T3730 before '''first use''': | ||
+ | <pre> | ||
+ | root@cm-debian:~# /etc/init.d/omap-demo | ||
+ | </pre> | ||
+ | |||
+ | * The SGX kernel modules must be loaded prior running the demos: | ||
+ | <pre> | ||
+ | root@cm-debian:~# /etc/init.d/rc.pvr start | ||
+ | </pre> | ||
+ | |||
+ | ==== Running Graphics SDK OpenGL ES1.x Demos ==== | ||
+ | * To run OpenGL ES1.x demos, perform the following: | ||
+ | <pre> | ||
+ | root@cm-debian:~# cd /opt/gfxsdkdemos/ogles | ||
+ | root@cm-debian:/opt/gfxsdkdemos/ogles# ./OGLESEvilSkull | ||
+ | </pre> | ||
+ | This will execute the {{filename|OGLESEvilSkull}} demo. Press {{parameter|‘q’}} on the CM-T3517 console to stop the demo execution. | ||
+ | |||
+ | ==== Running Graphics SDK OpenGL ES2.0 Demos ==== | ||
+ | * To run OpenGL ES2.x demos, perform the following: | ||
+ | <pre> | ||
+ | root@cm-debian:~# cd /opt/gfxsdkdemos/ogles2 | ||
+ | root@cm-debian:/opt/gfxsdkdemos/ogle2s# ./OGLESFilmTV | ||
+ | </pre> | ||
+ | This will execute the {{filename|OGLESFilmTV}} demo. Press {{parameter|‘q’}} on the CM-T3517 console to stop the demo | ||
+ | execution. | ||
== See also == | == See also == | ||
Line 166: | Line 535: | ||
* [[CM-T3517: Linux: Getting started]] | * [[CM-T3517: Linux: Getting started]] | ||
* [[CM-T3517: Linux: Kernel]] | * [[CM-T3517: Linux: Kernel]] | ||
+ | * [[CM-T3517: Linux: Building images and tools]] | ||
* [[Linux: Development for ARM modules]] | * [[Linux: Development for ARM modules]] | ||
* [[Linux: Debian: Minimal ARM filesystem]] | * [[Linux: Debian: Minimal ARM filesystem]] |
Revision as of 13:16, 17 October 2012
Contents
- 1 Overview
- 2 Package contents
- 3 Using Debian Linux on CM-T3517
- 4 See also
Overview
The example run-time Linux filesystem image for CM-T3517 is based on Debian GNU/Linux Sid. The CompuLab Linux package for CM-T3517 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
- Fluxbox 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 Graphics SDK including the Linux graphics (SGX) drivers and ready to run SGX functionality demos
The Getting started with Linux on CM-T3517 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-T3517.
Package contents
version.txt
The contents of the version.txt identifies the package version.
images
- uImage-cm-t3517 - ready to run Linux kernel image binary for CM-T3517
- debian-image.ubi - ready to run Debian Linux UBI image for installation onto the NAND flash
- debian-image.tar.bz2 - archive of the Debian root file system
- kernel.img - Kernel image required for NAND image installation
- ramdisk.img - Ramdisk image required for NAND image installation
- bootscr.img - U-Boot script used for image installation
kernel
- uImage-3.5.7-cm-t3517-2.bin - ready to run Linux kernel version 3.5.7-cm-t3517-2 for CM-T3517
- linux-3.5.7-cm-t3517-2.config - Linux kernel 3.5.7-cm-t3517-2 configuration file
- linux-3.5.7-cm-t3517-2.patch - patch vs. Linux stable kernel 3.5.7 with support for CM-T3517 peripherals
- patches - ordered collection of patches, that form the single patch above (linux-3.5.7-cm-t3517-2.patch)
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
The extra directory contains files that are not directly connected to the Linux kernel
Graphics_SDK_04.06.00.03 - directory contains graphics (SGX) related files:
- graphics_sdk_04.06.00.03-cm-t3517-2.patch - patch to fix the Graphics SDK v04.06.00.03 compile time errors
Using Debian Linux on CM-T3517
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-T3517 allows anonymous FTP access. 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 DVI/LCD display (tty1, tty2, tty3).
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
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 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
CompuLab distribution contains full featured X Windows system with Fluxbox window manager. Before starting X Windows, connect USB mouse and keyboard to the system. You can run X Windows by typing startx.
Software Management
Debian Linux image for CM-T3517 includes all the information required to use Debian package management utilities. You can use apt-get and dpkg out of the box.
Audio
CM-T3517 uses the TLV320AIC23B (TI) audio codec. If the default CM-T3517 configuration is used, the audio drivers are modularized and are loaded automatically in the boot process.
Codec driver snd_soc_tlv320aic23 must be loaded before audio driver snd-soc-cm-t3517. A workaround could be adding snd-soc-cm-t3517 entry into /etc/modprobe.d/alsa-base-blacklist.conf and /etc/modules.
More information about Linux audio subsystem can be found at ALSA project official website.
Touchscreen
CM-T3517 uses the TSC2046 (TI) touchscreen controller. The touchscreen driver is modularized if you use default CM-T3517 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:
modprobe ads7846
The X Windows system of CM-T3517 uses tslib X server input driver to get the input from the touchscreen.
Touchscreen calibration
Touchscreen calibration can be performed with 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
- Set the TSLIB_TSDEVICE system variable:
export TSLIB_TSDEVICE=/dev/input/by-path/platform-omap2_mcspi.1-event
- Run 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 ts_test utility to test the calibration results.
MMC/SD
The support for MMC/SD card on CM-T3517 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:
if [ ! -d /mnt/mmcblk0p1 ]; then mkdir /mnt/mmcblk0p1; fi mount /dev/mmcblk0p1 /mnt/mmcblk0p1
Controller–area network (CAN)
The CM-T3517 features a TI High End CAN Controller (HECC), integrated into the Sitara AM3517/05 SoC. The TI HECC implements full CAN protocol version 2.0B. It supports both the base (standard) and the extended frame format as well as a programmable data bit rate with maximum of 1Mbit/s.
Loading CAN modules
If the TI HECC driver and/or Raw CAN protocol compiled as module(s), they must be loaded prior to enabling CAN interface.
- Load Raw CAN protocol module:
root@cm-debian:~# modprobe can-raw can: controller area network core (rev 20090105 abi 8) NET: Registered protocol family 29 can: raw protocol (rev 20090105) root@cm-debian:~#
- Load TI HECC driver module:
root@cm-debian:~# modprobe ti_hecc CAN device driver interface TI High End CAN Controller Driver 0.7 ti_hecc ti_hecc.1: device registered (reg_base=d0a08000, irq=24) root@cm-debian:~#
For information on enabling CAN kernel support, please, see the Linux Kernel for CM-T3517 page.
CAN interface configuration
It is recommended configure the CAN interface, with the iproute2 utilities.
- To make sure the right ip utility is used, run:
root@cm-debian:~# ip -V ip utility, iproute2-ss100224 root@cm-debian:~#
- Configure the CAN interface bit-rate to 125 Kbits/sec (values of up to 1Mbit/sec are supported):
root@cm-debian:~# ip link set can0 type can bitrate 125000 root@cm-debian:~#
- Enable the CAN interface:
root@cm-debian:~# ip link set can0 up ti_hecc ti_hecc.1: setting CANBTC=0xc0028 root@cm-debian:~#
Send/Receive packets
Use cansend and candump utilities to send and receive packets via CAN interface.
- Send standard CAN frame (on the first device):
root@cm-debian:/usr/local/can-utils# cansend can0 111#1122334455667788 root@cm-debian:/usr/local/can-utils#
- Send extended CAN frame (on the first device):
root@cm-debian:/usr/local/can-utils# cansend can0 11111111#1122334455667788 root@cm-debian:/usr/local/can-utils#
- Dump all received data frames as well as error frames (on the second device):
root@cm-debian:/usr/local/can-utils# candump any,0:0,#FFFFFFFF can0 111 [8] 11 22 33 44 55 66 77 88 can0 11111111 [8] 11 22 33 44 55 66 77 88
USB On-The-Go (OTG)
CM-T3517 features a Mentor Graphic's USB OTG2.0 high-speed USB On-The-Go (OTG) controller. CM-T3517 OTG port is USB host and USB device (gadget) capable.
Host and Gadget drivers are compiled as modules with default CM-T3517 kernel configuration. Both should be loaded for OTG support.
- Load Host driver:
root@cm-debian:~# modprobe am35x musb-hdrc: version 6.0, ?dma?, otg (peripheral+host) <6>Waiting for PHY clock good... musb-hdrc musb-hdrc: >USB OTG mode controller at d0eca000 using PIO, IRQ 71 root@cm-debian:~#
- Load Gadget driver:
root@cm-debian:~# modprobe g_serial gadget: >Gadget Serial v2.4 gadget: >g_serial ready musb-hdrc musb-hdrc: >MUSB HDRC host driver musb-hdrc musb-hdrc: >new USB bus registered, assigned bus number 2 usb usb2: >New USB device found, idVendor=1d6b, idProduct=0002 usb usb2: >New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb2: >Product: MUSB HDRC host driver usb usb2: >Manufacturer: Linux 3.5.7-cm-t3517+ musb-hcd usb usb2: >SerialNumber: musb-hdrc hub 2-0:1.0: >USB hub found hub 2-0:1.0: >1 port detected root@cm-debian:~#
Default CM-T3517 kernel configuration enables g_serial, g_mass_storage, g_ether and g_zero gadget drivers. More gadget drivers can be enabled in the kernel configuration.
Testing OTG port
- Host mode. Connect USB keyboard to OTG port.
usb 2-1: >new low-speed USB device number 3 using musb-hdrc usb 2-1: >device v413c p2107 is not supported usb 2-1: >New USB device found, idVendor=413c, idProduct=2107 usb 2-1: >New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 2-1: >Product: Dell USB Entry Keyboard usb 2-1: >Manufacturer: Dell input: Dell Dell USB Entry Keyboard as /devices/platform/musb-am35x/musb-hdrc/usb2/2-1/2-1:1.0/input/input4 hid-generic 0003:413C:2107.0004: >input: USB HID v1.10 Keyboard [Dell Dell USB Entry Keyboard] on usb-musb-hdrc-1/input0
- Gadget mode. Connect desktop PC to OTG port.
gadget: >high-speed config #2: CDC ACM config
Bluetooth
CM-T3517 features Bluetooth 4.0 interface. Following sections describe the initialization and simple use cases of Bluetooth device.
Host Controller Interface (HCI) Initialization
- Attach the ttyO1 serial UART to the HCI Bluetooth stack:
root@cm-debian:~# hciattach -s 115200 /dev/ttyO1 texas 3000000 Found a Texas Instruments' chip! Firmware file : /lib/firmware/TIInit_7.6.15.bts Loaded BTS script version 1 texas: changing baud rate to 3000000, flow control to 1 Bluetooth: HCI UART driver ver 2.2 Bluetooth: HCI H4 protocol initialized Bluetooth: HCI BCSP protocol initialized Bluetooth: HCILL protocol initialized Bluetooth: RFCOMM TTY layer initialized Bluetooth: RFCOMM socket layer initialized Bluetooth: RFCOMM ver 1.11 Device setup complete root@cm-debian:~#
- Run HCI device configuration utility to retrieve detailed information about the Bluetooth device:
root@cm-debian:~# hciconfig -a hci0: Type: BR/EDR Bus: UART BD Address: 1C:45:93:3E:5D:86 ACL MTU: 1021:4 SCO MTU: 180:4 UP RUNNING PSCAN RX bytes:6085 acl:38 sco:0 events:279 errors:0 TX bytes:118688 acl:164 sco:0 commands:78 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 PARK Link mode: SLAVE ACCEPT Name: 'cm-debian-0' Class: 0x080100 Service Classes: Capturing Device Class: Computer, Uncategorized HCI Version: 4.0 (0x6) Revision: 0x0 LMP Version: 4.0 (0x6) Subversion: 0x1f29 Manufacturer: Texas Instruments Inc. (13) root@cm-debian:~#
A2DP Headphones
- Scan for available devices to find out Headphones BT device address:
root@cm-debian:~# hcitool scan Scanning ... 00:07:A4:F2:B3:CB Motorola HT820 root@cm-debian:~#
- 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:
root@cm-debian:~# aplay -L null Discard all samples (playback) or generate zero samples (capture) btheadphones BT Headphones default:CARD=cmt3517 cm-t3517, Default Audio Device sysdefault:CARD=cmt3517 cm-t3517, Default Audio Device root@cm-debian:~#
- Put the headphones in the pairing mode and launch bluez-simple-agent application and provide device PIN code on request:
root@cm-debian:~# 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) root@cm-debian:~#
- Launch aplay playback tool:
root@cm-debian:~# aplay -D btheadphones sample_audio.wav Playing WAVE 'sample_audio.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo
Obex FTP service
The OBject EXchange protocol (OBEX) can be used to exchange all kind of objects like files, pictures, calendar entries (vCal) and business cards (vCard) over bluetooth, IrDA, USB and serial cable links. CM-T3517 Linux example root file system contains file transfer utility for devices that use the OBEX protocol. Following examples demonstrate its usage with mobile phone device.
- Enable bluetooth on the phone. On CM-T3517, scan for available devices to find out phone's BT address:
root@cm-debian:~# hcitool scan Scanning ... 00:15:2A:20:63:94 Nokia 6230i root@cm-debian:~#
- Ensure the phone supports Obex FTP service:
root@cm-debian:~# sdptool search FTP Inquiring ... Searching for FTP on 00:15:2A:20:63:94 ... Service Name: OBEX File Transfer Service RecHandle: 0x100de Service Class ID List: "OBEX File Transfer" (0x1106) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 10 "OBEX" (0x0008) Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Profile Descriptor List: "OBEX File Transfer" (0x1106) Version: 0x0100 root@cm-debian:~#
- Pair the device - provide PIN code upon request and confirm permission request on the phone:
root@cm-debian:~# bluez-simple-agent hci0 00:15:2A:20:63:94 RequestPinCode (/org/bluez/1285/hci0/dev_00_15_2A_20_63_94) Enter PIN Code: 1937 Release New device (/org/bluez/1285/hci0/dev_00_15_2A_20_63_94) root@cm-debian:~#
You can launch bluez-simple-agent with no parameters. The agent is tracking requests to all bluetooth devices and triggers pin code confirmation when needed. |
- List phone's root folder:
root@cm-debian:~# obexftp -b 00:15:2A:20:63:94 --list Browsing 00:15:2A:20:63:94 ... Connecting..\done Tried to connect for 579ms Receiving "(null)".../<?xml version="1.0"?> <!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd" [ <!ATTLIST folder mem-type CDATA #IMPLIED> ]> <folder-listing version="1.0"> <folder name="EXTENTSION" user-perm="RW" mem-type="MMC"/> <folder name="Images" created="19800101T000000" user-perm="R" mem-type="DEV"/> <folder name="Video clips" created="19800101T000000" user-perm="R" mem-type="DEV"/> <folder name="Music files" created="19800101T000000" user-perm="R" mem-type="DEV"/> <folder name="Themes" created="19800101T000000" user-perm="RW" mem-type="DEV"/> <folder name="Graphics" created="19800101T000000" user-perm="R" mem-type="DEV"/> <folder name="Tones" created="19800101T000000" user-perm="R" mem-type="DEV"/> <folder name="Recordings" created="19800101T000000" user-perm="R" mem-type="DEV"/> </folder-listing> done Disconnecting..-done root@cm-debian:~#
- Transfer a file from CM-T3517 to the phone:
root@cm-debian:~# obexftp -b 00:15:2A:20:63:94 --put test_file.txt Browsing 00:15:2A:20:63:94 ... Connecting..\done Tried to connect for 380ms Sending "test_file.txt"...|done Disconnecting../done root@cm-debian:~#
- Retrieve a file from the phone to CM-T3517:
root@cm-debian:~# obexftp -b 00:15:2A:20:63:94 --get test_file.txt Browsing 00:15:2A:20:63:94 ... Connecting..\done Tried to connect for 267ms Receiving "test_file.txt".../done Disconnecting..-done root@cm-debian:~#
Display options
CM-T3517 evaluation platform has four video output interfaces: LCD, DVI, LVDS and TV-out. Default configuration of Debian Linux for CM-T3517 uses LCD as primary video output. It is possible to switch between the DVI and LCD interfaces on the fly. TV-out can be used simultaneously with LCD or DVI interface.
Linux implementation of the OMAP3 display subsystem is described in detail in Documentation/arm/OMAP/DSS file in the Linux kernel source tree.
Display resolutions
- The Toppoly LCD supplied with CM-T3517 evaluation kit supports 480x640 resolution with 18 bits per color
- DVI output can be configured for standard resolutions using kernel command line parameter omapfb.mode:
- 1024x768 - omapfb.mode=dvi:1024x768-24@60
- 800x600 - omapfb.mode=dvi:800x600-24@60
- 640x480 - omapfb.mode=dvi:640x480-24@60
- TV-out supports PAL and NTSC standards
Examples
- Switch from LCD to DVI
echo 0 > /sys/devices/platform/omapdss/display0/enabled echo "dvi" > /sys/devices/platform/omapdss/manager0/display fbset -fb /dev/fb0 -xres 1024 -yres 768 echo 1 > /sys/devices/platform/omapdss/display1/enabled
- Switch from DVI to LCD
echo 0 > /sys/devices/platform/omapdss/display1/enabled echo "lcd" > /sys/devices/platform/omapdss/manager0/display fbset -fb /dev/fb0 -xres 480 -yres 640 echo 1 > /sys/devices/platform/omapdss/display0/enabled
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 assums that the corresponding pin is set to mux mode 4 and the GPIO 140 is not requested in the Linux kernel. |
Graphics SDK
The CM-T3517 Linux package contains pre-built and ready to run SGX functionality demo programs.
- The SGX configuration script must be run on CM-T3730 before first use:
root@cm-debian:~# /etc/init.d/omap-demo
- The SGX kernel modules must be loaded prior running the demos:
root@cm-debian:~# /etc/init.d/rc.pvr start
Running Graphics SDK OpenGL ES1.x Demos
- To run OpenGL ES1.x demos, perform the following:
root@cm-debian:~# cd /opt/gfxsdkdemos/ogles root@cm-debian:/opt/gfxsdkdemos/ogles# ./OGLESEvilSkull
This will execute the OGLESEvilSkull demo. Press ‘q’ on the CM-T3517 console to stop the demo execution.
Running Graphics SDK OpenGL ES2.0 Demos
- To run OpenGL ES2.x demos, perform the following:
root@cm-debian:~# cd /opt/gfxsdkdemos/ogles2 root@cm-debian:/opt/gfxsdkdemos/ogle2s# ./OGLESFilmTV
This will execute the OGLESFilmTV demo. Press ‘q’ on the CM-T3517 console to stop the demo execution.