Microchip Technology ATWILC1000 User manual

Category
Networking
Type
User manual

This manual is also suitable for

ATWILC1000/ATWILC3000
Wi-Fi® Link Controller Linux® User Guide
Introduction
This user guide describes how to run Wi-Fi on the ATWILC1000 SD card or the ATWILC3000 Shield
board on the SAMA5D4 Xplained Ultra running with the Linux
®
kernel 4.9.
Note:  All references to the ATWILC module includes all the devices listed below unless otherwise noted:
ATWILC1000
ATWILC3000
The source codes are maintained on GitHub. For latest source codes, see GitHub Linux for ATWILC at
https://github.com/linux4wilc.
Figure 1. ATWILC1000 SD Card and ATWILC3000 Shield Board
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 1
Table of Contents
Introduction......................................................................................................................1
1. Prerequisites..............................................................................................................4
2. Building Linux for SAMA5D4 Xplained Ultra Board................................................... 5
2.1. Cloning a Kernel Source and Root File System........................................................................... 5
2.2. Loading SAMA5D4 Configuration File..........................................................................................5
2.3. Buildroot File System and Linux Kernel....................................................................................... 5
2.4. Building Linux Kernel Individually.................................................................................................6
3. Updating Binary and System Image into the Target Board........................................7
4. Updating ATWILC Firmware...................................................................................... 9
4.1. ATWILC1000 and ATWILC3000 Driver Modules..........................................................................9
4.2. ATWILC1000 and ATWILC3000 Firmware Binaries.....................................................................9
5. Running ATWILC..................................................................................................... 10
5.1. Accessing the Console...............................................................................................................10
5.2. Recognizing ATWILC1000..........................................................................................................11
5.3. Recognizing ATWILC3000......................................................................................................... 12
5.4. Modifying Configuration Files..................................................................................................... 14
5.5. Running in the ATWILC Station Mode........................................................................................16
5.6. Running in the ATWILC AP Mode.............................................................................................. 18
5.7. Running in the ATWILC P2P Mode............................................................................................ 18
5.8. Supported Modes with Concurrency.......................................................................................... 20
5.9. Powersave .................................................................................................................................22
5.10. Antenna Switching......................................................................................................................23
5.11. Debug Logs ...............................................................................................................................25
5.12. Miscellaneous Linux Topics........................................................................................................25
5.13. Running ATWILC3000 in Bluetooth Mode..................................................................................28
6. Document Revision History..................................................................................... 33
The Microchip Web Site................................................................................................ 34
Customer Change Notification Service..........................................................................34
Customer Support......................................................................................................... 34
Microchip Devices Code Protection Feature................................................................. 34
Legal Notice...................................................................................................................35
Trademarks................................................................................................................... 35
Quality Management System Certified by DNV.............................................................36
ATWILC1000/ATWILC3000
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 2
Worldwide Sales and Service........................................................................................37
ATWILC1000/ATWILC3000
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 3
1. Prerequisites
The build prerequisite for Linux is a host PC with Linux operating system. The hardware prerequisites are
the following:
Linux
SAMA5D4 Xplained Ultra
ATWILC1000 SD Pro card
ATWILC3000 Shield board
USB to Serial adapter (for DEBUG port)
Common
Micro-USB cable (Micro-A/Micro-B)
To avoid modifying kernel code, mount the resistor R312 with an approximate value of 120k Ohm in the
location shown below on the ATWILC3000 Shield board.
ATWILC1000/ATWILC3000
Prerequisites
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 4
2. Building Linux for SAMA5D4 Xplained Ultra Board
This section describes how to build the root file system and kernel image to use for ATWILC devices
demo.
This user guide describes general information on the AT91Bootstrap and U-Boot information. For more
details on the AT91Bootstrap and U-Boot, see U-Boot of Linux & Open Source related information for
AT91 Smart ARM Microcontrollers.
2.1 Cloning a Kernel Source and Root File System
The demo uses buildroot to get the suitable toolchain, root file system, and Linux kernel.
The buildroot is cloned from linux4wilc github at the following address:
$ git clone https://github.com/linux4wilc/buildroot4wilc.git
The buildroot is cloned at the following path in the current directory:
\buildroot4wilc
The current buildroot4wilc is copied from buildroot's repository at git://git.buildroot.net/
buildroot, branch 2017_08, modified with WILC config files (configs/sama5_wilc_defconfig),
and other config files that help run WILC examples.
2.2 Loading SAMA5D4 Configuration File
Use the predefined defconfig file to create the required .config configuration file. This defconfig
file is available in configs folder of the buildroot folder buildroot4wilc.
For SAMA5D4, the sama5_wilc_defconfig defconfig file is used.
To build the root file system for SAMA5D4 with Linux kernel 4.9 for the ATWILC board, browse to the
directory where the files are extracted and create the .config file, using the following commands:
$ cd buildroot4wilc
$ make sama5_wilc_defconfig
2.3 Buildroot File System and Linux Kernel
Start the build operation using $ make command from the buildroot directory.
This $ make command displays the build status on the terminal.
Note:  Ensure that the host PC is connected to the internet before starting the build operation and do not
use any build options.
The rootfs.ubi file is generated in the buildroot/output/images directory when the build
operation is complete. The default build will include the WILC modules in the rootfs.ubi.
The driver source files are located at: https://github.com/linux4wilc/linux-at91/tree/
master/drivers/staging/wilc1000 in the linux-at91 kernel.
Note:  The driver directory name is wilc1000 for legacy reasons only. The driver supports both
ATWILC1000 and ATWILC3000.
ATWILC1000/ATWILC3000
Building Linux for SAMA5D4 Xplained Ultra ...
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 5
2.4 Building Linux Kernel Individually
Buildroot downloads the Linux kernel as per the buildroot configuration file from GitHub. The downloaded
kernel must be available in the buildroot4wilc/output/build/linux-xxxx path, and is built
automatically during the buildroot build operation.
However, if the kernel is modified after building the buildroot, the user must rebuild the kernel. The
following is the procedure to build the Linux kernel against the toolchain and ARM architecture:
1. Change the directory to the Linux kernel source folder, using the following command:
$ cd output/build/linux-xx
2. Create the kernel with the help of sama5_defconfig defconfig file, using the following command:
$ make ARCH=arm sama5_defconfig
3. Perform the required changes using the menuconfig tool, using the following command:
$ make ARCH=arm menuconfig
4. Build the Linux kernel against the toolchain and ARM architecture, using the following commands:
$ make ARCH=arm CROSS_COMPILE=../../../output/host/opt/ext-toolchain/bin/arm-linux-
gnueabihf-
$ make ARCH=arm CROSS_COMPILE=../../../output/host/opt/ext-toolchain/bin/arm-linux-
gnueabihf- zImage
$ make ARCH=arm CROSS_COMPILE=../../../output/host/opt/ext-toolchain/bin/arm-linux-
gnueabihf- dtbs
ATWILC1000/ATWILC3000
Building Linux for SAMA5D4 Xplained Ultra ...
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 6
3. Updating Binary and System Image into the Target Board
This section describes how to update or flash the system image. The pre-build images include pre-build
driver and firmware binaries, which are available at GitHub.
The SAM-BA
®
tool is used to flash the binaries into the target board.
Note:  Ensure that the SAM-BA tool is installed in the host machine before updating the system image.
The scripts in the demo package can use either SAM-BA 2.16 or 3.2.x depending on the download script
the user selects in step 5 of the following procedure.
For additional information, refer to the following:
Software Tools
SAMA5D4 Xplained Board
ATSAMA5D44 Microprocessor
To start flashing, perform the following steps:
1. Download the pre-built images from https://github.com/linux4wilc/wilc_demo.
2. Unzip the downloaded file.
3. Once the new image is built as described in Chapter 2, Building Linux for SAMA5D4 Xplained Ultra
Board, these files must be copied from the buildroot\output\images directory to the directory
where the demo_linux_nandflash.tcl file is available.
Figure 3-1. List of Files in buildroot\output\images Location
4. Add the jumper at JP7 and connect to the host PC via the USB port at J11. Ensure that the host
machine completes the USB serial port connection and then remove the jumper at JP7. The
following figure shows the SAMA5D4 adapter connections.
ATWILC1000/ATWILC3000
Updating Binary and System Image into the ...
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 7
Figure 3-2. SAMA5D4 Adapter Connections
5. Execute the demo_linux_nandflash.bat (for Windows
®
) file or the
demo_linux_nandflash.sh (for Linux) file.
Note: 
By default, the demo_linux_nandflash.sh file has sam-ba binary for 32-bit operating
system. For 64-bit operating system, change the sam-ba to sam-ba_64 in the same file.
Execute the script in the super user mode. If sam-ba 3.2 is installed, use
demo_linux_nandflash_3_2.bat or demo_linux_nandflash_3_2.sh instead.
The output log can be viewed via J1 serial port.
Open the serial terminal on PC via the COM port, with the following configurations:
115200 baud rate
8-bit data
No parity
One stop bit
No flow control
6. Successful download of the system image into the board is indicated by a log file, which opens
automatically. This log file contains all the download process history.
ATWILC1000/ATWILC3000
Updating Binary and System Image into the ...
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 8
4. Updating ATWILC Firmware
This chapter describes how to update the ATWILC firmware or driver on the demo image.
4.1 ATWILC1000 and ATWILC3000 Driver Modules
After the system boots, add the ATWILC driver modules wilc-sdio.ko, or wilc-spi.ko to /lib/
modules/4.9.xx-XX/kernel/drivers/staging/wilc1000/ directory or copy to any location on
the file system.
4.2 ATWILC1000 and ATWILC3000 Firmware Binaries
1. Add the ATWILC1000 firmware wilc1000_wifi_firmware.bin to the /lib/firmware/
mchp/ directory.
2. Add the ATWILC3000 Wi-Fi firmware, wilc3000_wifi_firmware.bin to the/lib/firmware/
mchp/ directory.
3. Add the ATWILC3000 Bluetooth
®
firmware, wilc3000_ble_firmware.bin to the wilc/lib/
firmware/mchp/ directory.
Note:  The firmware is available at https://github.com/linux4wilc/firmware.
The files can be transferred into the SAMA5D4 platform using any of the following methods:
Ethernet
ZMODEM
4.2.1 Adding Files Using Ethernet
The Local Area Network (LAN)/ Wide Area Network (WAN) can be used to transfer the file from one
machine to another machine, using the following command:
$ scp [path of file to send] root@[receiver's IP]:[target directory]
For example, the following command sends the wilc1000_wifi_firmware.bin file from the binary
directory to the /lib/firmware/mchp directory of the device using the internal IP address
192.168.0.11.
$ scp binary/wilc1000_wifi_firmware.bin [email protected]: /lib/firmware/mchp
4.2.2 Adding Files Using ZMODEM
The ZMODEM file transfer protocol also can be used to transfer the files.
In Teraterm, change the target location directory using the following command:
$ cd Target_location
Execute the ZMODEM command using the following command:
$ rz
In Teraterm, from the File menu, choose Transfer > Send, then browse and select the desired file.
ATWILC1000/ATWILC3000
Updating ATWILC Firmware
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 9
5. Running ATWILC
This chapter describes how to use the ATWILC1000 and ATWILC3000 on the SAMA5D4 Xplained Board
or any similar Linux platform.
5.1 Accessing the Console
The user can access the serial console through the on board serial-to-USB converter. In fact, the
Embedded Debugger (EDBG) chip on the evaluation kit acts as a serial-to-USB converter and is loaded
with a firmware that can communicate via USB-CDC protocol.
To enable EDBG, open JP1 and connect the USB cable to the board (J20 EDBG-USB).
5.1.1 For Microsoft Windows Users
Install USB drivers for Atmel and Segger tools. Then, identify the USB connection that is established. The
user can verify this by checking if the EDBG virtual COM port appears in the Device Manager. The
COMxx number is used to configure the terminal emulator.
5.1.2 For Linux Users
Identify the USB connection by monitoring the last lines of dmesg command. The /dev/ttyACMx
number is used to configure the terminal emulator.
The following is the USB debug port connection:
[172677.700868] usb 2-1.4.4: new full-speed USB device number 31 using ehci-pci
[172677.792677] usb 2-1.4.4: not running at top speed; connect to a high speed hub
[172677.793418] usb 2-1.4.4: New USB device found, idVendor=03eb, idProduct=6124
[172677.793424] usb 2-1.4.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[172677.793897] cdc_acm 2-1.4.4:1.0: This device cannot do calls on its own. It is not a
modem.
[172677.793924] cdc_acm 2-1.4.4:1.0: ttyACM0: USB ACM device
The identifiers idVendor=03eb, and idProduct=6124 indicate the device as the evaluation kit board with
USB connection.
Now, use the terminal emulator with appropriate terminal settings (see Table 5-1) to communicate with
the SAMA5D4 adapter.
5.1.3 Serial Communication Parameters
The serial communication parameters are as follows:
Table 5-1. Serial Port Settings
Function Settings
Baud rate 115200
Data 8-bit
Parity None
Stop 1-bit
Flow control None
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 10
5.2 Recognizing ATWILC1000
The following section describes the SD express board and Serial Peripheral Interface (SPI) board
connections.
5.2.1 SD Express Board
Before performing the boot-up operation, ensure that the ATWILC1000 SD Express board is connected in
the SD slot (J24) of the SAMA5D4 Xplained board (see following figure).
Figure 5-1. SAMA5D4 SD Connection
The Secure Digital Input/Output (SDIO) Express card is recognized during boot-up with the following
lines.
mmc0: new high speed SDIO card at address 0001
Use the following commands to load the ATWILC1000 module SDIO driver.
Welcome to Buildroot
buildroot login: root
[root@buildroot ~]# insmod wilc.ko
wilc: module is from the staging directory, the quality is unknown, you have been warned.
[root@buildroot ~]# insmod wilc-sdio.ko
wilc_sdio: module is from the staging directory, the quality is unknown, you have been
warned.
linux_sdio_probe init_power =0
wilc_sdio mmc0:0001:1:Driver Initializing success
Note:  Do not panic upon receiving the following message while loading the module:
wilc: module is from the staging directory, the quality is unknown, you have
been warned
This is the default message for all the drivers in kernel staging directory.
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 11
5.2.2 Serial Peripheral Interface Board
The ATWILC1000 Serial Peripheral Interface (SPI) board must be connected to SPI1 interface at J17 as
shown in the following figure.
Figure 5-2. SAMA5D4 SPI Connection
Table 5-2. SPI Pin Descriptions
SPI Pins Header J17 Pins
MOSI PIN11
CLK PIN13
MISO PIN12
CS PIN10
IRQ PIN8
Note:  VEXT pin in the SPI card can be connected to 3V3 pin in the header J6. Re-configure to build the
driver in SPI mode with the WILC_SPI option in the kernel menuconfig. The modules wilc.ko and
wilc-spi.ko need to be loaded for the ATWILC1000 SPI driver.
5.3 Recognizing ATWILC3000
The following section describes the SDIO shield board and SPI shield board connections.
5.3.1 SDIO Shield Board
Before performing the boot-up operation, ensure that the ATWILC3000 Shield board is connected to the
Shield Arduino Shield Stacking Connector of the SAMA5D4 Xplained adapter.
Load the Wi-Fi SDIO driver module using the following command:
[root@buildroot ~]# insmod wilc.ko
wilc: module is from the staging directory, the quality is unknown, you have been warned.
[root@buildroot ~]# insmod wilc-sdio.ko
wilc_sdio: module is from the staging directory, the quality is unknown, you have been warned.
linux_sdio_probe init_power =0
wilc_sdio mmc0:0001:1: Driver Initializing success
Note:  Do not panic upon receiving the following message while loading the module:
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 12
wilc: module is from the staging directory, the quality is unknown, you have
been warned
This is the default message for all the drivers in kernel staging directory.
5.3.2 Serial Peripheral Interface Shield Board
The ATWILC3000 Shield boards can operate using both SDIO and SPI, and are configured by installing
or removing 0 Ohm resistors. By default, the boards are preconfigured for SDIO mode.
To switch to the SPI mode, the user must change the following resistors as shown in the following
illustration.
Figure 5-3. ATWILC3000 Shield Board Configured for SPI
The resistors marked in green arrows must be connected and those marked in red arrows must be
removed.
Table 5-3. SPI Resistor Configuration
Resistors to be Removed Resistors to be Connected
R311 R310
R218 R214
R219 R215
R220 R216
R221 R217
1. Load the Wi-Fi SDIO driver module, using the following command:
# modprobe wilc-spi
wilc_spi: module is from the staging directory, the quality is unknown, you have been
warned.
WILC_SPI spi32765.0: spiModalias: wilc_spi, spiMax-Speed: 48000000
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 13
(unnamed net_device) (uninitialized): INFO [wilc_create_wiphy]Registering wifi device
(unnamed net_device) (uninitialized): INFO [WILC_WFI_CfgAlloc]Allocating wireless device
(unnamed net_device) (uninitialized): INFO [wilc_create_wiphy]Successful Registering
(unnamed net_device) (uninitialized): INFO [wilc_create_wiphy]Registering wifi device
(unnamed net_device) (uninitialized): INFO [WILC_WFI_CfgAlloc]Allocating wireless device
(unnamed net_device) (uninitialized): INFO [wilc_create_wiphy]Successful Registering
WILC_SPI spi32765.0: WILC got 60 for gpio_reset
WILC_SPI spi32765.0: WILC got 94 for gpio_chip_en
WILC_SPI spi32765.0: WILC got 91 for gpio_irq
wifi_pm : 0
wifi_pm : 1
WILC_SPI spi32765.0: WILC SPI probe success
# ifconfig wlan0 up
WILC_SPI spi32765.0 wlan0: INFO [wilc_mac_open]MAC OPEN[d477d800] wlan0
WILC POWER UP
WILC_SPI spi32765.0 wlan0: INFO [wilc_init_host_int]Host[d477d800][d477cc00]
WILC_SPI spi32765.0 wlan0: INFO [wilc_mac_open]*** re-init ***
WILC_SPI spi32765.0 wlan0: INFO [wlan_init_locks]Initializing Locks ...
WILC_SPI spi32765.0 wlan0: INFO [wilc_wlan_init]Initializing WILC_Wlan ...
WILC_SPI spi32765.0 wlan0: INFO [init_chip]Bootrom sts = c
WILC_SPI spi32765.0 wlan0: INFO [wilc_wlan_initialize]WILC Initialization done
WILC_SPI spi32765.0 wlan0: INFO [init_irq]IRQ request succeeded IRQ-NUM= 137 on GPIO: 91
WILC_SPI spi32765.0 wlan0: INFO [wlan_initialize_threads]Initializing Threads ...
WILC_SPI spi32765.0 wlan0: INFO [wlan_initialize_threads]Creating kthread for
transmission
WILC_SPI spi32765.0 wlan0: INFO [wlan_initialize_threads]Creating kthread for Debugging
WILC_SPI spi32765.0 wlan0: INFO [wilc_wlan_get_firmware]Detect chip WILC3000
WILC_SPI spi32765.0 wlan0: INFO [wilc_wlan_get_firmware]loading firmware mchp/
wilc3000_wifi_firmware.bin
WILC_SPI spi32765.0 wlan0: INFO [wilc_wlan_get_firmware]WLAN firmware: mchp/
wilc3000_wifi_firmware.bin
WILC_SPI spi32765.0 wlan0: INFO [wilc_firmware_download]Downloading Firmware ...
WILC_SPI spi32765.0 wlan0: INFO [wilc_wlan_firmware_download]Downloading firmware size =
137172
WILC_SPI spi32765.0 wlan0: INFO [wilc_wlan_firmware_download]Offset = 120228
WILC_SPI spi32765.0 wlan0: INFO [wilc_wlan_firmware_download]Offset = 137172
WILC_SPI spi32765.0 wlan0: INFO [wilc_firmware_download]Download Succeeded
WILC_SPI spi32765.0 wlan0: INFO [linux_wlan_start_firmware]Starting Firmware ...
WILC_SPI spi32765.0 wlan0: INFO [linux_wlan_start_firmware]Waiting for Firmware to get
ready ...
WILC_SPI spi32765.0 wlan0: INFO [linux_wlan_start_firmware]Firmware successfully started
WILC_SPI spi32765.0 wlan0: INFO [wilc_wlan_initialize]WILC Firmware Ver =
WILC_WIFI_FW_REL_15_00_RC4 Build: 9153
[root@buildroot ~]#
5.4 Modifying Configuration Files
To use the Wi-Fi module, the user must load a set of default configuration files on the prebuilt image.
These files can be modified as per the requirement described in the following section.
5.4.1 Wi-Fi Protected Access Supplicant
The reference configuration files for Wi-Fi Protected Access (WPA) supplicant are available in: /etc/
directory. The configuration files for both Station and Access Point modes are available in the demo
prebuilt image.
5.4.1.1 Station Mode
The configuration file for Station mode wilc_wpa_supplicant.conf contains the following lines.
ctrl_interface=/var/run/wpa_supplicant
update_config=1
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 14
5.4.1.2 Access Point Open Security Mode
The Access Point (AP) mode configuration file with open security wilc_hostapd_open.conf contains
the following lines.
interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ssid=wilc1000_SoftAP
dtim_period=2
beacon_int=100
channel=7
hw_mode=g
max_num_sta=8
ap_max_inactivity=300
5.4.1.3 Access Point Wired Equivalent Privacy Security Mode
The AP mode configuration file for Wired Equivalent Privacy (WEP) Security wilc_hostapd_wep.conf
contains the following lines.
interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ssid=wilc1000_SoftAP
dtim_period=2
beacon_int=100
channel=7
hw_mode=g
max_num_sta=8
ap_max_inactivity=300
ieee80211n=1
auth_algs=1
######### WEP ###########
wep_default_key=0
wep_key0=1234567890
wep_key1="vwxyz"
wep_key2=0102030405060708090a0b0c0d
wep_key3=".2.4.6.8.0.23"
wep_key_len_broadcast=5
wep_key_len_unicast=5
wep_rekey_period=300
5.4.1.4 WPA Security Mode
The AP mode configuration file with WPA security wilc_hostapd_wpa.conf contains the following
lines.
interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ssid=wilc1000_SoftAP
dtim_period=2
beacon_int=100
channel=7
hw_mode=g
max_num_sta=8
ap_max_inactivity=300
ieee80211n=1
auth_algs=1
######### WPA/WPA2 ###########
wpa=3
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 15
5.4.2 Dynamic Host Configuration Protocol
The reference configuration file for the Dynamic Host Configuration Protocol (DHCP) server is available in
the /etc/dhcp/dhcpd.conf file.
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option domain-name-servers 168.126.63.1, 164.124.101.2; # DNS Server IP
option domain-name “sample.example”; # domain name
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.110; # range ip
option broadcast-address 192.168.0.255;
option routers 192.168.0.1; # gateway ip
}
Log-facility local7;
Note:  Each value must be modified as per the test environment.
The location of the dhcpd.conf file should match the location defined in /etc/init.d/S80dhcp-
server under: test -f /etc/dhcp/dhcpd.conf || exit 0.
5.4.3 radvd
For IPv6, the radvd configuration file is required. The reference file on the demo image is available in
the /etc/radvd.conf directory.
interface wlan0
{
AdvSendAdvert on;
prefix 2001:db8:0:2::/64
{
};
};
5.5 Running in the ATWILC Station Mode
The following example shows how to run the ATWILC device in Station mode, and connect to an AP.
1. Initialize the ATWILC1000 and ATWILC3000 driver module, using the following command:
Welcome to Buildroot
buildroot login: root
root@buildroot ~]# modprobe wilc-sdio
wilc_sdio: module is from the staging directory, the quality is unknown, you have been
warned.
linux_sdio_probe init_power =0
wilc_sdio mmc0:0001:1: Driver Initializing success
2. Start the WPA supplicant service and execute wpa_supplicant, using the following command:
# wpa_supplicant -iwlan0 -Dnl80211 -c /etc/wilc_wpa_supplicant
[1] 819
[root@buildroot ~]# Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL cwnirllcd1v0c00_sdio mmc0:0001:1: chipid (001003a0)
wilc_sdio mmc0:0001:1: has_thrpt_enh3 = 1...
wilc_sdio mmc0:0001:1 wlan0: Detect chip wilc1000
wilc_sdio mmc0:0001:1 wlan0: loading firmware wilc_wifi_firmware.bin
wilc_gnrl_async_info_received
wilc_sdio mmc0:0001:1 wlan0: WILC Firmware Ver = WILC_WIFI_FW_REL_15_00 Build: 8719
3. Connect to the Access Point:
3.1. To connect to an unsecured AP:
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 16
Use the following commands to scan and connect to the AP.
# wpa_cli -p/var/run/wpa_supplicant ap_scan 1
# wpa_cli -p/var/run/wpa_supplicant add_network
# wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid '"User_AP"'
# wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE
# wpa_cli -p/var/run/wpa_supplicant select_network 0
Note:  Change the User_AP with the Service Set Identifier (SSID) of the desired AP.
3.2. To connect to the WPA secured Access Point:
Use the following commands to scan and connect to a WPA or WPA2 and Temporal Key
Integrity Protocol (TKIP) or Advanced Encryption Standard (AES) protected AP.
# wpa_cli -p/var/run/wpa_supplicant ap_scan 1
# wpa_cli -p/var/run/wpa_supplicant add_network
# wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid '"User_AP"'
# wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt WPA-PSK
# wpa_cli -p/var/run/wpa_supplicant set_network 0 psk '"12345678"'
# wpa_cli -p/var/run/wpa_supplicant select_network 0
Note:  Change the User_AP and 12345678 with the SSID and password of desired AP.
3.3. To connect to the WEP secured Access Point:
Use the following commands to scan and connect to a WEP shared key protected AP.
#wpa_cli –p/var/run/wpa_supplicant ap_scan 1
#wpa_cli –p/var/run/wpa_supplicant add_network
#wpa_cli –p/var/run/wpa_supplicant set_network 0 ssid ‘“User_AP”’
#wpa_cli –p/var/run/wpa_supplicant set_network 0 key_mgmt NONE
#wpa_cli -iwlan0 -p/var/run/wpa_supplicant set_network 0 wep_key0 1234567890
#wpa_cli –p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0
#wpa_cli –p/var/run/wpa_supplicant set_network 0 auth_alg SHARED
#wpa_cli –p/var/run/wpa_supplicant select_network 0
Note:  Change the User_AP and 12345 with the Service Set Identifier (SSID) and ASCII
(or Hex) of desired AP.
3.4. Connect to the WPS secured Access Point Trigger WPS Push-Button mode, using the
following command:
wpa_cli wps_pbc
(or) to connect using PIN method, use the following command:
sudo wpa_cli wps_pin any <the pin>
4. Run the DHCP service.
If the IP address can be allocated from the AP automatically, start the DHCP client, using the
following command:
#dhcpcd wlan0 &
Note:  If the AP does not support the DHCP service, manually set the static IP address value using
the ifconfig wlan0 xxx,xxx.xxx.xxx command.
5. Check and validate the connection status, using the following commands:
# wpa_cli status
bssid=88:9b:39:f3:d0:4d
ssid=User_AP
id=0
mode=station
pairwise_cipher=NONE
group_cipher=NONE
key_mgmt=NONE
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 17
wpa_state=COMPLETED
ip_address=192.168.43.2
address=00:80:c2:b3:d7:4d
The user can save and use the network information to automatically connect to the network using
the wpa_cli save command in Linux.
5.6 Running in the ATWILC AP Mode
This section describes how to connect a device to the ATWILC1000 Access Point.
1. Initialize the ATWILC1000 or ATWILC3000 driver module, using the following command:
[root@buildroot ~]# modprobe wilc-sdio
wilc_sdio: module is from the staging directory, the quality is unknown, you have been
warned.
linux_sdio_probe init_power =0
wilc_sdio mmc0:0001:1: Driver Initializing success
2. Run hostapd as user configuration, using the following command:
[root@buildroot ~]# hostapd /etc/wilc_hostapd_open.conf -B &
[root@buildroot ~]# Configuration file: /etc/wilc_hostapd_open.conf
rfkill: Cannot open RFKILL control device
wilc_sdio mmc0:0001:1 wlan0: Detect chip WILC3000
wilc_sdio mmc0:0001:1 wlan0: loading firmware wilc3000_wifi_firmware.bin
wilc_gnrl_async_info_received
wilc_sdio mmc0:0001:1 wlan0: WILC Firmware Ver = WILC_WIFI_FW_REL_15_00 Build: 8719
Using interface wlan0 with hwaddr fa:f0:05:f6:56:6a and ssid "wilc_SoftAP"
wilc_gnrl_async_info_received
wilc_sdio mmc0:0001:1 wlan0: there is no current Connect Request
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
Note:  See the wilc_hostapd_open.conf file for unencrypted AP settings,
wilc_hostapd_wep.conf file for WEP AP settings and wilc_hostapd_wpa.conf file for
WPA/WPA2 AP settings.
3. Run DHCP server to allocate IP to client. Set the IP address to the gateway using the #ifconfig
wlan0 192.168.0.1 command.
Note:  The gateway IP address is defined in the dhcpd.conf file.
Start the DHCP server using the #/etc/init.d/S80dhcp-server start command.
The user can now connect the PC or smartphone to the ATWILC1000 access point.
To configure AP in the WPS mode, use the same steps for WPA/WPA2 settings, then use the
following command to configure to the Push-button mode:
hostapd_cli wps_pbc
(or) to configure for the pin mode, use the following command:
hostapd_cli wps_pin any <pin>
5.7 Running in the ATWILC P2P Mode
A P2P group includes two devices: One device acts as a P2P Group Owner (GO) and the other device
acts as a P2P Client. The ATWILC devices support both P2P GO and P2P Client modes. The following is
the procedure to test P2P mode on ATWILC.
There are two scenarios in which the P2P mode can be tested. The following section describes each
scenario:
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 18
Scenario 1 - WILC device as a group owner and mobile phone as a P2P client
Configuring the WILC device as a group owner:
1. Load both the WILC modules, using the following command:
modprobe wilc-sdio
echo <mode> > /sys/wilc/p2p_mode
where, mode = 1 for P2P GO and mode = 0 for P2P Client.
2. Start the WPA supplicant service and open the P2P device, using the following command:
wpa_supplicant -Dnl80211 -ip2p0 -c/etc/wilc_p2p_supplicant.conf &
3. Configure the IP address of the P2P GO and start the DHCP server, using the following command:
ifconfig p2p0 192.168.0.1
/etc/init.d/S80dhcp-server start
4. On the terminal, enter into wpa_cli interactive mode, using the following command:
wpa_cli -ip2p0
5. Scan for neighbouring P2P devices for specified duration, using the following command:
p2p_find <scan_duration_in_seconds>
6. After scan is complete, list the available P2P peers using the following command:
p2p_peers
This command lists the BSSID of the P2P peer.
7. Connect to the P2P Client using the BSSID of the P2P peer, using the following command:
p2p_connect <MAC_ADDRESS> pbc
Configuring a mobile phone as a P2P client:
In the Wi-Fi settings menu on the phone, enter into Wi-Fi Direct
®
mode and perform the following to
establish the connection.
Trigger connection from WILC:
1.1. Enter p2p_find command without timeout value on the WILC.
The SSID of the P2P peer appears on the phone.
1.2. Enter the p2p_connect command as shown above in the WILC. A pop-up window
appears on the phone.
1.3. Click the Accept button or prompt to connect.
Trigger connection from phone:
2.1. Click the SSID displayed on the phone and send a P2P invite.
2.2. Enter the p2p_connect <MAC_ADDRESS> pbc command in the WILC to form a P2P
group.
Scenario 2 - WILC device as a P2P client and mobile phone as a group owner
Configuring WILC device as a P2P client:
1. Load both the WILC modules, using the following command:
modprobe wilc-sdio
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 19
2. Start the WPA supplicant service and open the P2P device, using the following command:
wpa_supplicant -Dnl80211 -ip2p0 -c/etc/wilc_p2p_supplicant.conf &
3. On the terminal, enter into wpa_cli interactive mode, using the following command:
wpa_cli -ip2p0
4. Scan for neighbouring P2P devices for specified duration, using the following command:
p2p_find <scan_duration_in_seconds>
5. After the scan is complete, list the available P2P peers, using the following command:
p2p_peers
This command lists the BSSID of the P2P peer.
6. Connect to the P2P Go using the BSSID of the P2P peer, using the following command:
p2p_connect <MAC_ADDRESS> pbc go_intent=1
7. Press Ctrl+c to exit the interactive mode.
8. Run the DHCP client on the WILC to obtain IP address.
dhcpcd p2p0 &
Configuring a mobile phone as a group owner:
In the Wi-Fi settings menu on the phone, enter into Wi-Fi Direct mode and perform the following to
establish the connection.
Trigger connection from WILC:
1.1. Enter the p2p_find command without time-out value on the WILC.
The SSID of the P2P peer appears on the phone.
1.2. Enter the p2p_connect command as shown above in the WILC. A pop-up window
appears on the phone.
1.3. Click the Accept button or prompt to connect.
Trigger connection from phone:
2.1. Click the SSID displayed on the phone and send a P2P invite.
2.2. Enter the p2p_connect <MAC_ADDRESS> pbc command in the WILC to form a P2P
group.
5.8 Supported Modes with Concurrency
The ATWILC devices support the following modes to execute concurrently.
STA - STA (see Running in the ATWILC Station Mode section)
STA - P2P Client (see Running in the ATWILC Station Mode and Configuring WILC device as a
P2P client sections)
STA - P2P GO (see Running in the ATWILC Station Mode and Configuring WILC device as a group
owner sections)
AP - P2P Client (see Running in the ATWILC AP Mode and Configuring WILC device as a P2P
client sections)
STA - AP (see Running the ATWILC Device in Station and AP Modes Concurrently section)
Note:  Use Wlan0 and p2p0 interfaces to run the ATWILC device concurrently.
ATWILC1000/ATWILC3000
Running ATWILC
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 20
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37

Microchip Technology ATWILC1000 User manual

Category
Networking
Type
User manual
This manual is also suitable for

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI