Skip to content
Shawn-HuZJ edited this page Oct 21, 2014 · 101 revisions

Welcome to the Gumstix-YoctoProject-Repo wiki!

This page has been created to catch miscellaneous, yet still time-saving, information about the BSP layer. For an overview, please visit the official software development section

Images

Types of Images

There are 3 different images that you can build with the Gumstix BSP Layer.

Kernel

Versions

Different COMs and SBCs use different Linux kernels

Kernel Configuration Files

Each Gumstix COMs and SBCs has its own Kernel configuration file

Force build/rebuild a package

Bitbake's clean option (eg. bitbake -c clean virtual/kernel) does not completely remove the build data. This is especially true for the boot loader and kernel packages. You can do the following to rebuild these packages:

bitbake -f -c compile virtual/kernel
bitbake -f -c deploy virtual/kernel

Speed up bitbake

By default both tar ball and ubi images (ie. gumstix-test-image-overo.tar.bz2 and gumstix-test-image-overo.ubi) are created. If you don't need the ubi image, you can disable it in the machine configuration file for your build target.

For overo, change meta-gumstix/conf/machine/overo.conf:

from

IMAGES_FSTYPE += "tar.bz2 ubi"

to

IMAGES_FSTYPE += "tar.bz2"

And duovero.conf and pepper.conf for Duovero and Pepper respectively.

Disable GDM (Login Manager)

Comment out the following line in conf/local.conf to take out GDM from image

VIRTUAL-RUNTIME_graphical_init_manager = "gdm"

If you want to temporarily disable GDM while running your image, you can disable the service like this from console:

$ systemctl disable gdm

Useful bitbake commands

# Show _image's_ packages
bitbake -g <image> && cat pn-depends.dot | grep -v -e '-native' | grep -v digraph | grep -v -e '-image' | awk '{print $1}' | sort | uniq

# Check if certain _package_ is present on current Yocto Setup
bitbake -s | grep <pkg>

# List all tasks for _package_
bitbake -c listtasks <package>

# Show versions
#bitbake --show-versions | grep <package>

Adding applications to Gumstix images

You can search for available Linux applications, tools and libraries that can be easily added to the Gumstix Yocto Project images from the Recipe page of OpenEmbedded Layer Index. Edit your gumstix-console-image.bb or gumstix-xfce-image.bb in meta-gumstix-xfce-image/recipes/images/ to add and/or remove recipes.

Default login

You can login as root without password.

Enabling Network Connections

# For Ethernet connection, it's simple:
$ systemctl enable udhcpc@eth0

#For wireless connections, 
# please modify /etc/wpa_supplicant/wpa_supplicant-{mlan0|wlan0}.conf with your SSID and passphrase first before doing the next step.

# Now we can enable the services
# wlan0 for Overo
$ systemctl enable udhcpc@wlan0
$ systemctl enable wpa_supplicant@wlan0

# mlan0 for Duovero and Pepper
$ systemctl enable udhcpc@mlan0
$ systemctl enable wpa_supplicant@mlan0

#reboot

Configure with static IP for Duovero

Please make sure udhcpc@mlan0 is disabled and stopped Create a new Systemd service file in /lib/systemd/system/[email protected].

[Unit]
Description=ifup for %i
Requires=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device

[Service]
ExecStart=/sbin/ifup %i
ExecStop=/sbin/ifdown %i
RemainAfterExit=true

[Install]
Alias=multi-user.target.wants/ifup@%i.service

Then edit /etc/network/interfaces. For example:

allow-hotplug mlan0
iface mlan0 inet static
address 192.168.1.112
netmask 255.255.255.0
broadcast 0.0.0.0

Also edit the /etc/wpa_supplicant/wpa_supplicant-mlan0.conf to reflect your network:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

network={
      ssid="Gumstix Testing"
      key_mgmt=NONE
}

Now you can enable the service:

$ systemctl enable ifup@mlan0

Enabling Bluetooth for Overo

$ systemctl enable bluetooth.service

$ hciattach -s 115200 ttyO1 csr 115200 noflow

$ hcitool scan #should reveal bluetooth devices in the vicinity

Enabling Bluetooth for Duovero

$ systemctl enable bluetooth.service

Using USB-otg port as a serial console port

From Yocto Project 1.5 and on, serial gadget driver is built into the Gumstix Linux kernel. Hence even if your board does not have a dedicated serial console port, you can use an existing USB-otg port for serial communication. Once you connect the USB-otg port of your Gumstix board to one of your computer's USB ports, you should see a new device in /dev. You can check the exact name by running dmesg from your computer's console. Usually the new device has the name of /dev/ttyACM0. Use minicom or kermit to access your Gumstix through this device.

Using USB-otg port on DuoVero as host

Due to the way USB controller is implemented, we have to load a gadget driver for an MUSB port to work as the host mode. There is an extra step for Duovero:

1. As mentioned in my original post, I enabled the "USB gadget driver" 
and "USB OTG support" through menuconfig. 
2. I tried loading the driver at run-time using "modprobe g_serial" ==> 
But no use, device not detected on OTG port. 
3. I loaded the driver at boot time ==> For this, make a file 
"g_serial.conf" in /etc/modules.d/ on target board (duoVero here). 
     Content of the file: 
     g_serial 

     Actually, this specifies the name of driver to be loaded at boot 
time, that is "g_serial" in our case. 
4. Reboot/hard-reset the board with USB device connected on OTG port. 
5. See the results and your device connected using "lsusb" command. 

See original post

Using USB-otg port on Overo as a mass storage device

  1. Build kernel, kernel modules, and a new rootfs with g_mass_storage support. In other words, mark Mass Storage Gadget as M, as a module, in the kernel config, and bitbake a new image.
  2. Deploy the new kernel and rootfs to your uSD card.
  3. You can mount the boot partition of your COM as follow:
    $ modprobe g_mass_storage file=/dev/mmcblk0  
    
  4. On your host machine, your COM should appear as a USB storage device.

For debug tips take a look at here

Using USB-otg port as Ethernet

  1. On the target

    modprobe g_ether
    
  2. On the host

    HOST_USB_IP=10.0.1.1
    sudo ifconfig usb0 $HOST_USB_IP netmask 255.255.255.0
    
  3. On the target

    HOST_USB_IP=10.0.1.1
    TARGET_USB_IP=10.0.1.2
    ifconfig usb0 $TARGET_USB_IP netmask 255.255.255.0
    route add default gw $HOST_USB_IP
    
  4. Test connection from target to host

    ping -c 5 10.0.1.1
    

##Auto login into XFCE LXDM does not adopt to small screens very well. For example, the user selector is not visible on 4.3 inch resistive touch screens available for Overo and Pepper.

You can simply bypass the login screen with this:

/etc/lxdm/lxdm.conf

## uncomment and set autologin username to enable autologin
autologin=gumstix

##Setting time zone The default time zone is UTC (tzdata).

root@duovero:~$  date
Fri May  2 22:24:58 UTC 2014

You can set it to your own time zone like below:

root@duovero:~$    ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime 
root@duovero:~$  date
Fri May  2 15:30:41 PDT 2014

You can also set it during the image creation time. Scott at Jumpnow Technologies has posted this:

... 
set_local_timezone() { 
    ln -sf /usr/share/zoneinfo/EST5EDT ${IMAGE_ROOTFS}/etc/localtime 
} 

ROOTFS_POSTPROCESS_COMMAND += " \ 
    set_local_timezone ; \ 
 " 
root@duovero:~# date 
Mon Apr 14 11:31:52 EDT 2014 

You can append the above in the image recipe.

##Using Duovero Zepher as Wireless Access Point Access point mode can be supported using Duovero Zepher's Wi2Wi 0015 chip. Scott at Jumpnow Technologies has written a thorough article on getting it configured.

##Adding Joystick support

#bitbake -c menuconfig virtual/kernel 
enable input device joystick "*" 
#bitbake -f -c compile virtual/kernel 
#bitbake -f -c deploy virtual/kernel 

/dev/input/js0 is now detected.

##Change Touchscreen Orientation on Pepper To change the orientation of the screen, add the line Option "Rotate" "CCW" in /etc/X11/xorg.conf

         Section "Device"
                   Identifier "Builtin Default fbdev Device 0"
                   Driver  "fbdev"
                   Option "Rotate" "CCW"
         EndSection

Also you will probably want to correct the touch sensor orientation. Add Option "SwapAxes" "true" and Option "InvertX" "true" in /usr/share/X11/xorg.conf.d/10-evdev.conf

         Section "InputClass"
                   Identifier "evdev touchscreen catchall"
                   MatchIsTouchscreen "on"
                   MatchDevicePath "/dev/input/event*"
                   Driver "evdev"
                   Option "SwapAxes" "true"
                   Option "InvertX" "true"
         EndSection

[ref] http://elinux.org/CircuitCo:BeagleBone_LCD7

How to set up python oneline http server on overo board

  1. Boot the board and connet it to the Internet, enable the ethernet by:
ifup eth0

  1. Download runpy.py to the python libiary folder
cd /usr/lib/python2.7/
wget http://svn.python.org/projects/python/trunk/Lib/runpy.py

  1. Goes to the folder of the web server root and type:
python -m SimpleHTTPServer

If the board and your PC are in the same LAN, You should be able to access the folder content by:

http://your.board.ip.address/8000

How to enable python pip tool on overo board

The python-pip is provided through the recipe:

pokey/meta-openembedded/meta-python/recipes-devtools/python/python-pip_1.3.1.bb

We can add the recipe to the image we want to build, for example if we want to build a gumstix-console-image. We can edit

./meta-gumstix-extras/recipes-images/gumstix/gumstix-console-image.bb

Add python-pip to gumstix-console-image.bb

shawn@beech:~/yocto/poky/meta-gumstix-extras/recipes-images/gumstix$ git diff
diff --git a/recipes-images/gumstix/gumstix-console-image.bb b/recipes-images/gumstix/gumstix-
index bfcbde7..f254dd8 100644
--- a/recipes-images/gumstix/gumstix-console-image.bb
+++ b/recipes-images/gumstix/gumstix-console-image.bb
@@ -32,6 +32,7 @@ NETWORK_TOOLS_INSTALL = " \
   iputils \
   iw \
   ntp \
 "
 
 MEDIA_TOOLS_INSTALL = " \
@@ -61,6 +62,7 @@ UTILITIES_INSTALL = " \
   vim \
   wget \
   zip \
+  python-pip \    // I added python-pip here
 "
  
 IMAGE_INSTALL += " \

Now build the gumstix-console-image, flash the sd and enjoy python pip

How to use iperf to test ethernet throughput for duovero

  1. Add iperf to /recipes-images/gumstix/gumstix-console-image.bb
@@ -61,6 +62,7 @@ UTILITIES_INSTALL = " \
   vim \
   wget \
   zip \
+  iperf \    // make iperf to build into the image
 

Build and flash the image.

  1. There is one PC(192.168.0.100) and one duovero board (192.168.0.111) connected to the same LAN Let's set PC as server
iperf -s -P 1 -i 1 -p 5001 -C -f k

On duovero board (192.168.0.111)

iperf -c 192.168.1.100

[More instructions on iperf] (http://openmaniak.com/iperf.php)

We can use jperf on PC side to visualize the testing result [Instructions on jperf] (https://code.google.com/p/xjperf/)

How to connect to a wifi network in duovero

Edit the file in /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

network={
       ssid="your network name"   # You network name
       proto=WPA2                 # try WPA RSN if you WPA2 fails
       key_mgmt=WPA-PSK 
       pairwise=CCMP TKIP
       group=CCMP TKIP
       scan_ssid=1
       psk="your pass word"    #you passwd here
       priority=10
}

Then use command to enable the wlan interface

ifup mlan0

OR you can use

ifconfig mlan0 up
wpa_supplicant  -i mlan0  -c /etc/wpa_supplicant.conf&

How to compile device tree blob(dtb) for duovero in the 3.17 kernel

if the crosscompiler is installed in the kernel source dir type

make  ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- omap4-duovero-parlor.dtb

copy the omap4-duovero-parlor.dtb and zImage to /media/yourname/rootfs/boot folder (not the /boot partition)

reset the borad and go.

Reference

How to boot 3.17.rc7 kernel on Duovero.

  1. Download and crosscompile latest uboot.

Down load the u-boot source from latest git repo

git clone git://git.denx.de/u-boot.git

make sure you have installed ARM cross compilers and compile the u-boot for duovero:

make CROSS_COMPILE=arm-none-linux-gnueabi-

replace the u-boot image in the boot partision.

  1. Download and compile kernel The 3.17.RC7 kernel supports DT(Device tree), we can compile the omap4-duovero-parlor.dtb and put is in the rootfs/boot/ folder. Build the kernel zImage and put it in the rootfs/boot folder as well. To download the kernel
git init
git remote add linus https://github.com/user/repo.git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
git checkout v3.17-rc6

Config the kernel and build

 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- omap2plus_defconfig
 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- EXTRAVERSION=-custom uImage LOADADDR=82000000

The kernel should boot all the way to the consol.

How to connect bluetooth speakphone to Duovero

Duovero has a Marvell bluetooth 3.0 chip which is available on DuoVero™ Zephyr COM. The steps described below maybe usable for USB bluetooth device as well, but it is not tested at the moment. The kernel enviroment is Linux duovero 3.6.11 The following messages from dmesg show the bluetooth driver is properily initialised:

[   25.884857] Bluetooth: Core ver 2.16
[   25.890655] Bluetooth: HCI device and connection manager initialized
[   25.895996] Bluetooth: HCI socket layer initialized
[   25.899719] Bluetooth: L2CAP socket layer initialized
[   25.903686] Bluetooth: SCO socket layer initialized
[   26.083221] Bluetooth: vendor=0x2df, device=0x911a, class=255, fn=2
[   27.388702] Bluetooth: vendor=0x2df, device=0x911b, class=255, fn=3
[   27.892120] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   27.897399] Bluetooth: BNEP filters: protocol multicast

There are three bluetooth utilities be used: hciconfig, hcitool and l2ping

hciconfig is used for local bluetooth device management, some useful hciconfig commands:

hciconfig -a    #list all active bluetooth device
hciconfig hci0 piscan # Set Duovero as a discoverable device
hciconfig hci0 class 010704 # Set Duovero as a car audio device the bluetooth class

hcitool is used for remote bluetooth discovery and connection management, some usefull hcitool commands:

hcitool scan # scan and list current bluetooth device that is visiable

l2ping can be used to test if a device is rechable. The result address of hcitool scan should respond to l2ping request

l2ping XX:XX:XX:XX:XX
  1. Download bluez-4.99.tar.gz source and extract it
wget  http://pkgs.fedoraproject.org/repo/pkgs/bluez/bluez-4.99.tar.gz/570aa10692ed890aa0a4297b37824912/bluez-4.99.tar.gz
tar xvzf bluez-4.99.tar.gz 

There are two useful scripts we can use:

 1). bluez-4.99/test/simple-agent #This is used for pairing a pin for bluetooth device.
 2). bluez-4.99/test/test-audio #This is used for  extabilishing a audio test channel on bluetooth. 

Run the following command to make a connection to bluetooth speakerphone. I used an INSIGNIA bluetooth speakerphone, Mode No:NS-SPBT02-G-C :

bluez-4.99/test/simple-agent hci0 XX:XX:XX:XX:XX:XX #XX:XX:XX:XX:XX:XX is the speakerphone bluetooth address discovered by hcitool scan. First, turn on the speakphone, the LED on speakphone will start to flash blue and red intervalley. This means the device is in pairing mode. Execute the command and the bluetooth agent should be created. You only need to do this once. If there is a notification shows the agent is already created. you can skip this step.

bluez-4.99/test/test-audio connect XX:XX:XX:XX:XX:XX # This will connect Duovero to the speakerphone. The flashing LED will become constant blue once the connection is estabilished.

Write a configure file at ~/.asoundrc, One example of .asoundrc file (Replace xx:xx:xx:xx:xx:xx with the target bluetooth device address):

pcm.bluetooth {
        type bluetooth
        device "xx:xx:xx:xx:xx:xx"    # This should be the target  bluetooth device address
        profile "auto"
}

Change the settings in /etc/bluetooth/audio.conf

The cat command out put of /etc/bluetooth/audio.conf

root@duovero:/etc/bluetooth$  cat audio.conf
# Configuration file for the audio service

# This section contains options which are not specific to any
# particular interface
[General]
Enable=Gateway,Source,Socket  


# Switch to master role for incoming connections (defaults to true)
#Master=true

# If we want to disable support for specific services
# Defaults to supporting all implemented services
#Disable=Gateway,Source,Socket

# SCO routing. Either PCM or HCI (in which case audio is routed to/from ALSA)
# Defaults to HCI
SCORouting=PCM

# Automatically connect both A2DP and HFP/HSP profiles for incoming
# connections. Some headsets that support both profiles will only connect the
# other one automatically so the default setting of true is usually a good
# idea.
AutoConnect=true

# Headset interface specific options (i.e. options which affect how the audio
# service interacts with remote headset devices)
[Headset]

# Set to true to support HFP, false means only HSP is supported
# Defaults to true
HFP=true

# Maximum number of connected HSP/HFP devices per adapter. Defaults to 1
MaxConnected=1

# Set to true to enable use of fast connectable mode (faster page scanning)
# for HFP when incoming call starts. Default settings are restored after
# call is answered or rejected. Page scan interval is much shorter and page
# scan type changed to interlaced. Such allows faster connection initiated
# by a headset.
FastConnectable=false

# Just an example of potential config options for the other interfaces
#[A2DP]
#SBCSources=1
#MPEG12Sources=0

Reboot the board and connect use test-audio py script

bluez-4.99/test/test-audio connect XX:XX:XX:XX:XX:XX 

We can use aplay to play audio on bluetooth device:

aplay -D plug:bluetooth some.wav

if you want to play on the native earphone on Duovero

aplay -D some.wav

./var/lib/bluetooth folder contains current bluethoot paird device trusted device and so on

original post