Difference between revisions of "WISE-1530 SDK"

From ESS-WIKI
Jump to: navigation, search
Line 102: Line 102:
 
=== Copy patch file ===
 
=== Copy patch file ===
  
#Download and unzip [[Media:WM-BN-BM-22_SDK_5.1.x_platform_patch_v1.4.zip|WM-BN-BM-22_SDK_5.1.x_platform_patch.zip]]
+
#Download and unzip [[Media:WM-BN-BM-22_SDK_5.1.x_platform_patch_v1.3.zip|WM-BN-BM-22_SDK_5.1.x_platform_patch.zip]]
 
#Copy platforms and WICED folders to <SDK folder>\43xxx_Wi-Fi\ and select replace
 
#Copy platforms and WICED folders to <SDK folder>\43xxx_Wi-Fi\ and select replace
  

Revision as of 09:44, 21 November 2017

Overview

WISE-1530 is used Cypress's WICED®  SDKs to develop Wi-Fi and BLE application. WISE-1530 SDK use C/C++ language Runs on Windows®, Mac® OS X®, and Linux® through Eclipse®-based integrated development environment (IDE).

Single installer package with support for:

  • ​Wi-Fi + Bluetooth combo solution
    • Wi-Fi solutions
    • Bluetooth (Basic Rate, Enhanced Data Rate and Bluetooth Low Energy)
  • Sample applications for many popular use cases like
    • Connecting to cloud services
    • Low-power BLE-based sensors and beacons
    • Smart home gateways
    • BLE-WiFi introducer
  • Code snippets to understand WICED APIs

User can refer to WICED Software to get more information.

Setup Development Environment

Preparing for Hardware

The user needs to prepare for hardware as following:

  • WISE-1530, WISE-1500 and WISE-ED22.
  • 802.11b/g/n (2.4 GHz) Wireless Access Point (AP).
  • PC Runs on Windows®, Mac® OS X®, and Linux®

Please refer to the following steps for setup a WISE series of boards before using WISE-1530.

Step01: Please prepare boards as below.

          RTENOTITLE          

 WISE-1530

 WISE-1500

 WISE-ED22

 WISE-ED22 reset button

 CN2 on WISE-1500

 SW3 on WISE-1500    

  • Pleas check pin1 and pin2 to “OFF” as default.
  • Switch pin2 to decide whether running “backup to default” while device

booting. “ON”: enabled, “OFF”: disable

 WISE-1530 reset button, one button on WISE-1500 and the other on WISE-ED22

⑧ Micro USB connector    

  • Drag-n-drop programming
  • Serial port and debugging
  • Power supplies for UART1 debug port

 RF connector

Power connector


Step02: Connect the WISE-ED22 to PC using micro-USB cable(Please refer to WISE-ED22 Connection with target board).

  • The device will be visible in the Device Manager as below.

          Mbed  uart.png

WICED Studio

The user can refer to the following steps for setup WICED Studio with WISE-1530 SDK.

Windows Install

  1. Download WICED-Studio-5.2.0.22-IDE-Installer.zip
  2. Extract the installer exe from the zip file to temp folder on your computer; do not execute the installer from the zip file
  3. Double click the installer exe to install WICED Studio as below picture

WICED installer 1.png

WICED installer 2.png

WICED installer 3-1.png

WICED installer 4.png

WICED installer 5.png

  1. After installation in completed, launch WICED Studio IDE from shortcut on desktop
  2. When you see the Select WICED Platform page, choose the 43xxx_Wi-Fi item. You can change in "WICED Platform"  in SDK toolbar also.


WICED installer 6.png

Copy patch file

  1. Download and unzip WM-BN-BM-22_SDK_5.1.x_platform_patch.zip
  2. Copy platforms and WICED folders to <SDK folder>\43xxx_Wi-Fi\ and select replace

Build Source File

Create a "Make Target" file

       Step1: In Make Target window click mouse right button

       Step2: Select New...

WICED make target new.png

       Step3: Type "snip.gpio-WISE_1530"

RTENOTITLE

Field explanation: snip.gpio-WISE_1530

  • snip.gpio: application project name
  • WISE_1530: platform name, for WISE-1530 platform don't change this field 

RTENOTITLE



​       

Build Project

Double click "Make Target" file to build project.

RTENOTITLE

It is build complete when you see below 

RTENOTITLE

Generate a Programming File

It will generate three bin files in <SDK folder>\43xxx_Wi-Fi\build folder when build complete.

  1. Bootloader: waf.bootloader-NoOS-WISE_1530.bin 
  2. DCT( Device Configuration Table): DCT.bin:
  3. Application: snip.gpio-WISE_1530.bin

RTENOTITLE

Download and install J-Link software, we need J-Flash tool to combine three bin files for programming.

Launch J-Flash

RTENOTITLE

Open bootloader bin file

RTENOTITLE

Merge DCT bin file

RTENOTITLE

Merge application bin file

RTENOTITLE

Save as a final bin file

RTENOTITLE

Programming 

Generate a programming file then use WISE-ED22 to program WISE-1530. User can refer WISE-ED22 Drag-n-drop Programming section.

Debug Setting

Lauch a serial port tool(use tera term in this), then setting as below.

Serial tool setting.png

Press WISE-1530 reset button, the screen will show as below.

WISE 1530 snip.gpio screen.png

Example

WISE-1530 Demo(StartKit)

Introduction

The Demo application has two main function. One is an BLE and WiFi introducer example. It demonstrates GATT database initialization, DCT configuration, processing read/write requests from a BLE client, and sending data to the client. The BLE WiFi Introducer has two components, an app running on a WICED devices, and an app(BLE Scanner) running on Android device. The other is  AgentLite exapmle. It demonstrates how to get the sensor value from WISE-1500 sensors and upload data to cloud server.

Detailed about WISE-1530 Demo

The detailed behavior about this example is explained as following:

  • System initiation.
Initiation hardware, Wi-Fi wlan connectivity, button1 thread…etc.
  • BLE and WiFi introducer
WISE-1530 will attempt use default SSID and password connection to AP. If success, WISE-1530 will Loop in AgentLite. Otherwise BLE will advertising for set SSID and password. The manipulation follow as below Step by step usage guide .
  • Initiation sensor and access data from it.
The TI HDC1050 has been design-in on WISE-1500. It’s a digital humidity sensor with integrated temperature sensor. The HDC1050 is initialized in example and the user can get data of humidity and temperature from it.
  • Loop in AgentLite or web service.
When device connect to AP,  there are many things needed to do including connected to WISE-PaaS server, keep getting data from sensor and data exchanged through AgentLite. It is going to infinite loop for cloud service.

Step by step usage guide

Step 1: Download and unzip WISE_1530_patch.zip, then copy WISE_1530 folder to <SDK folder>\43xxx_Wi-Fi\ apps. Project Explorer window will appear  WISE_1530 folder. You can press 'F5' to refresh if you do not see.

RTENOTITLE


Step 2: Create a "WISE_1530.StartKit-WISE_1530" target file and build the application.

WISE-1530 startkit.png.png

Step 3: Follow "Generate a Programming File" to generate a bin file,  then download bin file to WISE-1530. You will see below message in console screen if success.

WISE-1530 Ble Wifi Introducer start v2.png


Step 4 to step 8 are manipulated in cell phone.

Step 4: Install and launch the BLE Scanner app.

RTENOTITLE

Step 5: Drop the screen to rescan device, it will list out BLE device nearby. Find the WiFiInt device and press CONNECT button.

WISE-1530 BLE scaaner-1.png 

Step 6: If the connection is successful can see the below picture then press  "CUSTOM SERVICE" button.

WISE-1530 BLE scaaner-2.png

Step 7: Find the UUID: ACA0EF7C-EEAA-48AD-9508-19A6F6B356 for SSID characteristic. Press the "W" button to enter input window. Input new SSID name then press the OK button. Last, user can press "R" button to check new SSID name.

WISE-1530 BLE scaaner-3.png

Step 8:  Find the UUID: 40B7DE33-93E4-4C8B-A876-D833B415A6CE for Password characteristic then procedure as Step5.

WISE-1530 BLE scanner-4.png

Step 9: If the join is successful can see network IP on console screen.

WISE-1530 BLE scanner-5.png

Step 10: If Connect to broker and WISESnail success, user can see temperature, humidity, GPIO1 and GPIO2 on cloud server.

WISE-1530 Conn to Broker.jpg

WISE-1530 Conn to Snail.jpg

Memory/Flash Usage

The WISE-1530 has 1 MBytes flash and 256 KBytes RAM. The Start kit flash and memory usage ia as below.


 Module 
Flash
Static RAM
Adv_WiseSnail
18284
27096
Bluetooth_Embedded_Low_Energy_Stack
154
57
bluetooth_low_energy
78493
9348
button_manager 
588
4
command_console
3688
404
command_console_wifi 
11146
0
crc
1060
0
DHCP_Server
1524
132
DNS
1724
44
GPIO_button
120 4
Host MCU-family library
15718
2492
Interrupt Vectors
388
0
libc
48018
3364
MQTT_Client
5643
736
Networking
5113
13280
NetX-Duo - Interfaces & Stacks
0 16
Other
170044
2930
Packet Buffers
0 23088
platform
1620
308
RAM Initialisation
4028
0
resources
385936
0
Ring_Buffer
112
0
Startup Stack & Link Script fill
144
25
Supplicant - BESL
3470
812
ThreadX
8596
400
TLV
28 0
WICED
5452 1040
WICED_Bluetooth_Firmware_Driver
36692
0
wiced_log
290 1104
wifi_utils
1082 36
WWD
20429
3176
TOTAL (bytes) 
825556
89896

I/O Test (factory)

Introduction

The I/O Test application is a WISE-1530 I/O testing example. It's need extra I/O board(WISE-ED30) to plug in to WISE-1500. The hardware setup as below. This instance could test m2.com I/O that WISE-1530 supported(M2.COM Pinout), include GPIO, ADC, I2C. SPI...etc interface. It used WICED SDK API to read and write I/O.

RTENOTITLE

I/O Test Use WICED API

Step 1: Download and unzip WISE_1530_patch.zip, then copy WISE_1530 folder to <SDK folder>\43xxx_Wi-Fi\ apps.

Step 2: I/O test source code please refer as below files.

RTENOTITLE



Step 3: Create a "WISE_1530.factory-WISE_1530" target file and build the application. Download firmware to WISE-1530 then press reset button.

WISE-1530 IO testing target file v2.png

Step 4: You will see below message in console screen if success. Input '1' to select I/O Function Test, the screen will show I/O test items.Input 1~7 to test I/0 and 0 to return previous page. 

WISE-1530 IO testing screen.png

I/O Test Use SUSI API

The I/O Test example also support SUSI API (please refer SUSI_API).The SUSI support GPIO, I2C, SPI, ADC and PWM APIs.  You can simple revise setting to accomplish SUSI API I/O Test.

Step 1: The SUSI API I/O test source code are as below files.

RTENOTITLE

Step 2: Open SimpleCli.mk and change USE_SUSI_API to 1.

RTENOTITLE

Step 3: Double click "WISE_1530.factory-WISE_1530" target file and build the application. Then download the firmware to WISE-1530, you can see the screen that same as I/O Function Test.