Difference between revisions of "CL-SOM-AM57x: Linux: Debian"

From Compulab Mediawiki
Jump to: navigation, search
(Using Debian Linux on CM-T54)
 
(Controller–area network (CAN))
Line 58: Line 58:
 
CL-SOM-AM57x evaluation platform has four video output interfaces: HDMI, LCD, DVI, and LVDS.
 
CL-SOM-AM57x evaluation platform has four video output interfaces: HDMI, LCD, DVI, and LVDS.
 
Default configuration of Debian Linux for CL-SOM-AM57x uses HDMI (SB-SOM-AM57x J4 connector) as primary video output.
 
Default configuration of Debian Linux for CL-SOM-AM57x uses HDMI (SB-SOM-AM57x J4 connector) as primary video output.
 +
 +
=== Touchscreen ===
 +
 +
CL-SOM-AM57x Evaluation Kit is equipped with Startek KD050C LCD 800x480 LCD touch panel.
 +
The touchscreen driver is modularized if you use default CL-SOM-AM57x configuration and is loaded by {{filename|udev}} automatically on Linux boot.
 +
If the touchscreen driver is not loaded, the following command will load the touchscreen driver:
 +
 +
<pre>
 +
modprobe ads7846
 +
</pre>
 +
 +
==== 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 [[CL-SOM-AM57x: 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 corners and center in the following order: top-left, top-right, bottom-right, bottom-left, center.
 +
* Create a file {{filename|/usr/share/X11/xorg.conf.d/99-calibration.conf}} and paste there a snippet with the calibration results:
 +
<pre>
 +
root@cm-debian:~# xinput_calibrator
 +
Setting calibration data: 0, 4095, 0, 4095
 +
Calibrating EVDEV driver for "ADS7846 Touchscreen" 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: 289, 3781, 3887, 227
 +
--> 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" "289 3781 3887 227"
 +
Option "SwapAxes" "0"
 +
EndSection
 +
</pre>
 +
 +
=== WiFi ===
 +
CL-SOM-AM57x features 802.11b/g/n wireless connectivity solution, implemented with the TI WiLink 8 WL1801 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:
 +
<pre>
 +
root@cl-debian-armhf:~# lsmod | grep wl
 +
wl18xx                89863  0
 +
wlcore                183512  1 wl18xx
 +
mac80211              606845  2 wl18xx,wlcore
 +
cfg80211              491510  3 mac80211,wl18xx,wlcore
 +
wlcore_sdio            6495  0
 +
</pre>
 +
* {{cmd|iwconfig}} command from {{cmd|wireless-tools}} package can be used to retrieve detailed information about the WiFi interfaces:
 +
<pre>
 +
root@cl-debian-armhf:~# iwconfig wlan0
 +
wlan0    IEEE 802.11abgn  ESSID:off/any 
 +
          Mode:Managed  Access Point: Not-Associated  Tx-Power=0 dBm 
 +
          Retry short limit:7  RTS thr:off  Fragment thr:off
 +
          Encryption key:off
 +
          Power Management:off
 +
</pre>
 +
 +
* Enable WiFi interface
 +
<pre>
 +
root@cl-debian-armhf:~# ifconfig wlan0 up
 +
[  180.395059] wlcore: PHY firmware version: Rev 8.2.0.0.232
 +
[  180.504299] wlcore: firmware booted (Rev 8.9.0.0.48)
 +
</pre>
 +
* Sample WiFi scanning:
 +
<pre>
 +
root@cm-debian:~# iwlist wlan0 scan
 +
</pre>
 +
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.
 +
 +
=== Controller–area network (CAN) ===
 +
The CL-SOM-AM57x features a Dual Controller Area Network (DCAN) Modules integrated into Sitara AM57x SoC. The DCAN 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 DCAN driver and/or Raw CAN protocol compiled as module(s), they must be loaded prior to enabling CAN interface.
 +
 +
* Load Raw CAN protocol module:
 +
<pre>
 +
root@cl-debian-armhf:~# modprobe can-raw
 +
  can: controller area network core (rev 20120528 abi 9)
 +
  NET: Registered protocol family 29
 +
  can: raw protocol (rev 20120528)
 +
</pre>
 +
 +
===== 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:
 +
<pre>
 +
root@cl-debian-armhf:~# ip -V
 +
  ip utility, iproute2-ss140804
 +
</pre>
 +
* Configure the CAN interface bit-rate to 125 Kbits/sec (values of up to 1Mbit/sec are supported):
 +
<pre>
 +
root@cm-debian:~# ip link set can0 type can bitrate 125000
 +
</pre>
 +
 +
* Enable the CAN interface:
 +
<pre>
 +
root@cl-debian-armhf:~# ip link set can0 up
 +
  net can0: c_can_hw_raminit_wait_syscon: time out
 +
  c_can_platform 4ae3c000.can can0: setting BTR=1c09 BRPE=0000
 +
</pre>
 +
 +
===== Send/Receive packets =====
 +
 +
Use {{filename|cansend}} and {{filename|candump}} utilities to send and receive packets via CAN interface.
 +
 +
* Send standard CAN frame (on the first device):
 +
<pre>
 +
root@cl-debian-armhf:~# cansend can0 111#1122334455667788
 +
</pre>
 +
 +
* Send extended CAN frame (on the first device):
 +
<pre>
 +
root@cl-debian-armhf:~# cansend can0 11111111#1122334455667788
 +
</pre>
 +
 +
* Dump all received data frames as well as error frames (on the second device):
 +
<pre>
 +
root@cl-debian-armhf:~# 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
 +
</pre>
  
 
=== MMC/SD ===
 
=== MMC/SD ===

Revision as of 14:06, 8 February 2016

Overview

The example run-time Linux filesystem image for the CompuLab CL-SOM-AM57x System-on-Module / Computer-on-Module is based on Debian 8.2 GNU/Linux Jessie (armhf).

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
  • Apache web server
  • Samba connectivity suite
  • SSH server and client
  • ALSA configuration and usage utilities
  • Bluetooth tools and daemons

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

Using Debian Linux on CL-SOM-AM57x

Connection and Logging In

Use the following username and password to login:

Account with administrative privileges:

cl-debian-armhf login: root
Password: 111111

Regular user account:

cl-debian-armhf login: user	
Password: 111111

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

X Windows system

CompuLab DEMO root filesystem image contains fully featured X server system with Fluxbox window manager. Before starting X server, connect USB mouse and keyboard to the system. You can run X server and Fluxbox window manager by typing startx.

Fluxbox window manager

CL-SOM-AM57x Debian Linux features installed Fluxbox package - a lightweight window manager for the X server 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 CL-SOM-AM57x includes all the information required to use Debian package management utilities. You can use apt-get and dpkg out of the box.

Display options

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

Touchscreen

CL-SOM-AM57x Evaluation Kit is equipped with Startek KD050C LCD 800x480 LCD touch panel. The touchscreen driver is modularized if you use default CL-SOM-AM57x 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

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 corners and center in the following order: top-left, top-right, bottom-right, bottom-left, center.
  • Create a file /usr/share/X11/xorg.conf.d/99-calibration.conf and paste there a snippet with the calibration results:
root@cm-debian:~# xinput_calibrator 
	Setting calibration data: 0, 4095, 0, 4095
Calibrating EVDEV driver for "ADS7846 Touchscreen" 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: 289, 3781, 3887, 227
	--> 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"	"289 3781 3887 227"
	Option	"SwapAxes"	"0"
EndSection

WiFi

CL-SOM-AM57x features 802.11b/g/n wireless connectivity solution, implemented with the TI WiLink 8 WL1801 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:
root@cl-debian-armhf:~# lsmod | grep wl
wl18xx                 89863  0 
wlcore                183512  1 wl18xx
mac80211              606845  2 wl18xx,wlcore
cfg80211              491510  3 mac80211,wl18xx,wlcore
wlcore_sdio             6495  0 
  • iwconfig command from wireless-tools package can be used to retrieve detailed information about the WiFi interfaces:
root@cl-debian-armhf:~# iwconfig wlan0
wlan0     IEEE 802.11abgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
  • Enable WiFi interface
root@cl-debian-armhf:~# ifconfig wlan0 up
[  180.395059] wlcore: PHY firmware version: Rev 8.2.0.0.232
[  180.504299] wlcore: firmware booted (Rev 8.9.0.0.48)
  • Sample WiFi scanning:
root@cm-debian:~# iwlist wlan0 scan

The output will show the list of Access Points and Ad-Hoc cells in range. For more information about connecting to wireless networks and tuning WiFi interfaces refer to “wpa_supplicant” and “wireless-tools” man pages.

Controller–area network (CAN)

The CL-SOM-AM57x features a Dual Controller Area Network (DCAN) Modules integrated into Sitara AM57x SoC. The DCAN 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 DCAN 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@cl-debian-armhf:~# modprobe can-raw
  can: controller area network core (rev 20120528 abi 9)
  NET: Registered protocol family 29
  can: raw protocol (rev 20120528)
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@cl-debian-armhf:~# ip -V
  ip utility, iproute2-ss140804
  • 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
  • Enable the CAN interface:
root@cl-debian-armhf:~# ip link set can0 up
  net can0: c_can_hw_raminit_wait_syscon: time out
  c_can_platform 4ae3c000.can can0: setting BTR=1c09 BRPE=0000
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@cl-debian-armhf:~# cansend can0 111#1122334455667788
  • Send extended CAN frame (on the first device):
root@cl-debian-armhf:~# cansend can0 11111111#1122334455667788
  • Dump all received data frames as well as error frames (on the second device):
root@cl-debian-armhf:~# 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

MMC/SD

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

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

USB 3.0 Dual-Role-Device

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

RTC

To access the RTC time and date run:

root@cm-debian:~# hwclock
Sat Jan 1 00:00:00 2000 -10.011159 seconds

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

root@cm-debian:~# date -s "31 JUL 2015 10:00:00"
Fri Jul 31 10:00:00 UTC 2015
root@cm-debian:~# hwclock -w
root@cm-debian:~# hwclock
Fri Jul 31 10:00:13 2015  -1.066224 seconds

See also