Microchip Technology ATWILC1000 User Manual

Microchip Technology ATWILC1000 User Manual

Wi-fi link controller linux

Advertisement

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
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.
ATWILC1000/ATWILC3000
®
User Guide
kernel 4.9.
DS70005328B-page 1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ATWILC1000 and is the answer not in the manual?

Questions and answers

Summary of Contents for Microchip Technology ATWILC1000

  • Page 1: Introduction

    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: •...
  • Page 2: Table Of Contents

    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.
  • Page 3 ATWILC1000/ATWILC3000 Worldwide Sales and Service..................37 User Guide DS70005328B-page 3 © 2018 Microchip Technology Inc.
  • Page 4: 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 –...
  • Page 5: Building Linux For Sama5D4 Xplained Ultra Board

    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. User Guide DS70005328B-page 5 ©...
  • Page 6: Building Linux Kernel Individually

    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 User Guide DS70005328B-page 6 © 2018 Microchip Technology Inc.
  • Page 7: Updating Binary And System Image Into The Target Board

    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. User Guide DS70005328B-page 7 © 2018 Microchip Technology Inc.
  • Page 8 • No flow control 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. User Guide DS70005328B-page 8 © 2018 Microchip Technology Inc.
  • Page 9: Updating Atwilc Firmware

    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. ATWILC1000 and ATWILC3000 Firmware Binaries Add the ATWILC1000 firmware wilc1000_wifi_firmware.bin to the /lib/firmware/ mchp/ directory. Add the ATWILC3000 Wi-Fi firmware, wilc3000_wifi_firmware.bin to the/lib/firmware/ mchp/ directory.
  • Page 10: Running Atwilc

    ATWILC1000/ATWILC3000 Running ATWILC Running ATWILC This chapter describes how to use the ATWILC1000 and ATWILC3000 on the SAMA5D4 Xplained Board or any similar Linux platform. 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.
  • Page 11: Recognizing Atwilc1000

    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.
  • Page 12: Recognizing Atwilc3000

    ATWILC1000/ATWILC3000 Running ATWILC 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...
  • Page 13 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 User Guide DS70005328B-page 13 © 2018 Microchip Technology Inc.
  • Page 14: Modifying Configuration Files

    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 User Guide DS70005328B-page 14 © 2018 Microchip Technology Inc.
  • Page 15 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 User Guide DS70005328B-page 15 © 2018 Microchip Technology Inc.
  • Page 16: Running In The Atwilc Station Mode

    Running in the ATWILC Station Mode The following example shows how to run the ATWILC device in Station mode, and connect to an AP. Initialize the ATWILC1000 and ATWILC3000 driver module, using the following command: Welcome to Buildroot buildroot login: root...
  • Page 17 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. 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 User Guide DS70005328B-page 17 © 2018 Microchip Technology Inc.
  • Page 18: Running In The Atwilc Ap Mode

    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...
  • Page 19 Scenario 2 - WILC device as a P2P client and mobile phone as a group owner Configuring WILC device as a P2P client: Load both the WILC modules, using the following command: modprobe wilc-sdio User Guide DS70005328B-page 19 © 2018 Microchip Technology Inc.
  • Page 20: Supported Modes With Concurrency

    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. User Guide DS70005328B-page 20 © 2018 Microchip Technology Inc.
  • Page 21 Run the DHCP Server to allocate IP to client. – Set the IP of AP; #ifconfig p2p0 192.168.0.1 – Start the DHCP server; #/etc/init.d/S80dhcp-server start The user can connect the PC or smartphone to the ATWILC1000 AP. User Guide DS70005328B-page 21 © 2018 Microchip Technology Inc.
  • Page 22: Powersave

    HCI commands, it will set the UART RTS line low, and the host will be able to send more HCI commands. This is illustrated in the following figure: 1. Yellow: UART Rx (ATWILC3000 perspective)  2. Blue: UART Tx  3. Purple: UART RTS  4. Green: ATWILC3000 Ready  User Guide DS70005328B-page 22 © 2018 Microchip Technology Inc.
  • Page 23: Antenna Switching

    GPIOs that are used to control the antenna switch at run time. 5.10.1 Antenna Switch GPIO Control Sysfs entry /sys/wilc/ant_swtch_mode can be used as follows to configure the GPIOs used to control the antenna switch: # echo mode > /sys/wilc/ant_swtch_mode User Guide DS70005328B-page 23 © 2018 Microchip Technology Inc.
  • Page 24 # echo GPIO_NUM > /sys/wilc/antenna2 ( for dual antenna switch) where, GPIO_NUM is any valid GPIO for antenna diversity. Valid GPIOs for the ATWILC1000 are 0, 1, 4 and 6. Valid GPIOs for the ATWILC3000 are 3, 4, 17, 18, 19 and 20.
  • Page 25: Debug Logs

    //if (!rdev->wiphy.wowlan_config) //cfg80211_leave_all(rdev); The following is the sample of the \net\wireless\sysfs.c file: static int wiphy_suspend(struct device *dev, pm_message_t state) struct cfg80211_registered_device *rdev = dev_to_rdev(dev); int ret = 0; rdev->suspend_at = get_seconds(); rtnl_lock(); User Guide DS70005328B-page 25 © 2018 Microchip Technology Inc.
  • Page 26 #echo mem > /sys/power/state 5.12.2 Set Transmit Power The user can control the Tx power of ATWILC1000 or ATWILC3000 using the iw tool with the following command line arguments. $ iw dev wlan0 set txpower fixed x Where x is the desired Tx level.
  • Page 27 (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A) cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 1700 mBm), (N/A) User Guide DS70005328B-page 27 © 2018 Microchip Technology Inc.
  • Page 28: Running Atwilc3000 In Bluetooth Mode

    The user must use this command after downloading and starting the BT firmware using UART, allowing the BT and Wi-Fi firmwares to take sleep or wake decisions. $ echo BT_FW_CHIP_ALLOW_SLEEP > /dev/wilc_bt User Guide DS70005328B-page 28 © 2018 Microchip Technology Inc.
  • Page 29 Start the bluetoothctl using the $ bluetoothctl command, which can be used to scan and connect. The following is a sample when the scan is started: $ scan on Scanning ... 60:6C:66:A4:29:63 D247-PC 60:03:08:89:93:E7 damiank-mbp1 E0:06:E6:BE:A8:FA APDN194 78:DD:08:B2:91:C9 ALEX-PC User Guide DS70005328B-page 29 © 2018 Microchip Technology Inc.
  • Page 30 TX bytes:1381 acl:0 sco:0 commands:67 errors:0 Features: 0xff 0xff 0xcd 0xfe 0xdb 0xff 0x7b 0x87 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH HOLD SNIFF PARK Link mode: SLAVE ACCEPT User Guide DS70005328B-page 30 © 2018 Microchip Technology Inc.
  • Page 31 WILC got 60 for gpio_reset wilc_sdio mmc0:0001:1: WILC got 94 for gpio_chip_en wilc_sdio mmc0:0001:1: WILC got 91 for gpio_irq wilc_sdio mmc0:0001:1: Driver Initializing success # echo BT_POWER_UP > /dev/wilc_bt at_pwr_dev: open() AT PWR: bt_power_up User Guide DS70005328B-page 31 © 2018 Microchip Technology Inc.
  • Page 32 [GATT server]# att: > 0a 10 00 [GATT server]# att: ATT PDU received: 0x0a [GATT server]# server: Read Req - handle: 0x0010 [GATT server]# att: ATT op 0x0b [GATT server]# att: < 0b 01 [GATT server]# User Guide DS70005328B-page 32 © 2018 Microchip Technology Inc.
  • Page 33: Document Revision History

    Antenna Switching, and Debug Logs • Added details about BLE Peripheral Mode example for BlueZ 5.28 and Earlier, and BlueZ 5.29 and Later Rev A - 08/2017 Section Changes Document Initial Release User Guide DS70005328B-page 33 © 2018 Microchip Technology Inc.
  • Page 34: The Microchip Web Site

    Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. User Guide DS70005328B-page 34 © 2018 Microchip Technology Inc.
  • Page 35: Legal Notice

    SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries. GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.
  • Page 36: Quality Management System Certified By Dnv

    ATWILC1000/ATWILC3000 © 2018, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. ISBN: 978-1-5224-3249-4 Quality Management System Certified by DNV ISO/TS 16949 Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California ®...
  • Page 37 New York, NY Sweden - Stockholm Tel: 631-435-6000 Tel: 46-8-5090-4654 San Jose, CA UK - Wokingham Tel: 408-735-9110 Tel: 44-118-921-5800 Tel: 408-436-4270 Fax: 44-118-921-5820 Canada - Toronto Tel: 905-695-1980 Fax: 905-695-2078 User Guide DS70005328B-page 37 © 2018 Microchip Technology Inc.

This manual is also suitable for:

Atwilc3000

Table of Contents