Microchip Technology ATWILC1000, ATWILC3000 User Manual

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:
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
ATWILC1000/ATWILC3000

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
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 2
ATWILC1000/ATWILC3000
Worldwide Sales and Service........................................................................................37
© 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
ATWILC1000/ATWILC3000
Building Linux for SAMA5D4 Xplained Ultra ...

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.
© 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
ATWILC1000/ATWILC3000
Updating Binary and System Image into the ...

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.
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 7
Updating Binary and System Image into the ...
Figure 3-2. SAMA5D4 Adapter Connections
ATWILC1000/ATWILC3000
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.
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 8
ATWILC1000/ATWILC3000

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.
Updating ATWILC Firmware
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 root@192.168.0.11: /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.
© 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.
ATWILC1000/ATWILC3000
Running ATWILC
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
© 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
ATWILC1000/ATWILC3000
Running ATWILC
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.
© 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
ATWILC1000/ATWILC3000
Running ATWILC
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:
© 2018 Microchip Technology Inc.
User Guide
DS70005328B-page 12
Loading...
+ 25 hidden pages