Overview
There is an experimental branch of the 15.0 NI Linux Real-Time kernel available that provides support for the Silex SX-SDCAN2 radio card. This unsupported kernel brings in upstream patches that enable use of this particular Silex radio, but has not been tested for stability, performance, or determinism. This document will outline the process of building the patched kernel and setting up the wireless radio.
Below is a diagram of the software components that need to be modified to enable wireless with the SX-SDCAN2 or SX-SDMAN2 cards:
Requirements
Kernel Building Steps
Before attempting to build the Linux kernel, you should prepare the target with the needed software. From NI MAX, install LabVIEW Real-Time 2015 and RIO 15.0 to the target. Once the installation is finished, select both Enable Console Out and Enable Secure Shell Server from the System Settings tab in NI MAX. After restarting your target, make sure that you can access its shell directly. Connecting to your target via a serial cable is recommended, as this method provides access to informative boot messages.
The NI Linux Real-Time kernel source is hosted on NI's GitHub repository. For this particular project, you should follow the steps outlined in the KERNEL_SOURCE.txt file with one exception. Instead of checking out the nilrt_pub/15.0/3.14 branch, you should checkout the NILRT_2015_ATH6KL branch. This experimental branch of the kernel source has been patched so that it is compatible with Silex's SX-SDCAN2 and SX-SDMAN2 radios.
Working through the steps published in KERNEL_SOURCE.txt, a Linux build machine is needed. For a Linux Mint machine, the following command will install the needed kernel source building package:
sudo apt-get install build-essential
Once the build successfully completes, you can use SCP or a similar program to transfer the needed files to the target.
After completing the steps provided in the GitHub, you should be able to boot your controller and use the uname -a command to verify the newly built kernel is running. Please note that the newly built kernel will take a very long time boot (while it waits for the firmware to timeout) if you have inserted the SD-CAN2 before adding the required firmware.
Silex Radio Setup
Before physically connecting the SX-SDCAN2 radio, the required firmware must be added to the controller running the newly-built kernel. First, please build the following directory structure: /lib/firmware/ath6k/AR6004/hw3.0 . To access and transfer the firmware, run:
~$ git clone https://github.com/qca/ath6kl-firmware.git
~$ cd ath6kl-firmware/
~/ath6kl-firmware$ scp –r ath6k/AR6004/hw3.0/* admin@<linux_rt_ip>:/lib/firmware/ath6k/AR6004/hw3.0
Additionally, you will need to get a copy of the radio's caldata file. For more information about obtaining a copy of the caldata file, please see the Certification section below. Once you have the firmware and the caldata file on your target, please configure a symbolic link between the caldata file and /lib/firmware/ath6k/AR6004/hw3.0/bdata.bin .
Additionally, select changes to the ni-rt.ini file ensure that the wlan0 interface is accessible after booting. Please add or modify the following section in the ini file:
[wlan0]
radioenabled=“1”
adaptermode=“0”
dhcpserverenabled=“0”
Once the firmware and caldata files have been transferred to the target and the ini file modified, please power off the target. With the power disconnected, insert the SX-SDCAN2 radio into the SD card slot. Once you power on the device, the wlan0 interface will appear in the boot logs (viewable via the serial console) and the wireless interface wlan0 will enumerate with the ifconfig command. To see all of the available networks, run iw wlan0 scan.
To configure the target in client mode, please set the /etc/natinst/share/wpa_supplicant.conf file to match the following and then run the wpa_cli reconfigure command:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=ni
fast_reauth=0
update_config=1
network={
ssid="test"
scan_ssid=1
key_mgmt=NONE
auth_alg=OPEN
}
Similarly, to set the radio to access point mode, please set the /etc/natinst/share/wpa_supplicant.conf file to match the following and then run the wpa_cli reconfigure command. Please note that access point mode does not include a DHCP server.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=ni
fast_reauth=0
update_config=1
network={
ssid=“test_ap"
scan_ssid=1
key_mgmt=NONE
auth_alg=OPEN
mode=2
frequency=2412
}
Certification
To get access to the Silex caldata file, please contact Silex via their online support form. Note that in order to sell wireless-capable devices, certification may be required in the country of sale; please contact Silex for additional information concerning certification.
Support
Please comment below if you encounter a problem building, configuring, or using this kernel, or if you have suggestions for a future revision. Do not call or email National Instruments for support concerning this custom kernel.
National Instruments does not support kernels other than the one officially provided by National Instruments. Any kernel other than what is provided by National Instruments may not have the same performance, determinism, features, or basic functionality.
National Instruments does not support this code or guarantee its quality in any way. THIS EXAMPLE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).