1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > 【实践驱动开发3-002】TI WL1835MODCOM8 在android的移植 - 软件获取

【实践驱动开发3-002】TI WL1835MODCOM8 在android的移植 - 软件获取

时间:2022-05-07 07:16:52

相关推荐

【实践驱动开发3-002】TI WL1835MODCOM8 在android的移植 - 软件获取

继续上一篇,我们还是要找到能减少改动最小的一个SDK驱动包。TI 给出的SDK是基于am3355的,所以,改动是必须的,

这里把大部分SDK相关的东西该为灰色。

在软件包里面的发表说明里面有关于软件的版本说明:

WiLink8 Release Notes

http://processors./index.php/WiLink8_Release_Notes/R8.3SP1

General Information

Release Notes Document:

WLAN IP WL18xx R8.3 SP1

Product Components

Release Highlights

This service pack includes all features included in R8.3 release with additional bug fixes.

Stability and robustness fixesPHY Improvements.

Release Quality

This is a Beta release.

Solved Issues

HW/System Limitation

SW Limitations

AP/P2P SISO40 in 2.4GHz is not supported, due to missing components in the implementation required to meet specification requirements.

Release Components and Sources

Platform and Kernel information

This release was developed and tested on the following HW/SW platform:

Linux Kernel: Kernel 3.8 (with "device-tree" support) /Device_Trees

EVM: TI AM335x EVM Rev 1.2

Note:Information regarding the kernel used in the development of this release, as well as patches that were needed in order to adapt the Wilink SW to the "Device-Tree" mechanism in the kernel can be found in Appendix I - Kernel and Kernel-Patches.

WLAN SW componentswith Linux Kernel 3.8 ("device-tree" support)

The WLAN codebase can be found in github, according to the following specification:

WL18xx WLAN R8.3 SP1 SW Manifest Repository: TI-OpenLink.Git tag:ol_r8.a8.10Relevant components covered by this tag: /TI-OpenLink//TI-OpenLink//TI-OpenLink//TI-OpenLink/compat-/TI-OpenLink/18xx-ti-/TI-OpenLink/wl18xx_fw.git (***)/TI-OpenLink/wl12xx_target_scripts.git

Hostap configuration files: There are 3 configuration files for the hostap package: hostapd.conf, p2p_supplicant.conf and wpa_supplicant.confThis release modifies the default parameters of these configuration-files for optimizing operation and meeting the release requirements. It is important to use the same configuration files that were used during TI development and testing in order to achieve the same behavior and performance.These updated configuration files are currently managed outside of the original code-base. They can be found in this location (using the same git-tag mentioned above):

/TI-OpenLink/wl12xx_target_scripts.git (under "conf" folder.)

(***)Note:The WLAN Firmware Binary file-name is required to be "wl18xx-fw-2.bin".

For Legacy SDK6.0 Kernel 3.2 support:

To build the driver with kernel 3.2 please use tag:ol_r8.a8.10_32

On these repositories:

/TI-OpenLink/wl18xx.git

/TI-OpenLink/compat-wireless.git

Evaluation Pre-Builds provided for legacy SDK6.0 (kernel 3.2)boot, rootfs

For Kernel 3.8 support

Please refer to the following page:R8.3SP1_kernel_3.8

Testing

Testing/Coverage limitations

This release was not integrated into a formal AM335x SDK. Therefore there WiFi operation was not tested with GUI (all testing done using command-line tools).SW was not tested with recent TELEC changesFor full testing results please contact your TI representative.

WiFI Pre-Certification Test Status

WL18xx WiFi Build Process

http://processors./index.php/WL18xx_WiFi_Build_Process

1 Introduction

This page will walk you through how to do the following:

Configure and build your host environmentConfigure and compile the PSP Linux kernel for support of the WL18xx.Use the system build scripts to update functions and drivers.

This page assumes that you are familiar with the process of configuring and compiling the kernel.

2 Building the Host Environment

2.1 Securing a Host OS

This section describes the building process for a host running Ubuntu 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: libglib2.0-dev (version 2.32 and later) - general-purpose C library used by projects such as GTK+ and GNOMElibdbus-glib-1-dev - simple interprocess messaging system (GLib interface), this package provides a GLib-style interface to D-Bus.bash - GNU Bourne-Again Shellautoconf and automake - automatic configure script and Makefile builderlibtool - generic library supportperl - Practical Extraction and Report Languagegettext - support for internalizationpatch - utility to apply code patchesbison - parser generator compatible with yaccflex - generates programs that perform pattern-matching on textbc - arbitrary precision calculator languagepython - interpreted, object-oriented programming languagepython-m2crypto - Python wrapper for OpenSSLpython-dev - Python header filespython-2.7-devgit - control version utilitycorkscrew - tunnel TCP connections through HTTP proxiesu-boot-tools - This package includes the mkimage program, which allows generation of U-Boot images in various formats.

On Ubuntu Linux distribution use apt-get command to install each of the specified packages, for example:sudo apt-get install perl

In case working behaind a proxy, several steps should be apply, this is necessary since part of the WLAN components are downloaded from which cannot work with proxy. follow the steps below: 1. Ensure the proxy environment variables are exported:

export http_proxy=<http proxy name>:<http proxy port>export https_proxy=<https proxy name>:<https proxy port>export ftp_proxy=<ftp proxy name>:<ftp proxy port>export all_proxy=<all proxy name>:<all proxy port>

2. Edit your.gitconfig file (located in the HOME directory, like "/home/user/") to use 'corcscrew':

user@ubt1004:~$ cat .gitconfig[user][core]gitproxy = none for gitproxy = /home/user/bin/git-proxy-corcscrew-script.sh[color][gui][sendemail]

For more information about GIT version control system, please check GIT's User Manual. 3. Create git-proxy-corcscrew-script.sh (in that example in folder /home/user/bin/), where corkscrew script is shell script containing the following command:

#!/bin/bashexec corkscrew <proxy-name> <proxy-port> $*

4. modify the script permissions to executable mode

chmod +x /home/user/bin/git-proxy-corcscrew-script.sh

If your host build environment is 64 bit you should have all libraries and headers of standard C library for 32 bits. For example, for Ubuntu 12.4 64 bits install following packages:

sudo apt-get install ia32-libssudo apt-get install ia32-libs-multiarch

This is required the cross compile to work properly.

Download the SDK (source code and file system)

The following example assumes AM335x SDK releaseSDK can be downloaded from <AM335x SDK Release Download Page> choose specific platform (that example is for AM335x platform) and inside download 2 files: AM335x SDK PSP Source Code - PSP including Kernel source codeAM335x SDK prebuilt PSP binaries and root filesystem - filesystem (SD Card images) Download and install suitable for your board SDK package. This document assumes that SDK was installed under/home/user/SDKlocation.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/targetfsis such location. Export environment variable to point to a location of just extracted root file system:

bash# ~/SDK> export ROOTFS=/home/user/SDK/targetfs

Export following environment variables to point to the Linux kernel sources placed inside SDK package:

export KLIB_BUILD=/home/bvijay/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11<kernel build>

For example, download "ti-sdk-am335x-evm-06.00.00.00-Linux-x86-Install" and change the permission if required to run the installer.

Please refer to the Sitara_Linux_Software_Developer’s_Guide on how to use the installer

SDK Directory Structure Overview

这里是移植的参考,为各个目录文件的位置做设想,当然依旧是SDK AM335XSitara

The Sitara Linux SDK contains the following top-level directories and files

These directories contain the code and tools used to develop forSitaradevices.

bin- Contains the helper scripts for configuring the host system and target device. Most of these scripts are used by the setup.sh script.board-support- Contains the SDK components that need to be modified when porting to a custom platform. This includes the kernel and boot loaders as well as any out of tree drivers.docs- Contains various SDK documentation such as the software manifest and additional user's guide. This is also the location where you can find thetrainingdirectory with the device training materials.example-applications- Contains the sources for the TI provided example applications seen during the out-of-box demonstration.filesystem- Contains the reference file systems. These include the smaller base file system as well as the full-featured SDK file system.host-tools- Contains the host side tools such as pinmux and flash tool.linux-devkit- Contains the cross-compile toolchain and libraries to speed development for the target device.Graphics_SDK_setuplinux_<version>.bin - This is the installer for the graphics SDK. The graphics SDK components are used by the Sitara Linux SDK to provide additional demos as well as integrated with the pre-built Qt libraries to accelerate various Qt functions.Makefile- Provides build targets for many of the SDK components from the top-level of the SDK.Rules.make- Sets default values used by the top-level Makefile as well as sub-component Makefilessetup.sh- Configures the users host system as well as the target system for development

bvijay@ulx0112741:~/ti-sdk-am335x-evm-06.00.00.00$ cd board-support/linux-3.2.0-psp04.06.00.11/bvijay@ulx0112741:~/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11/$ lsarch firmware kernel READMEusrblock fs libREPORTING-BUGS virtCOPYING include MAINTAINERS samplesCREDITS init Makefilescriptscrypto ipc mmsecurityDocumentation Kbuild netsounddrivers Kconfig patchestoolsbvijay@ulx0112741:~/ti-sdk-am335x-evm-06.00.00.00$

Root file system file name is arago-base-tisdk-image-am335x-evm.tar.gz

Following is the instruction how to extract it:

bvijay@ulx0112741:~/AM335x/rootFS$ lsarago-base-tisdk-image-am335x-evm.tar.gzbvijay@ulx0112741:~/AM335x/rootFS$

bvijay@ulx0112741:~/ti-sdk-am335x-evm-06.00.00.00$ tar xzf arago-base-tisdk-image-am335x-evm.tar.gz -C AM335x/rootFS/

user@ubt1004:~/AM335x/rootFS$ lsprocbin sbinboot srvdev sysetc tisdk-rootfs-am335x-evm.tar.gzhome tmplib u-boot-am335x-evm.imglinuxrc uImage-am335x-evm.binmedia usrMLO-am335x-evm varmnt wwwoptuser@ubt1004:~/AM335x/rootFS$

There is a need for sudo permission to extract the dev directory, therefore additional extraction operation needed to extract the dev directory.

user@ubt1004:~/AM335x/rootFS$ sudo tar xzf tisdk-rootfs-am335x-evm.tar.gz dev

in that example the environment variables will be as follows:

export ROOTFS=/home/user/AM335x/rootFSexport KLIB_BUILD=/home/bvijay/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11export CROSS_COMPILE="arm-linux-gnueabihf-"export PATH=$PATH:"Path to Cross Compiler"export WORK_SPACE = "path where wlan components needs to be downloaded"

Building the Kernel

Environment variables - for building kernel

export CROSS_COMPILE=arm-linux-gnueabihf-export ARCH=armexport TOOLCHAIN_PATH="Cross compiler tool chain path"If you are not sure where the tool chain is installed run "locate arm-linux-gnueabihf-" it will show the complete pathexport PATH=$PATH:$TOOLCHAIN_PATH/binexport CC=${CROSS_COMPILE}gccexport AS=${CROSS_COMPILE}asexport AR=${CROSS_COMPILE}arexport OBJDUMP=${CROSS_COMPILE}objdumpexport STRIP=${CROSS_COMPILE}strip

Creating configuration file (.config) for Linux kernel

It is often easiest to start with a base default configuration and then customize it for you use case if needed. In the Linux kernel a command of the form:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- <config>

will look in the arch/arm/configs directory for the configuration file (<config> in the line above) use that file to set default configuration options. The table below shows the default configuration files for various platforms.

Note:The configuration file used to build the pre-built binaries found in the SDK can be found in the arch/arm/configs directory as tisdk_<device>_config and can be used in place of the config file given below to reproduce the SDK Linux kernel configuration settings. The differences between these files generally revolve around enabing/disabling additional modules for expected SDK use cases.

For example, to build the default PSP configuration for the AM335x the command would be:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_evm_defconfig

To build the SDK configuration for the AM335x the command would be:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig

After the configuration step has run the full configuration file is saved to the root of the kernel tree as .config. Any further configuration changes are based on this file until it is cleanup up by doing a kernel clean as mentioned above.

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

Ensure kernel configuration file (.config file) includes the following options and add them if neccessary.

The following switches should be enabled in your kernel defconfig file in order to work with full WLAN and Bluetooth support

Note:As we are using compat-wireless and compat-bluetooth packages, most of the mac80211 and bluetooth related switches are bot needed in the kernel.configfile.

Note:CONFIG_REGULATOR_FIXED_VOLTAGE=y for AM37x platform and not needed for AM18x and AM335x platforms.

Make sure that the following build kernel options are disabled in the .config file in order to disable the Kernel support of WLAN BT , so the Kernel modules for WLAN BT will be provided from the Compat wireless components and not from the Kernel distribution itself.

CONFIG_BT=NCONFIG_CFG80211=NCONFIG_MAC80211=N

In addition make sure that the following build kernel options are enabled in the .config file

## Network testing## MAC 80211 CONFIG_WLAN=yCONFIG_WIRELESS=yCONFIG_WIRELESS_EXT=yCONFIG_WL12XX_PLATFORM_DATA=yCONFIG_KEYS=yCONFIG_SECURITY=yCONFIG_CRYPTO=yCONFIG_WIRELESS_EXT=yCONFIG_CRYPTO_ARC4=yCONFIG_CRYPTO_ECB=yCONFIG_CRYPTO_AES=yCONFIG_CRYPTO_MICHAEL_MIC=yCONFIG_RFKILL=yCONFIG_REGULATOR_FIXED_VOLTAGE=yCONFIG_CRC7=y# The following are needed for soft APCONFIG_NETFILTER=yCONFIG_NETFILTER_ADVANCED=yCONFIG_NF_CONNTRACK=yCONFIG_NETFILTER_XTABLES=yCONFIG_NF_DEFRAG_IPV4=yCONFIG_NF_CONNTRACK_IPV4=yCONFIG_NF_CONNTRACK_PROC_COMPAT=yCONFIG_IP_NF_IPTABLES=yCONFIG_IP_NF_FILTER=yCONFIG_IP_NF_TARGET_LOG=yCONFIG_NF_NAT=yCONFIG_NF_NAT_NEEDED=yCONFIG_IP_NF_TARGET_MASQUERADE=yCONFIG_INPUT_UINPUT=y# Enable Ethernet-WLAN BridgeCONFIG_NETFILTER=yCONFIG_NETFILTER_ADVANCED=yCONFIG_BRIDGE_NETFILTER=yCONFIG_STP=yCONFIG_BRIDGE=yCONFIG_BRIDGE_IGMP_SNOOPING=yCONFIG_LLC=yCONFIG_INPUT_UINPUT=yCONFIG_HAS_IOMEM=yCONFIG_HAS_IOPORT=yCONFIG_HAS_DMA=yCONFIG_NLATTR=yCONFIG_AVERAGE=y

There are 2 option to perform that

Edit the .config file and update the kernel switches, or add them at the end of the .config fileuse script to modify the .config file

use of script to modify the .config file

the script name is wlan_enable_config.sh which comes as part of the zip file, script can be found in herein the kernel path run:

./wlan_enable_config.sh .config

which will modify the .config with the right kernel switches

Note:In case there are missing kernel switches like CONFIG_WL12XX_PLATFORM_DATA, then there probably is a missing part in the kernel that relates to the WL127x chipset, and patches should be applied.

Compile the Kernel

Compile and create uImage by "make uImage" command.In case there are Questions for kernel options, press "ENTER" to have all the default setting. the reason is due to the new kernel options added to the configuration file (.config).The uImage will be located on Linux directory under /arch/arm/boot, for example: /home/user/AM335x/PSP/linux-3.2.0-psp04.06.00.08.sdk/arch/arm/boot

System Build Scripts (Up to R8.3 SP1)

The build script located in github and can be cloned as follows:

user@ubuntu:~$ mkdir utilityuser@ubuntu:~$ cd utilityuser@ubuntu:~/utility$ git clone git:///TI-ECS/build-utilites.gitCloning into 'build-utilites'...remote: Counting objects: 223, done.remote: Compressing objects: 100% (176/176), done.remote: Total 223 (delta 115), reused 145 (delta 40)Receiving objects: 100% (223/223), 78.98 KiB | 61 KiB/s, done.Resolving deltas: 100% (115/115), done.user@ubuntu:~/utility$ lsbuild-utilitesuser@ubuntu:~/utility$ cd build-utilites/user@ubuntu:~/utility/build-utilites$ lsfunctions scripts wl12xx_build.shpatches setup-env.sample wl18xx_build_bt.sh wl18xx_build_ble.sh wl18xx_build.shREADMEwl12xx_build_bt.sh wlan_enable_config.shuser@ubuntu:~/utility/build-utilites$

Set tag to build R8.3SP1, there are two possible tags depending upon kernel version.To build with a 3.2 kernel (as in AM335x SDK 6.0) use

git reset --hard ol_r8.a8.10_32

and to build with any other kernel use

git reset --hard ol_r8.a8.10

There are 2 Build scripts:

wl18xx_build.sh - Build the WLANwl18xx_build_bt.sh - Build the Bluetooth (Bluez 4.98)

in addition there 2 folders:

functions - holds build script of all the mutual components that are shared by the BT and WLAN, such that it will easier to maintain same components versions.scripts - holds scripts that are used for BT, BLE , they will be installed by the build scripts in the filesystem

Build script Enviroment file

“setup-env.sample” file is used as base of “setup-env” that includes user specific environment variables.

User should copy the setup-env.sample to setup-env and edit the variables according to user specific environment

Typical file will be as follows:

# User specific environment settingsexport CROSS_COMPILE="arm-linux-gnueabihf-"export PATH="$PATH:"Path to cross compiler tool chain path"export ROOTFS="/home/user/AM335x/RootFS"export WORK_SPACE="/home/user/AM335x/work_space_R8_A8_10_32"export KLIB_BUILD="/home/user/AM335x/PSP/linux-3.2.0-psp04.06.00.11"# MACHINE_TYPE - The target machine type. Can have one of the following values: "am1808" , "omap3evm" , "am335x"# This is needed to build bluetooth components.# This parameter is not relevant for ti814x board.export MACHINE_TYPE="am335x"export BUILD_VERSION="r8"#===========================================================export ARCH="arm"export MY_PREFIX="/usr"export MY_SYSCONFDIR="/etc"export MY_LOCALSTATEDIR="/var"export CC="${CROSS_COMPILE}gcc"export CXX="${CROSS_COMPILE}g++"export AR="${CROSS_COMPILE}ar"export RANLIB="${CROSS_COMPILE}ranlib"export CFLAGS="${CFLAGS} -I${ROOTFS}${MY_PREFIX}/include"export CPPFLAGS="${CFLAGS}"export LDFLAGS="${LDFLAGS} -L${ROOTFS}${MY_PREFIX}/lib"export PKG_CONFIG_SYSROOT_DIR=${ROOTFS}export PKG_CONFIG_PATH="${ROOTFS}${MY_PREFIX}/lib/pkgconfig:${ROOTFS}/lib/pkgconfig"export PKG_CONFIG_LIBDIR=""export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=""export PKG_CONFIG_ALLOW_SYSTEM_LIBS=""

The main settings user should provide are:

ROOTFS - path to target root file systemPATH - add to the PATH environment variable toolchain path (after "$PATH:").KLIB_BUILD - Path to the kernel sourcesCROSS_COMPILE - the begin part of cross compiler executable name, for example "arm-none-linux-gnueabi-"WORK_SPACE - Work directory for download and build process

setup-envfile should to be placed in the same directory together with build scripts (wl18xx_build.sh,wl18xx_build_bt.sh etc.).

Building WLAN - wl18xx_build.sh file

This script compiles one of following utilities: libnl, openssl, hostapd, wpa_supplicant,wl12xx_modules,firmware,crda,callibrator by calling specific utility name and action.

./wl18xx_build.sh <module name> <download|build|install>

were available "module name" is

libnlopenssliwhostapwpa_supplicantcrdati-utilswl18xx-firmwarecompat-wirelesswlconf

examples:

./wl18xx_build.sh all./wl18xx_build.sh compat-wireless build./wl18xx_build.sh clean-all

If root file system requires root privileges add sudo before the script, for example:

sudo ./wl18xx_build.sh all

Building WLAN - wl18xx_build AMXXX SDK7.0

WL18xx AMxxx Platform Integration Guide

System Build Scripts (R8.4 and above)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。