Difference between revisions of "Slackware On Gumstix Overo"

From Gumstix User Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== 20 April 2014 ==
+
== 8 May 2014 ==
  
 
Both Slackware 13.37 and 14.1 have been successfully installed on Gumstix Overo Products, and used for application development, web service and more.
 
Both Slackware 13.37 and 14.1 have been successfully installed on Gumstix Overo Products, and used for application development, web service and more.
Line 53: Line 53:
  
  
=== Building Your Own Kernel ===
+
=== Building Your Own Kernel: ===
  
 
==== Linux 3.5.x Kernel ====
 
==== Linux 3.5.x Kernel ====
Line 105: Line 105:
  
  
=== Installing Slackware ARM Packages On Overo ===
+
=== Installing Slackware ARM Packages On Overo: ===
  
 
Once you have a bootable system, you can use "installpkg", "removepkg" and "pkgtool" to install individual packages.
 
Once you have a bootable system, you can use "installpkg", "removepkg" and "pkgtool" to install individual packages.
Line 121: Line 121:
  
  
=== Devices Tested So Far ===
+
=== Devices Tested So Far: ===
  
 
Below is a short list of devices tested with a Gumstix Overo based system running Slackware:
 
Below is a short list of devices tested with a Gumstix Overo based system running Slackware:
  
==== Caspa Camera Unit / MT9V032 Sensor and Kernel Driver ====
+
 
 +
==== Caspa Camera Unit / MT9V032 Sensor and Kernel Driver: ====
  
  
Line 161: Line 162:
  
  
==== P54USB WiFi ====
+
==== P54USB WiFi: ====
  
 
P54USB WiFi – Prism54 USB Wifi Dongle. Works with HostAPD. 5 Volts Only, works in 2.6, and 3.5 series kernels.
 
P54USB WiFi – Prism54 USB Wifi Dongle. Works with HostAPD. 5 Volts Only, works in 2.6, and 3.5 series kernels.
Line 177: Line 178:
  
  
==== WRL-11713 PCDuino WiFi Dongle ====
+
==== WRL-11713 PCDuino WiFi Dongle: ====
  
 
From SparkFun.com – rt2800usb Works With HostAPD on Overo. Tested with kernel 3.5.7-yocto-standard.
 
From SparkFun.com – rt2800usb Works With HostAPD on Overo. Tested with kernel 3.5.7-yocto-standard.
Line 191: Line 192:
 
Make sure to get the firmware from the [http://www.mediatek.com/en/downloads  MediaTek / Ralink] website.
 
Make sure to get the firmware from the [http://www.mediatek.com/en/downloads  MediaTek / Ralink] website.
  
Tested with 5 Volts and 3.3 Volts.
+
Tested with 5 Volts and 3.6 Volts to validate for use with NiMH, or LiPo Batteries. Works with both.
  
  
==== LIS-331 Accelerometer ====
+
==== LIS-331 Accelerometer: ====
  
 
https://www.sparkfun.com/products/10345   
 
https://www.sparkfun.com/products/10345   
  
LIS-331 Accelerometer. Works with I2C. Typically 3.3 Volts, or 5 Volts with level shifters on SDA/SCL lines.
+
LIS-331 Accelerometer. Works with I2C. Can be tested without Level Shifters on SDA/SCL Lines,
 +
if it is the only device using I2C, but may work intermittently if other devices like the Caspa,
 +
are using I2C, and Level Shifters are not used to set the SDA/SCL lines to 3.3 V. for this Chip.
  
 
Works with i2ctools, from userspace.
 
Works with i2ctools, from userspace.
  
  
==== MPU-6050 Accelerometer ====
+
==== MPU-6050 Accelerometer: ====
  
 
https://www.sparkfun.com/products/11028
 
https://www.sparkfun.com/products/11028
  
MPU-6050 Accelerometer. Works with I2C. Typically 3.3 Volts, or 5 Volts with level shifters on SDA/SCL lines.
+
MPU-6050 Accelerometer. Works with I2C. Can be tested without Level Shifters on SDA/SCL Lines,
 +
if it is the only device using I2C, but may work intermittently if other devices like the Caspa,
 +
are using I2C, and Level Shifters are not used to set the SDA/SCL lines to 3.3 V. for this Chip.
  
 
Works with i2ctools, from userspace.
 
Works with i2ctools, from userspace.
 +
 +
 +
'''See The Sample Script Below.'''
  
 
  #!/bin/bash
 
  #!/bin/bash

Latest revision as of 16:02, 18 May 2014

8 May 2014

Both Slackware 13.37 and 14.1 have been successfully installed on Gumstix Overo Products, and used for application development, web service and more.

The Caspa camera unit is working with kernels 2.6.34, and 3.5.7-yocto-standard.

P54 USB and rt2800usb WiFi devices work in Host Mode with hostapd. WiFi generally works in non-host mode for several devices, including libertas.

This is a preliminary report. How To actually accomplish all of the above will be posted here in this work in progress.

Prerequisites

In order to take full advantage of Slackware on Gumstix, at the current time, you will need to know how to build your own Kernel for Gumstix products, or at least obtain a pre-built one from them, and install it on an SD card. Likewise for the Kernel modules.

You can these from Gumstix web resources, or from the NAND of the device you purchase.

It is assumed that you have experience using Slackware, on some other architecture.

Software will need to be installed using "configure" and "make", but so far lots of software tested installs just fine as such. That information will likewise be posted here.


Basic Installation Strategy:

1) Use a 2.6 series kernel for Slackware 13.37.

2) Use a 3.x Series kernel for Slackware 14.1

3) Set u-boot variables as needed. (console, mmcroot, mmcrootfstype)

4) Modify scripts under /etc/rc.d for fastest boot. This and the Kernel is where most of the changes are made to get Slackware working on Gumstix.

5) Arrange module loading for best stability (mt9v032, Wifi).

6) Re-Compile kernel to meet your particular setup.


Notes:

The Kernel and Modules from Gumstix distros, or that is used in NAND, can be used to boot a Slackware install.

The miniroot that is provided by Slackware works with Gumstix Kernel and Modules.

You can "cross-install" that is, use an x86 based PC to run "installpkg to install Slackware ARM packages to an SD card to be used as the rootfs of your device for most but not all Slackware Packages.

Some Slackware packages run scripts that call binaries that will not work because of CPU mismatch. The Slackware packages that only run shell commands, or just extract the files, do "cross-install" successfully.

You can install Slackware packages when booted into your Gumstix Device, using "installpkg". It works fine. "pkgtool" also works, but may not work when using the miniroot unless a few more packages from the "a" series are installed. 


After Slackware is installed on a Gumstix Overo, it can be used very much like Slackware on any PC. GCC and Make work to install software, you can run Apache, Asterisk, FFMPEG and more.


Building Your Own Kernel:

Linux 3.5.x Kernel

The instructions for building a 3.5 series kernel for Gumstix Overo, using the Yocto Project, are Here:

https://github.com/gumstix/Gumstix-YoctoProject-Repo


An overview of the BitBake Setup for Gumstix is here:

http://gumstix.org/software-development/yocto-project.html


Getting The Kernel Source For Building Custom Kernels on Gumstix Overo:

Use the Yocto Setup explained above. Its not too difficult.

Probably the most important things to know are:

a) Do not use it as root.

b) Make your life easy. Set up a separate user account to build using the yocto project. Yocto relies on a custom-set environment. When a repo is set up in a directory, if the directory name is changed it will break build scripts. Figure out a naming convention to manage multiple “repo” downloads. Running bitbake will notify you of any missing dependencies that you may need to install. They can be installed from source on your build system, or possibly installed form Slackware Packages.

c) Under your build directory is a conf directory where you can place an empty “sanity.conf” file to tell the build system that you passed.


After you run BitBake to build a kernel, the patched kernel source will be under the build directory. The patches themselves will also be there. Look under the build/work directory for various source used. The kernel source that is used to build the kernel can be found under:

build/tmp/sysroots/overo/usr/src/kernel

Look for the kernel's .config file. You can use the source under this directory to cross-compile using your own setup to build bootable kernels like those used in the Gumstix NAND, but with your own customizations.

The kernel source under this directory has the patches from under the build/work directory applied.


Linux 2.6.x Kernel

The instructions for building a 2.6 series kernel for Gumstix can be found here:

http://wiki.gumstix.org/index.php?title=Caspa_camera_boards

Those instructions can be applied to kernel source obtained from Kernel.org, or Gumstix Resources.

The main reason to build a 2.6 kernel is for use with Slackware ARM 13.37, and to take advantage of the kernel from Gumstix above that can be used with the Caspa.

However, Since Slackware ARM 13.37 is now end of life, the focus in these wiki pages will be on Slackware ARM 14.1.


Installing Slackware ARM Packages On Overo:

Once you have a bootable system, you can use "installpkg", "removepkg" and "pkgtool" to install individual packages.

The miniroot currently published does not have all the packages from the "a" series installed. You can manually install the rest.

Packages from the "a", "ap", "d", "l", "n" and "x" sets need to be installed.

Kernel source is obtained as per above, and packages for emacs, faq, KDE Tex, TCL and Games can be installed if you like.

This How To will attempt at least to use the X Windows system, but not with KDE. FVWM and XFCE will be attempted. Best of luck to anyone with KDE.

As you use your Slackware on a Gumstix Overo Based Device to build code natively, you may have to install various library dependencies from source. If there is a Slackware package for the same library, you can uninstall that package with "removepkg" or "pkgtool" then install from the source to get the particular version you like.


Devices Tested So Far:

Below is a short list of devices tested with a Gumstix Overo based system running Slackware:


Caspa Camera Unit / MT9V032 Sensor and Kernel Driver:

Using Caspa With 2.6.34 Kernel

Start with the Gumstix User Wiki page for the Caspa, here:

http://wiki.gumstix.org/index.php?title=Caspa_camera_boards

This setup works with FFMPEG, using /dev/video0.

In order to build the 2.6.34 kernel from source for use with the Caspa, follow the instructions in the Wiki Page above.


Using Caspa With 3.5.x Kernel

Use Yocto per the Gumstix Instructions, or if you have a very recent device from Gumstix, it may have a 3.5.x Kernel in NAND.

The Instructions posted on the various forums regarding using media-ctl do work.

Basically and most important is to understand that /dev/video6 is the device to get your video from, and that its "Pixel Format", or "Color Space" will be what is referred to as "UYVY".

The instructions for using "yavta" also work. "yavta" is simply: "Yet Another Video4linux Test Application".

Yavta will capture an image successfully from the Caspa and save it as a raw UYVY image. FFMPEG can then be used to convert this to other formats. use the "-pix_fmt" option to ffmpeg.

MPlayer also works to play live video. If you are using a graphical desktop, it should work as in any other. You can use the HDMI on a Gumstix Tobi to drive your monitor.

You can also export the display of MPLayer across a network, make sure to export the "DISPLAY" option correctly, and use “xhost +” on your desktop.

MPlayer may show black video the first time it is called for some reason, but it does ultimately display live streaming video.

You may need to set the "LD_PRELOAD" environment variable in the MPLayer command line. See the various forums on the Internet regarding this.


P54USB WiFi:

P54USB WiFi – Prism54 USB Wifi Dongle. Works with HostAPD. 5 Volts Only, works in 2.6, and 3.5 series kernels.

Use this search page for devices that use the Prism 54 USB WiFi Driver

http://wireless.kernel.org/en/users/Devices/USB

Make sure that you have the firmware, though it is usually included in the kernel source.

Make sure that the USB device that you buy is BOTH the correct Model Number, AND Revision. Manufacturers change their chipsets between revisions.


WRL-11713 PCDuino WiFi Dongle:

From SparkFun.com – rt2800usb Works With HostAPD on Overo. Tested with kernel 3.5.7-yocto-standard.

https://www.sparkfun.com/products/11713

The command:

echo '148f 5370' > /sys/bus/usb/drivers/rt2800usb/new_id 

Must be used to bring up the interface.

Make sure to get the firmware from the MediaTek / Ralink website.

Tested with 5 Volts and 3.6 Volts to validate for use with NiMH, or LiPo Batteries. Works with both.


LIS-331 Accelerometer:

https://www.sparkfun.com/products/10345

LIS-331 Accelerometer. Works with I2C. Can be tested without Level Shifters on SDA/SCL Lines, if it is the only device using I2C, but may work intermittently if other devices like the Caspa, are using I2C, and Level Shifters are not used to set the SDA/SCL lines to 3.3 V. for this Chip.

Works with i2ctools, from userspace.


MPU-6050 Accelerometer:

https://www.sparkfun.com/products/11028

MPU-6050 Accelerometer. Works with I2C. Can be tested without Level Shifters on SDA/SCL Lines, if it is the only device using I2C, but may work intermittently if other devices like the Caspa, are using I2C, and Level Shifters are not used to set the SDA/SCL lines to 3.3 V. for this Chip.

Works with i2ctools, from userspace.


See The Sample Script Below.

#!/bin/bash

# Device I2C Bus Addresses
MPU6050_0=0X68
MPU6050_1=0X69

# Initialization Register Address.
PWR_MGMT_1=0x6b

# Initialize Device, Select Z Axis As Clock Signal. (Register Map, p.41)
INIT_SEL_Z_CLOCK=0x02
i2cset -y 3 $MPU6050_0 $PWR_MGMT_1 $INIT_SEL_Z_CLOCK b
i2cset -y 3 $MPU6050_1 $PWR_MGMT_1 $INIT_SEL_Z_CLOCK b

# Set Max Resolution on Accelerometer and Gyro:
i2cset -y 3 0x68 0x1c 0x18 b
i2cset -y 3 0x69 0x1b 0x18 b

# Read Bus:
i2cdetect -y -r 3


# Read Accelerometer 1:
echo "ACCEL_XOUT_H=" `i2cget -y 3 $MPU6050_0 0x3b b`
echo "ACCEL_XOUT_L=" `i2cget -y 3 $MPU6050_0 0x3c b`
echo "ACCEL_YOUT_H=" `i2cget -y 3 $MPU6050_0 0x3d b`
echo "ACCEL_YOUT_L=" `i2cget -y 3 $MPU6050_0 0x3e b`
echo "ACCEL_ZOUT_H=" `i2cget -y 3 $MPU6050_0 0x3f b`
echo "ACCEL_ZOUT_L=" `i2cget -y 3 $MPU6050_0 0x40 b`

# Read Accelerometer 2:
echo "ACCEL_XOUT_H=" `i2cget -y 3 $MPU6050_1 0x3b b`
echo "ACCEL_XOUT_L=" `i2cget -y 3 $MPU6050_1 0x3c b`
echo "ACCEL_YOUT_H=" `i2cget -y 3 $MPU6050_1 0x3d b`
echo "ACCEL_YOUT_L=" `i2cget -y 3 $MPU6050_1 0x3e b`
echo "ACCEL_ZOUT_H=" `i2cget -y 3 $MPU6050_1 0x3f b`
echo "ACCEL_ZOUT_L=" `i2cget -y 3 $MPU6050_1 0x40 b` 


Gumstix publishes its Kernel source here:

http://gumstix.org/access-source-code.html

You can also browse the Gumstix GitHub repo. Look under "meta-gumstix", and "linux".