Difference between revisions of "CM-T43: Linux: Debian"

From Compulab Mediawiki
Jump to: navigation, search
(Display options)
 
(kernel)
Line 31: Line 31:
  
 
=== kernel ===
 
=== kernel ===
* {{filename|zImage-3.19.0-cm-t43-1.bin}} - ready to run Linux kernel version 3.19.0-cm-t43-1 for CM-T43
+
* {{filename|zImage-3.19.0-cm-t43-2.bin}} - ready to run Linux kernel version 3.19.0-cm-t43-2 for CM-T43
* {{filename|modules-3.19.0-cm-t43-1.tar.bz2}} - archive of pre-compiled modules for Linux kernel version 3.19.0-cm-t43-1
+
* {{filename|modules-3.19.0-cm-t43-2.tar.bz2}} - archive of pre-compiled modules for Linux kernel version 3.19.0-cm-t43-2
* {{filename|linux-3.19.0-cm-t43-1.config}} - Linux kernel 3.19.0-cm-t43-1 configuration file
+
* {{filename|linux-3.19.0-cm-t43-2.config}} - Linux kernel 3.19.0-cm-t43-2 configuration file
* {{filename|linux-3.19.0-cm-t43-1.patch}} - patch vs. [http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=bfa76d49576599a4b9f9b7a71f23d73d6dcff735 Linux kernel 3.19] with support for CM-T43 peripherals
+
* {{filename|linux-3.19.0-cm-t43-2.patch}} - patch vs. [http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=bfa76d49576599a4b9f9b7a71f23d73d6dcff735 Linux kernel 3.19] with support for CM-T43 peripherals
* {{filename|patches}} - ordered collection of patches, that form the single patch above ({{filename|linux-3.19.0-cm-t43-1.patch}})
+
* {{filename|patches}} - ordered collection of patches, that form the single patch above ({{filename|linux-3.19.0-cm-t43-2.patch}})
  
 
=== utilities ===
 
=== utilities ===
Line 63: Line 63:
  
 
=== Networking ===
 
=== Networking ===
 +
CM-T43 can operate in two modes: dual MAC mode, or as a 3 port ethernet switch. The default mode of operation is dual MAC mode.
 +
A user guide for both operation modes can be found in the [http://processors.wiki.ti.com/index.php/Linux_Core_CPSW_User%27s_Guide Linux Core CPSW User's Guide] article in the TI wiki.
 
To configure networking, edit {{filename|/etc/network/interfaces}}, {{filename|/etc/resolv.conf}}, {{filename|/etc/hostname}} and {{filename|/etc/hosts}}. For more information about Debian Linux network configuration read [http://www.debian.org/doc/manuals/reference/ch05.en.html Network setup] chapter in the [http://www.debian.org/doc/manuals/reference/index.en.html Debian Reference].
 
To configure networking, edit {{filename|/etc/network/interfaces}}, {{filename|/etc/resolv.conf}}, {{filename|/etc/hostname}} and {{filename|/etc/hosts}}. For more information about Debian Linux network configuration read [http://www.debian.org/doc/manuals/reference/ch05.en.html Network setup] chapter in the [http://www.debian.org/doc/manuals/reference/index.en.html Debian Reference].
 +
 +
==== Switching to 3-port switch mode ====
 +
To enable 3-port switch mode, the device tree blob must be modified to remove the dual_emac property before Linux boots. This can be done using the following U-Boot commands:
 +
<pre>
 +
# fdt addr <address fdt was loaded to>
 +
# fdt rm /ocp/ethernet@4a100000 dual_emac
 +
</pre>
  
 
=== X Windows system ===
 
=== X Windows system ===
Line 92: Line 101:
 
=== Display options ===
 
=== Display options ===
 
CM-T43 evaluation platform has three video output interfaces: LCD, DVI, and LVDS. Default configuration of Debian Linux for CM-T43 uses LCD as primary video output.
 
CM-T43 evaluation platform has three video output interfaces: LCD, DVI, and LVDS. Default configuration of Debian Linux for CM-T43 uses LCD as primary video output.
 +
 +
=== USB Dual-Role-Device ===
 +
 +
CM-T43 has USB DWC3 based controller. It features USB 2.0 Dual-Role-Device (DRD) subsystem with integrated HS/FS (USB2.0) PHY.
 +
CM-T43 DRD port is USB host and USB device (gadget) capable. USB Device Gadget drivers are compiled as modules with default CM-T43 kernel configuration.
 +
Current Linux kernel support of DWC3 features does not allow dynamic role (host/device) switching during runtime. By default, ''host'' role is assigned to CM-T43 DRD port.
 +
 +
Device mode can be enabled by running the following U-Boot commands before boot:
 +
<pre>
 +
# fdt addr <address fdt was loaded to>
 +
# fdt resize
 +
# fdt set /ocp/omap_dwc3@48380000/usb@48390000 dr_mode peripheral
 +
</pre>
 +
 +
==== Testing Device (gadget) mode ====
 +
 +
Default CM-T43 kernel configuration enables {{filename|g_serial}}, {{filename|g_mass_storage}}, {{filename|g_ether}}, {{filename|g_audio}}, and {{filename|g_hid}} gadget drivers.
 +
More gadget drivers can be enabled in the kernel configuration.
 +
 +
* Connect USB OTG micro B-cable (ID pin Float) to P3 USB DRD port of SB-SOM baseboard.
 +
* Connect other side Standard-A connector to Linux Host PC USB Host port.
 +
 +
===== Emulate a serial link =====
 +
 +
* Load gadget driver on CM-T43 Eval board:
 +
<pre>
 +
root@cm-debian:~# modprobe g_serial
 +
[  114.805045] g_serial gadget: Gadget Serial v2.4
 +
[  114.809968] g_serial gadget: g_serial ready
 +
[  115.306074] g_serial gadget: high-speed config #2: CDC ACM config
 +
</pre>
 +
 +
* Ensure the connection is established on the Host PC:
 +
<pre>
 +
user@linux-host:~$ dmesg
 +
...
 +
[72415.607738] cdc_acm 2-1.8.2:2.0: ttyACM0: USB ACM device
 +
[72415.608446] usbcore: registered new interface driver cdc_acm
 +
[72415.608447] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
 +
</pre>
 +
 +
* Receive data on CM-T43 Eval board:
 +
<pre>
 +
root@cm-debian:~# cat /dev/ttyGS0
 +
</pre>
 +
 +
* Send data from Host PC:
 +
<pre>
 +
user@linux-host:~$ echo "Test message" > /dev/ttyACM0
 +
</pre>
 +
 +
=== Bluetooth ===
 +
==== 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.<br>
 +
Make sure that the Bluetooth driver is loaded:
 +
<pre>
 +
root@cm-debian:~# lsmod | grep btmrvl
 +
btmrvl_sdio            14006  0
 +
btmrvl                  9176  1 btmrvl_sdio
 +
bluetooth            282256  22 bnep,btmrvl,btmrvl_sdio
 +
</pre>
 +
 +
* HCI device configuration utility can be run to retrieve detailed information about the Bluetooth interfaces:
 +
<pre>
 +
root@cm-debian:~# hciconfig -a
 +
hci0: Type: BR/EDR  Bus: SDIO
 +
hci0: Type: BR/EDR  Bus: SDIO
 +
BD Address: 80:D2:1D:57:A2:62  ACL MTU: 1021:7  SCO MTU: 120:6
 +
UP RUNNING
 +
RX bytes:976 acl:0 sco:0 events:42 errors:0
 +
TX bytes:1684 acl:0 sco:0 commands:42 errors:0
 +
Features: 0xff 0xfe 0x8f 0xfe 0xdb 0xff 0x7b 0x87
 +
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
 +
Link policy: RSWITCH HOLD SNIFF
 +
Link mode: SLAVE ACCEPT
 +
Name: 'cm-debian'
 +
Class: 0x000000
 +
Service Classes: Unspecified
 +
Device Class: Miscellaneous,
 +
HCI Version: 4.0 (0x6)  Revision: 0x8300
 +
LMP Version: 4.0 (0x6)  Subversion: 0x4270
 +
Manufacturer: Marvell Technology Group Ltd. (72)
 +
</pre>
 +
 +
* If the HCI device is not running, use the below command to enable the HCI device:
 +
<pre>
 +
root@cm-debian:~# hciconfig hci0 up
 +
</pre>
 +
 +
==== ObexFTP transfers ====
 +
 +
* To transfer files between CM-T43 and a remote device, make sure that the remote device supports ObexFTP transfers by running the ObexFTP daemon on the remote device:
 +
<pre>
 +
user@linux-host:~$ obexftpd -b
 +
</pre>
 +
 +
* To send a file from CM-T43 to a target device, run the following command:
 +
<pre>
 +
root@cm-debian:~# obexftp -b <MAC_address_of_device> -p <filename>
 +
</pre>
 +
 +
* To download a file from a target device to CM-T43, run the following command:
 +
<pre>
 +
root@cm-debian:~# obexftp -b <MAC_address_of_device> -g <filename>
 +
</pre>
 +
 +
=== Touchscreen ===
 +
 +
CM-T43 Evaluation Kit is equipped with Startek KD050C LCD 800x480 LCD touch panel.
 +
 +
The X Windows system of CM-T43 uses EVDEV X server input driver to get the input from the touchscreen.
 +
 +
==== Touchscreen calibration ====
 +
A touchscreen device can be calibrated using {{cmd|xinput_calibrator}} utility.
 +
 +
To calibrate the touchscreen:
 +
* Run X Server by issuing {{cmd|startx}} command
 +
* Make sure the touchscreen driver is loaded as described in [[CM-T54: Linux: Debian#Touchscreen|Touchscreen]] section
 +
* Set the {{parameter|DISPLAY}} environment variable:  <pre> export DISPLAY=:0</pre>
 +
* Run {{cmd|xinput_calibrator}} utility. For proper calibration you are required to touch the touchscreen at the displayed markers.
 +
* Create a file {{filename|/usr/share/X11/xorg.conf.d/99-calibration.conf}} and paste there a snippet with the calibration results:
 +
<pre>
 +
xinput_calibrator
 +
Calibrating EVDEV driver for "ti-tsc" id=6
 +
current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095
 +
 +
Doing dynamic recalibration:
 +
Setting calibration data: 105, 3975, 3763, 174
 +
--> 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 "ti-tsc"
 +
Option "Calibration" "105 3975 3763 174"
 +
Option "SwapAxes" "0"
 +
EndSection
 +
</pre>
  
 
== See also ==
 
== See also ==
Line 100: Line 246:
 
* [[Linux: Debian: Minimal ARM filesystem]]
 
* [[Linux: Debian: Minimal ARM filesystem]]
 
* [http://www.debian.org/doc/manuals/reference/index.en.html Debian Reference].
 
* [http://www.debian.org/doc/manuals/reference/index.en.html Debian Reference].
 +
 
[[Category:Linux|Debian]]
 
[[Category:Linux|Debian]]
 
[[Category:CM-T43|Linux: Debian]]
 
[[Category:CM-T43|Linux: Debian]]

Revision as of 17:57, 6 July 2015

Overview

The example run-time Linux filesystem image for the CompuLab CM-T43 System-on-Module / Computer-on-Module is based on Debian GNU/Linux Jessie. The CompuLab Linux package for CM-T43 includes ready to run Linux kernel binary, root filesystem demo image archive, Linux kernel configuration and source code patches.

The default Debian Jessie Linux image includes more than 400 software packages. Among them:

  • Core system
  • Debian package management system
  • X11 Windowing System
  • Fluxbox desktop manager
  • Netsurf browser
  • Samba connectivity suite
  • SSH server and client
  • ALSA configuration and usage utilities
  • Bluetooth 5.0 tools and daemons

The CM-T43: Linux: Getting started page provides a brief introduction on how to install the run-time Linux image.

Package contents

version.txt

The contents of the version.txt identifies the package version.

images

  • zImage-cm-t43 - ready to run Linux kernel image binary for CM-T43
  • am437x-sb-som-t43.dtb - SB-SOM-T43 Device Tree binary
  • debian-image.tar.bz2 - archive of the Debian root file system
  • kernel.img - Kernel image required for installation onto the eMMC
  • ramdisk.img - Ramdisk image required for installation onto the eMMC
  • bootscr.img - U-Boot script used for image installation

kernel

  • zImage-3.19.0-cm-t43-2.bin - ready to run Linux kernel version 3.19.0-cm-t43-2 for CM-T43
  • modules-3.19.0-cm-t43-2.tar.bz2 - archive of pre-compiled modules for Linux kernel version 3.19.0-cm-t43-2
  • linux-3.19.0-cm-t43-2.config - Linux kernel 3.19.0-cm-t43-2 configuration file
  • linux-3.19.0-cm-t43-2.patch - patch vs. Linux kernel 3.19 with support for CM-T43 peripherals
  • patches - ordered collection of patches, that form the single patch above (linux-3.19.0-cm-t43-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 or USB storage device

Using Debian Linux on CM-T43

Connection and Logging In

Use the following username and password to login:

Account with administrative privileges:

cm-debian login: root
Password: 111111

Regular user account:

cm-debian login: user	
Password: 111111

To login into the Linux system, you may use a serial console (ttyO0) at 115200 bps, or connect through the network.

Networking

CM-T43 can operate in two modes: dual MAC mode, or as a 3 port ethernet switch. The default mode of operation is dual MAC mode. A user guide for both operation modes can be found in the Linux Core CPSW User's Guide article in the TI wiki. To configure networking, edit /etc/network/interfaces, /etc/resolv.conf, /etc/hostname and /etc/hosts. For more information about Debian Linux network configuration read Network setup chapter in the Debian Reference.

Switching to 3-port switch mode

To enable 3-port switch mode, the device tree blob must be modified to remove the dual_emac property before Linux boots. This can be done using the following U-Boot commands:

# fdt addr <address fdt was loaded to>
# fdt rm /ocp/ethernet@4a100000 dual_emac

X Windows system

CompuLab Debian Jessie Linux demo image 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.

Fluxbox window manager

CM-T43 Debian Linux features installed Fluxbox package - a lightweight window manager for the X Windowing System.

  • Fluxbox provides configurable window decorations, a root menu to launch applications and a toolbar that shows the current workspace name, a set of application names and the current time. There is also a workspace menu which allows you to add or remove workspaces. The slit can be used to dock small applications, e.g. most of the bbtools can use slit.
  • Fluxbox can iconify windows to the toolbar, in addition to adding the window to the Icons submenu of the workspace menu.

Visit Fluxbox Wiki and Official home page for more details.

Software Management

Debian Linux image for CM-T43 includes all the information required to use Debian package management utilities. You can use apt-get and dpkg out of the box.

MMC/SD

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

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

Display options

CM-T43 evaluation platform has three video output interfaces: LCD, DVI, and LVDS. Default configuration of Debian Linux for CM-T43 uses LCD as primary video output.

USB Dual-Role-Device

CM-T43 has USB DWC3 based controller. It features USB 2.0 Dual-Role-Device (DRD) subsystem with integrated HS/FS (USB2.0) PHY. CM-T43 DRD port is USB host and USB device (gadget) capable. USB Device Gadget drivers are compiled as modules with default CM-T43 kernel configuration. Current Linux kernel support of DWC3 features does not allow dynamic role (host/device) switching during runtime. By default, host role is assigned to CM-T43 DRD port.

Device mode can be enabled by running the following U-Boot commands before boot:

# fdt addr <address fdt was loaded to>
# fdt resize
# fdt set /ocp/omap_dwc3@48380000/usb@48390000 dr_mode peripheral

Testing Device (gadget) mode

Default CM-T43 kernel configuration enables g_serial, g_mass_storage, g_ether, g_audio, and g_hid gadget drivers. More gadget drivers can be enabled in the kernel configuration.

  • Connect USB OTG micro B-cable (ID pin Float) to P3 USB DRD port of SB-SOM baseboard.
  • Connect other side Standard-A connector to Linux Host PC USB Host port.
Emulate a serial link
  • Load gadget driver on CM-T43 Eval board:
root@cm-debian:~# modprobe g_serial
[  114.805045] g_serial gadget: Gadget Serial v2.4
[  114.809968] g_serial gadget: g_serial ready
[  115.306074] g_serial gadget: high-speed config #2: CDC ACM config
  • Ensure the connection is established on the Host PC:
user@linux-host:~$ dmesg
...
[72415.607738] cdc_acm 2-1.8.2:2.0: ttyACM0: USB ACM device
[72415.608446] usbcore: registered new interface driver cdc_acm
[72415.608447] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
  • Receive data on CM-T43 Eval board:
root@cm-debian:~# cat /dev/ttyGS0
  • Send data from Host PC:
user@linux-host:~$ echo "Test message" > /dev/ttyACM0

Bluetooth

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:

root@cm-debian:~# lsmod | grep btmrvl
btmrvl_sdio            14006  0 
btmrvl                  9176  1 btmrvl_sdio
bluetooth             282256  22 bnep,btmrvl,btmrvl_sdio
  • HCI device configuration utility can be run to retrieve detailed information about the Bluetooth interfaces:
root@cm-debian:~# hciconfig -a
hci0:	Type: BR/EDR  Bus: SDIO
	hci0:	Type: BR/EDR  Bus: SDIO
	BD Address: 80:D2:1D:57:A2:62  ACL MTU: 1021:7  SCO MTU: 120:6
	UP RUNNING 
	RX bytes:976 acl:0 sco:0 events:42 errors:0
	TX bytes:1684 acl:0 sco:0 commands:42 errors:0
	Features: 0xff 0xfe 0x8f 0xfe 0xdb 0xff 0x7b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH HOLD SNIFF 
	Link mode: SLAVE ACCEPT 
	Name: 'cm-debian'
	Class: 0x000000
	Service Classes: Unspecified
	Device Class: Miscellaneous, 
	HCI Version: 4.0 (0x6)  Revision: 0x8300
	LMP Version: 4.0 (0x6)  Subversion: 0x4270
	Manufacturer: Marvell Technology Group Ltd. (72)
  • If the HCI device is not running, use the below command to enable the HCI device:
root@cm-debian:~# hciconfig hci0 up

ObexFTP transfers

  • To transfer files between CM-T43 and a remote device, make sure that the remote device supports ObexFTP transfers by running the ObexFTP daemon on the remote device:
user@linux-host:~$ obexftpd -b
  • To send a file from CM-T43 to a target device, run the following command:
root@cm-debian:~# obexftp -b <MAC_address_of_device> -p <filename>
  • To download a file from a target device to CM-T43, run the following command:
root@cm-debian:~# obexftp -b <MAC_address_of_device> -g <filename>

Touchscreen

CM-T43 Evaluation Kit is equipped with Startek KD050C LCD 800x480 LCD touch panel.

The X Windows system of CM-T43 uses EVDEV X server input driver to get the input from the touchscreen.

Touchscreen calibration

A touchscreen device can be calibrated using xinput_calibrator utility.

To calibrate the touchscreen:

  • Run X Server by issuing startx command
  • Make sure the touchscreen driver is loaded as described in Touchscreen section
  • Set the DISPLAY environment variable:
     export DISPLAY=:0
  • Run xinput_calibrator utility. For proper calibration you are required to touch the touchscreen at the displayed markers.
  • Create a file /usr/share/X11/xorg.conf.d/99-calibration.conf and paste there a snippet with the calibration results:
xinput_calibrator 
Calibrating EVDEV driver for "ti-tsc" id=6
	current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095

Doing dynamic recalibration:
	Setting calibration data: 105, 3975, 3763, 174
	--> 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	"ti-tsc"
	Option	"Calibration"	"105 3975 3763 174"
	Option	"SwapAxes"	"0"
EndSection

See also