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.
Using WL18xx with DM365 EVM
Contents
Introduction[edit]
The goal of this exercise was to get WL18xx working with a DM365 EVM. This was intended as a stepping stone, i.e. it does not fully integrate all video functionality, etc. The DM365 EVM has many different configuration options with respect to various headers, CPLD configuration settings, etc. Some of the steps here were deliberately done "quick and dirty" to get things operational. Consider this work as a stepping stone and not a complete product offering.
Hardware used:
- DM365 EVM Rev F
- Jorjin adapter board (COM8 header to MMC)
- WL1837COM8 card
DM365 Board Modifications
- Removed R73 which originally was connecting an output pin from the MSP430 to GIO0 of the DM365.
- Connected the GIO0 pad from R73 to the WLAN_IRQ pin of the WL1837.
- Connected J18 pin 25 (GIO29) to the WLAN_EN pin of the WL1837.
Software used:
- DVSDK 4.02 for DM365 EVM
- http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_4_00/4_02_00_06/index_FDS.html
- Note that this has a dependency on the Sourcery G++ Lite arm2009q1-203 toolchain, though that tool chain no longer appears to be available on the Code Sourcery web page.
- I attempted using the TI Arago tool chain from an AM1808 SDK release but bumped into varoius build errors and had to stay on the Code Sourcery release (unfortunately).
- PSP 3.21 release
- Updates to 2.6.37 kernel
- http://software-dl.ti.com/dsps/dsps_public_sw/psp/LinuxPSP/DaVinci_03_21/03_21_00_04/index_FDS.html
- Kernel Patches: Patches-psp-3.21.tar.gz
- WiLink Build Steps
- WL18xx WiFi Build Process
- WL18xx System Build Scripts -- used R8.5 tag
- WL18xx software patches
Prerequisite Knowledge
- This page assumes you're familiar with things like building u-boot, flashing your own kernel and file system (or using NFS, etc.).
- For help with related Linux questions you might consult this page.
Building the Software[edit]
Kernel[edit]
Install the DVSDK. Note that passing arguments "--help" to the installer will give some additional options. For example, if you're using a more recent version of Ubuntu you'll need the "--forcehost" flag. If you're having trouble with the installer you might try "--mode console" as well.
host$ ./dm365-dvsdk/dvsdk_dm365-evm_4_02_00_06_setuplinux --forcehost
Install PSP 3.21.
host$ tar zxf DaVinci-PSP-SDK-03.21.00.04.tgz -C <dvsdk-root>
Move old psp to psp-old so we don't accidentally use it.
host$ mv psp/ psp-old/
Create your file system. Remove the prebuilt modules from 2.6.32 as we will build new modules to match our 2.6.37 kernel.
host$ cd <dvsdk-root> host$ mkdir wl8-filesystem host$ sudo tar zxf filesystem/dvsdk-dm365-evm-rootfs.tar.gz -C wl8-filesystem/ host$ sudo rm -rf wl8-filesystem/lib/modules/2.6.32.17-davinci1/
At this point the directory structure looks like this:
<dvsdk-root> ├── bin ├── codec-engine_2_26_02_11 ├── codecs-dm365_4_02_00_00 ├── DaVinci-PSP-SDK-03.21.00.04 ├── dm365mm-module_01_00_03 ├── dmai_2_20_00_15 ├── docs ├── dvsdk-demos_4_02_00_01 ├── dvtb_4_20_18 ├── etc ├── example-applications ├── filesystem ├── framework-components_2_26_00_01 ├── gstreamer-ti_svnr919 ├── linux-devkit ├── linuxutils_2_26_01_02 ├── Makefile ├── psp-old ├── Rules.make ├── setup.sh ├── usr ├── wl8-filesystem ├── xdais_6_26_01_03 └── xdctools_3_16_03_36
Untar the Linux source code and initialize as a git tree.
host$ cd <dvsdk-root>/DaVinci-PSP-SDK-03.21.00.04/src/kernel host$ tar zxf linux-03.21.00.04.tar.gz host$ cd linux-03.21.00.04/ host$ git init host$ git add . host$ git commit -m "Initial commit" host$ git checkout -b wl8-integration host$ cd <dvsdk-root>
Edit Rules.make. We need to point to our new components.
host$ gvim Rules.make
Be sure to update the following:
- PSP_INSTALL_DIR=$(DVSDK_INSTALL_DIR)/DaVinci-PSP-SDK-03.21.00.04
- LINUXKERNEL_INSTALL_DIR=$(PSP_INSTALL_DIR)/src/kernel/linux-03.21.00.04
- EXEC_DIR=$(DVSDK_INSTALL_DIR)/wl8-filesystem
CSTOOL_DIR and CSTOOL_PREFIX should already be setup to correctly point to your tool chain by the DVSDK installer.
Apply patches to kernel.
host$ tar zxf Patches-psp-3.21.tar.gz -C <dvsdk-root>/DaVinci-PSP-SDK-03.21.00.04/src/kernel/linux-03.21.00.04/ host$ cd <dvsdk-root>/DaVinci-PSP-SDK-03.21.00.04/src/kernel/linux-03.21.00.04/ host$ git am 00* host$ rm 00*
Build kernel and modules.
host$ cd <dvsdk-root> host$ make linux
Install modules into file system.
host$ sudo make linux_install
WL18xx Software[edit]
In short, you want to follow the directions from WL18xx System Build Scripts:
Clone the repository.
host$ git clone git://git.ti.com/wilink8-wlan/build-utilites.git host$ cd build-utilites/
Edit the path variables.
host$ cp setup-env.sample setup-env host$ vim setup-env
For example:
- TOOLCHAIN_PATH=<path-to-arm-2009q1>/bin
- ROOTFS=<dvsdk-root>/wl8-filesystem
- KERNEL_PATH=<dvsdk-root>/DaVinci-PSP-SDK-03.21.00.04/src/kernel/linux-03.21.00.04/
- CROSS_COMPILE=arm-none-linux-gnueabi-
Download the software.
host$ ./build_wl18xx.sh init R8.5
Note: Do not use the "sudo" version of the script when executing the "init" step or else you will end up with source directories owned by root.
Apply patches to backports.
host$ tar zxf Patches-backports-2.6.37.tar.gz -C <dvsdk-root>/build-utilites/src/backports/ host$ cd <dvsdk-root>/build-utilites/src/backports/ host$ git am 00* host$ rm 00*
Apply patch to iw. I believe this patch is toolchain dependent. It's needed for the CodeSourcery arm-2009q1 toolchain that's expected by the DM365 DVSDK.
host$ tar zxf Patches-iw-2.6.37.tar.gz -C <dvsdk-root>/build-utilites/src/iw/ host$ cd <dvsdk-root>/build-utilites/src/iw/ host$ git am 00* host$ rm 00*
One small fix to the build_wl18xx.sh script... At the end of the build script it verifies that all the necessary files have been properly copied to the file system. However, the string it is looking for is slightly wrong (at least for the arm-2009q1 cross compiler from CodeSourcery). There are 5 places in the file where you need to make the following change:
- "ELF 32-bit LSB executable, ARM" + "ELF 32-bit LSB executable, ARM"
There are two places where you need to make the following change:
- "ELF 32-bit LSB relocatable, ARM" + "ELF 32-bit LSB relocatable, ARM"
Specifically, there are two spaces after "LSB" in the strings.
Build the software.
host$ ./sudo_build_wl18xx.sh
Testing it out[edit]
The first time you boot it up none of the necessary modules will load. The best thing to do is to run:
root@dm365-evm:~# depmod -a root@dm365-evm:~# reboot
Now when it boots you should see the modules load automatically. You should see something like this just before the login prompt:
Loading modules backported from Linux version R8.5-0-gcb51164 Backport generated by backports.git R8.4-2-g3db70cb Root filesystem already rw, not remounting Caching udev devnodes Populating dev cachecfg80211: Calling CRDA to update world regulatory domain cfg80211: World regulatory domain updated: cfg80211: DFS Master region: unset cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), ( dfs_cac_time) cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) cfg80211: (5170000 KHz - 5250000 KHz @ 160000 KHz), (N/A, 2000 mBm), (N/A) cfg80211: (5250000 KHz - 5330000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) NET: Registered protocol family 10 wlcore: ERROR could not get configuration binary ti-connectivity/wl18xx-conf.bin : -2 wlcore: WARNING falling back to default config wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11) wlcore: loaded wlcore: driver version: R8.5 wlcore: compilation time: Mon Jan 5 12:30:22 2015
NOTE: The drivers default to a WL1835 configuration since that's common to all variants. However, it is recommended to generate a wl18xx-conf.bin file for your platform using the wlconf utility. There are scripts (that run on the ARM) and further details available here.
Bring up the wi-fi:
root@dm365-evm:~# ifconfig wlan0 up wlcore: PHY firmware version: Rev 8.2.0.0.224 wlcore: firmware booted (Rev 8.9.0.0.31) ADDRCONF(NETDEV_UP): wlan0: link is not ready
Scan for access points:
root@dm365-evm:~# iw wlan0 scan | grep SSID SSID: BJG SSID: externalhotspot84
To connect to an open access point you can simply do:
root@dm365-evm:~# iw wlan0 connect BJG wlan0: authenticate with f8:d1:11:2c:d1:78 wlan0: send auth to f8:d1:11:2c:d1:78 (try 1/3) wlan0: authenticated wlan0: associate with f8:d1:11:2c:d1:78 (try 1/3) wlan0: RX AssocResp from f8:d1:11:2c:d1:78 (capab=0x421 status=0 aid=1) wlcore: Association completed. ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready wlan0: associated
And to get an IP address:
root@dm365-evm:~# udhcpc -i wlan0 udhcpc (v1.13.2) started Sending discover... Sending select for 192.168.1.101... Lease of 192.168.1.101 obtained, lease time 7200 adding dns 192.168.1.1
You can then use ping, iperf, etc. for further testing.
Other Useful Patches[edit]
Kernel Patches for Bluetooth Support[edit]
These patches were created to sit on top of the WLAN patches:
Bluetooth-kernel-patches.tar.gz
Note: The corresponding stack needs to be acquired from TI personnel (FAE, sales, etc.).
Getting PSP 3.21 to Build with the Other Multimedia Components[edit]
The following set of patches can be used for this section: Psp-3.21-multimedia-related-patches.tar.gz.
Note: These patches have only been been tested to get things to build. They have not been run-time tested.
- Update to linuxutils_2_26_03_06
- Download here: http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/linuxutils/2_26_03_06/index_FDS.html
- Install into your dvsdk directory and change Rules.make to point to the new directory.
- Export the 2.6.37 header files. The DVSDK Rules.make defines this locations as being LINUXLIBS_INSTALL_DIR which is located at <dvsdk-root>/linux-devkit/arm-none-linux-gnueabi/usr. We want to export our 2.6.37 header files to that location.
- cd <dvsdk-root>/DaVinci-PSP-SDK-03.21.00.04/src/kernel/linux-03.21.00.04/
- make headers_install INSTALL_HDR_PATH=<dvsdk-root>/linux-devkit/arm-none-linux-gnueabi/usr
- Change the search path order for dmai so that it searches our LINUXLIBS_INSTALL_DIR for header files before searching the kernel.
- Apply 0001-Search-user-space-headers-first.patch.
- There are a few more errors that you bump into soon after.
- In dmai directory apply the patch 0002-Remove-unneeded-include.patch.
- In the 2.6.37 kernel directory apply patches 0001-Adding-missing-video-formats-back.patch and 0002-Adding-file-from-psp03.01.01.39-needed-for-dmai.patch.
- In the dm365mm directory apply the patch 0001-Add-fixes-to-build-with-2.6.37.patch.
- In the linuxutils_2_26_03_06 directory apply the patch 0001-Update-semaphore-to-avoid-MUTEX_LOCKED-error.patch.