NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

OMAP WLAN build instructions on any SDK

From Texas Instruments Wiki
Jump to: navigation, search

Introduction[edit]

This document describes the build procedure of WLAN components to provide wireless capabilities to AM/DM37x| AM18x|OMAP3530|AM/DM814x(Centaurus) evaluation boards. All build instructions regard TI's SDK environment, which comes with Linux kernel PSP having kernel sources and precompiled root file system having all necessary libraries and configuration for initial bootstrap. Each SDK package comes with User Guide to correctly install and build all SDK's components. This documnet assumes that an user has already installed and built all SDK's components, including kernel and target file system.

Build environment[edit]

Host OS[edit]

  • This documnet describes building process on host running Ubuntu 10 Linux distribution. On other Linux distributions the process should be same. In the case results of the used shell commands will not be as expected, please, consult your distribution's documentation to see the differences.
  • Linux distribution must have the following tools:
  • bash - GNU Bourne-Again Shell
  • perl - Practical Extraction and Report Language
  • bison (parser generator compatible with yacc)
  • bc - arbitrary precision calculator language
  • python - interpreted, object-oriented programming language
  • python-m2crypto - Python wrapper for OpenSSL
  • git - control version utility
If you work behaind a proxy, follow the steps below:
1. Ensure the proxy environment variables are exported:
bash# export http_proxy
bash# export https_proxy
bash# export ftp_proxy
bash# export all_proxy
2. Edit your $HOME/.gitconfig file to use 'corcscrew':
[core]
     gitproxy=$HOME/gitproxy.sh
This is necessary since part of the WLAN components are downloaded from GitHub.com which cannot work with proxes.
3. Create $HOME/gitproxy.sh
#!/bin/bash
exec corkscrew proxy-name proxy-port $*
bash# chmod +x $HOME/gitproxy.sh
  • Sourcery G++ Lite 2009q1 tool chain. Follow tool chain's instructions to install Sourcery G++ Lite. This document assumes that the location of the installed Sourcery G++ Lite is /home/user/arm-2009q1/

SDK[edit]

  • Download and install sutable for your board SDK package. This document assumes that SDK was installed under /home/user/SDK location.
  • Each SDK package comes with compressed archive containing precompiled root file system structure and binaries to be run on evaluation board. Extract this archive to some location on your Linux PC, this document assumes /home/user/SDK/targetfs is such location. Export environment variable to point to a location of just extracted root file system:
bash# ~/SDK> export NFSROOT=/home/user/SDK/targetfs
  • Export following environment variables to point to the Linux kernle sources placed inside SDK package:
bash# ~/SDK> export KLIB_BUILD=/home/user/SDK/<kernel build>
bash# ~/SDK> export KLIB=${NFSROOT}

Environment variables[edit]

export CROSS_COMPILE=arm-none-linux-gnueabi-
export ARCH=arm
export PKG_CONFIG_PATH=${NFSROOT}/lib/pkgconfig:${NFSROOT}/usr/lib/pkgconfig
export TOOLCHAIN_PATH=/home/user/arm-2009q1
export PATH=$TOOLCHAIN_PATH/bin:$PATH
export CC=${CROSS_COMPILE}gcc
export AS=${CROSS_COMPILE}as
export AR=${CROSS_COMPILE}ar
export OBJDUMP=${CROSS_COMPILE}objdump
export NM=${CROSS_COMPILE}nm
export RANLIB=${CROSS_COMPILE}ranlib
export STRIP=${CROSS_COMPILE}strip
  • some of the built components use NFSROOT environment variable

Linux kernel[edit]

  • In the kernel build directory under arch/arm/configs find kernel configuration file sutable for your evaluation board (<board>_defconfig)
  • Ensure kernel configuration file has the following switches and add them if neccessary.
  • Run make with the changed <board>_defconfig file:
bash$ linux-2.6.37-psp> make defconfig <board>_defconfig

Examples:
For am37x EVM run

bash$ linux-2.6.37-psp> make defconfig omap3_evm_defconfig

For am335x EVM run

bash$ linux-2.6.37-psp> make defconfig am335x_evm_defconfig

To know exactly what configuration file to use for your board, please consult the documentation comming with the evaluation board package.

Builing Linux kernel with WL12xx support[edit]

  • Download and extract archive containing kernel patches adding WL12xx support for an evaluation board. Please, consult release notes for the board you are working with where the kernel patches can be downloaded.
  • Apply patches by running:
bash# SDK > cd linux-2.6.37-psp
bash# linux-2.6.37-psp > for p in `/bin/ls *.patch`; do patch -p1 -i $p; done

or Manually (example for one patch)

patch -p1 < 0004-added-driver-version.patch

(Stripping trailing CRs from patch.)
patching file drivers/net/wireless/wl12xx/main.c
  • Build kernel image
bash$ linux-2.6.37-psp > make clean
bash$ linux-2.6.37-psp > make
bash$ linux-2.6.37-psp > sudo –E make INSTALL_MOD_PATH=${NFSROOT} INSTALL_PATH=${NFSROOT}/boot install
bash$ linux-2.6.37-psp > sudo –E make INSTALL_MOD_PATH=${NFSROOT} INSTALL_PATH=${NFSROOT}/boot modules_install

It is important to re-install kernel modules each time uImage is rebuilt. Linux kernel modules will be installed under ${INSTALL_MOD_PATH}/lib/modules/KERNELRELEASE/ location. To check kernel release, refer to include/config/kernel.release file placed under kernel build directory.

WLAN components[edit]

WLAN solution consists of the following components, which are all mandotary and have to be installed on the board's Linux environment:

  1. compat-wireless package to compile all necessary kernel drivers
  2. TI utilities
  3. userspace libraries needed to compile WLAN components: Libnl, OpenSSL
  4. WPA-supplicant - utility to manage wireless connection
  5. Hostapd - to set up Soft AP mode of work
  6. iw - tool to manipulate wireless devices and their configuration.
  7. crda - Linux wireless central regulatory domain agent

Compat-wireless[edit]

bash$ compat-wireless> unzip compat-wireless-patches.zip
bash$ compat-wireless> for p in `/bin/ls *.patch`; do patch -p1 -i $p; done
  • Ensure that KLIB_BUILD and KLIB environment variables are set correctly.
  • Configure compat-wireless to build wl12xx family drivers:
bash$ compat-wireless> ./scripts/driver-select wl12xx
  • Build compat-wireless:
bash$ compat-wireless> make
bash$ compat-wireless> sudo -E make install-modules

Note that sudo should be used with -E option to pass all environment variables to root user.

Openssl[edit]

Configure of OpenSSL

bash$ SDK> tar xzf openssl-1.0.0d.tar.gz
bash$ SDK> cd openssl-1.0.0d
  • Unzip this patch and apply it on openssl
bash$ openssl-1.0.0d> patch -p1 < 0001-openssl-1.0.0d-new-target-os-for-configure.patch

The downloaded patch addes new cross compilation target to Configure file.

  • Configure openssl for linux-elf-arm target:
bash$ openssl-1.0.0d> ./Configure --openssldir=${NFSROOT} shared linux-elf-arm
bash$ openssl-1.0.0d> make CC=${CROSS_COMPILE}gcc RANLIB=${CROSS_COMPILE}ranlib
bash$ openssl-1.0.0d> sudo -E make install
  • Update PKG_CONFIG_PATH with the new path to pkgconfig directory containing openssl.pc and libssl.pc:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${NFSROOT}/lib/pkgconfig

For more information about openssl library, please refer to OpenSSL Project home page.

LIBNL - Netlink Protocol Library Suite[edit]

  • Download libnl-2.0 and extract archive file.
  • Change to libnl-2.0 directory and run:
bash$ libnl-2.0> ./configure -–prefix=${NFSROOT} --host=arm-linux
bash$ libnl-2.0> make
bash$ libnl-2.0> sudo -E make install
  • Update PKG_CONFIG_PATH with the new path to pkgconfig directory containing libnl.pc:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${NFSROOT}/lib/pkgconfig

For more information regarding libnl library, please refer to Netlink Protocol Library Suite home page

Building WPA supplicant[edit]

  • Clone following git repository
bash$ SDK> git clone git://w1.fi/srv/git/hostap.git;protocol=git
  • Step inside newly created directory 'hostap' and checkout working directory to specific Commit ID:
bash$ hostap> git checkout 83fa07226debc2f7082b6ccd62dbb1cd47c30472 
  • Download < patches> and apply them to hostap directory
bash$ hostap> unzip hostapd-wpa-supplicant-patches.zip
bash$ hostap> for p in `/bin/ls *.patch`; do patch -p1 -i $p; done
  • The downloaded package builds both wpa_supplicant and hostapd. Go to wpa_supplicant sub directory.
  • Copy following <defconfig> file as .config
  • Open .config and set following defines:
DESTDIR=<target root file system>
LIBS += -L$(DESTDIR)/usr/lib
LIBS_p += -L$(DESTDIR)/usr/lib
CFLAGS += -I$(DESTDIR)/usr/include
  • Run build
bash$ wpa_supplicant> make
bash$ wpa_supplicant> sudo -E make install

For more details regarding the WPA supplicant, please refer to the wpa supplicant home page

Building hostapd[edit]

  • Before building hostapd, wpa_supplicant's build has to be cleaned
bash$ wpa_supplicant> make clean
  • Go to hostapd sub directory of hostap sources. Use the following <defconfig> file as .config.
  • Open .config and change following defines:
DESTDIR=<target rootfs>
LIBS += -L$(DESTDIR)/usr/lib
CFLAGS += -I$(DESTDIR)/usr/include
  • Build and install hosapd binary
bash$  hostapd> make
bash$  hostapd> sudo -E make install

IW[edit]

  • Clone the IW git:
bash$ SDK> git clone git://git.sipsolutions.net/iw.git;protocol=git
  • Point to the specific Commit ID:
bash$ SDK> cd iw-0.9.20
bash$ iw-0.9.20> git reset --hard 0a236ef5f8e4ba7218aac7d0cdacf45673d5b35c
  • Makefile of iw uses PKG_CONFIG and PKG_CONFIG_PATH environment variables to set up correctly compilation flags to compile with libnl. Make ensure that IW is compiled with libnl-2.0. Please refer to Environment Variables section to check PKG_CONFIG_PATH is correct.
  • Run to build and instal IW:
bash$ iw-0.9.20> make DESTDIR=${NFSROOT}
bash$ iw-0.9.20> sudo PATH=$PATH make install

For more details regarding the IW utility, please refer to the IW home page

TI utilities - building the calibrator[edit]

  • Clone the ti-utils git containing the calibrator
bash$ SDK> git clone git://github.com/TI-ECS/ti-utils.git
bash$ SDK> git reset --hard aaffc13e6c804291ac7dcefdcec181c0207ff67a

  • Ensure CROSS_COMPILE and NFSROOT environment variables are set, as described ealier. From the ti-utils git directory run the following commands:
bash$  ti-utils> make
bash$  ti-utils> make install

Ti utilities - firmware and initialization files[edit]

Firmware and initialization files can be found in the ti-utils git downloaded in the previous section.

  • Copy the contents of ti-utils/firmware directory to your root file system under ${NFSROOT}/lib/firmware/ti-connectivity directory.
bash$ ti-utils> sudo -E cp firmware/* ${NFSROOT}/lib/firmware/ti-connectivity 

The files are:

LICENCE 
wl128x-fw-ap.bin 
wl1271-fw-2.bin 
wl128x-fw.bin 
wl1271-fw-ap.bin 
wl128x-fw-multirole-plt.bin 
wl1271-fw-multirole-plt.bin 
wl128x-fw-multirole-roc.bin 
wl1271-fw-multirole-roc.bin 

Comment: some other files may exist, so copy all the fw files

  • Copy the ini files located in ti-utils/ini_files to your root file system under the ${NFSROOT}/lib/firmware/ti-connectivity/ directory.
bash$ ti-utils> sudo -E cp -r ini_files ${NFSROOT}}/lib/firmware/ti-connectivity

The files are:

RFMD_D_E5.ini 
TQS_D_1.0.ini 
TQS_S_2.5.ini
RFMD_S_3.5.ini 
TQS_D_1.7.ini 
TQS_S_2.6.ini

Comment: some other files may exist, so copy all the ini files

CRDA[edit]

bash$  SDK> tar xjf crda-1.1.1.tar.bz2
bash$  crda-1.1.1> export CFLAGS="$CFLAGS -DCONFIG_LIBNL20"
bash$  crda-1.1.1> make all_noverify
bash$  crda-1.1.1> sudo -E DESTDIR=${NFSROOT} make install
bash$  crda-1.1.1> sudo mkdir -p ${NFSROOT}/usr/lib/crda
bash$  crda-1.1.1> sudo cp 2011.04.28-regulatory.bin ${NFSROOT}/usr/lib/crda/regulatory.bin

For more information about Central Regulatory Domain Agent, please refer to CRDA's home page
HomepageIcon.jpgHOME

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article OMAP WLAN build instructions on any SDK here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article OMAP WLAN build instructions on any SDK here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article OMAP WLAN build instructions on any SDK here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article OMAP WLAN build instructions on any SDK here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article OMAP WLAN build instructions on any SDK here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article OMAP WLAN build instructions on any SDK here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article OMAP WLAN build instructions on any SDK here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article OMAP WLAN build instructions on any SDK here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article OMAP WLAN build instructions on any SDK here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity