AN1025: SD CARD EXAMPLE

Similar documents
Figure 1. 8-Bit USB Debug Adapter

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

UG103.8: Application Development Fundamentals: Tools

AN962: Implementing Master-Slave Timing Redundancy in Wireless and Packet- Based Network Applications

AN111: Using 8-Bit MCUs in 5 Volt Systems

AN803. LOCK AND SETTLING TIME CONSIDERATIONS FOR Si5324/27/ 69/74 ANY-FREQUENCY JITTER ATTENUATING CLOCK ICS. 1. Introduction

AN862. OPTIMIZING Si534X JITTER PERFORMANCE IN NEXT GENERATION INTERNET INFRASTRUCTURE SYSTEMS. 1. Introduction

UG129: ZigBee USB Virtual Gateway Reference Design (RD ) User's Guide

AN580 INFRARED GESTURE SENSING. 1. Introduction. 2. Hardware Considerations

TS1005 Demo Board COMPONENT LIST. Ordering Information. SC70 Packaging Demo Board SOT23 Packaging Demo Board TS1005DB TS1005DB-SOT

UG103-13: Application Development Fundamentals: RAIL

AN952: PCIe Jitter Estimation Using an Oscilloscope

AN486: High-Side Bootstrap Design Using ISODrivers in Power Delivery Systems

AN922: Using the Command Line Interface (CLI) for Frequency On-the-Fly with the Si5346/47

Making Prototyping Boards for the EFM32 kits

Bootloader with AES Encryption

ETRX3USB ETRX3USB-LRS ETRX3USB+8M ETRX3USB-LRS+8M PRODUCT MANUAL

Current Digital to Analog Converter

QSG108: Blue Gecko Bluetooth Smart Software Quick-Start Guide

AN583: Safety Considerations and Layout Recommendations for Digital Isolators

RoHs compliant, Pb-free Industrial temperature range: 40 to +85 C Footprint-compatible with ICS , 2.5, or 3.3 V operation 16-TSSOP

Telegesis is a trademark of Silicon Laboratories Inc. Telegesis ZigBee Communications Gateway. Product Manual

Selecting the Right MCU Can Squeeze Nanoamps out of Your Next Internet of Things Application

UG103.8 APPLICATION DEVELOPMENT FUNDAMENTALS: TOOLS

AN0822: Simplicity Studio User's Guide

QSG105 GETTING STARTED WITH SILICON LABS WIRELESS NETWORKING SOFTWARE

Table 1. RF Pico Boards of the EZRadioPRO Development Kits. Qty Description Part Number

AN614 A SIMPLE ALTERNATIVE TO ANALOG ISOLATION AMPLIFIERS. 1. Introduction. Input. Output. Input. Output Amp. Amp. Modulator or Driver

Backup Power Domain. AN Application Note. Introduction

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

How To Develop A Toolstick

AN655 R ANGE TEST APPLICATION FOR EZRADIO AND EZRADIOPRO. 1. Introduction. 2. Supported Radio Types

UG103.14: Application Development Fundamentals: Bluetooth Smart Technology

CPU. PCIe. Link. PCIe. Refclk. PCIe Refclk. PCIe. PCIe Endpoint. PCIe. Refclk. Figure 1. PCIe Architecture Components

AN220 USB DRIVER CUSTOMIZATION

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

AN104 I NTEGRATING KEIL 8051 TOOLS INTO THE SILICON LABS IDE. 1. Introduction. 2. Key Points. 3. Create a Project in the Silicon Labs IDE

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

AN220 USB DRIVER CUSTOMIZATION

AN335 USB DRIVER INSTALLATION UTILITY. 1. Description. 2. Installation Install Package

USB Audio Simplified

ZigBee-2.4-DK 2.4 GHZ ZIGBEE DEVELOPMENT KIT USER S GUIDE. 1. Kit Contents. Figure GHz ZigBee Development Kit

AN335 USB DRIVER INSTALLATION METHODS. 1. Introduction. 2. Relevant Documentation. 3. DPInst Installation and Customization

Spotify Homepage Takeover

1 Software Overview ncp-uart ash-v3-test-app ash-v3-test-app Command Line Options Testing... 2

Design Challenges for Adding Relative Humidity Sensors

USER GUIDE EDBG. Description

APPLICATION NOTE. AT16268: JD Smart Cloud Based Smart Plug Getting. Started Guide ATSAMW25. Introduction. Features

Polar Help Desk Installation Guide

Getting Started Guide with WIZ550web

Touchless switch Object detection Handsets Intrusion/tamper detection. Reflectance-Based Proximity Detection PRX. Signal processing SREN

IBM TRIRIGA Anywhere Version 10 Release 4. Installing a development environment

Novell Identity Manager

December 2002, ver. 1.0 Application Note 285. This document describes the Excalibur web server demonstration design and includes the following topics:

Novell ZENworks 10 Configuration Management SP3

What Types of ECC Should Be Used on Flash Memory?

Web Browsing Examples. How Web Browsing and HTTP Works

ICE Trade Vault. Public User & Technology Guide June 6, 2014

CP2102/ V. 48 MHz Oscillator. USB Function Controller. 640B TX Buffer. 576B RX Buffer 1024B PROM. Figure 1. Example System Diagram

Novell Sentinel Log Manager 1.2 Release Notes. 1 What s New. 1.1 Enhancements to Licenses. Novell. February 2011

Administration Quick Start

BLE113 DEVELOPMENT KIT

ACE: Dreamweaver CC Exam Guide

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

AN75. Si322X DUAL PROSLIC DEMO PBX AND GR 909 LOOP TESTING SOFTWARE GUIDE. 1. Introduction

APPLICATION. si32library. Callback CMSIS HARDWARE. Figure 1. Firmware Layer Block Diagram

IBM DB2 for Linux, UNIX, and Windows. Deploying IBM DB2 Express-C with PHP on Ubuntu Linux

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

Quick Start Guide Mobile Entrée 4

Si52144 PCI-EXPRESS GEN 1, GEN 2, & GEN 3 QUAD OUTPUT CLOCK GENERATOR. Features. Applications. Description. Functional Block Diagram

User Guide Novell iprint 1.1 March 2015

IBM WebSphere Portal Reference Guide Release 9.2

StarWind iscsi SAN Software: Installing StarWind on Windows Server 2008 R2 Server Core

Si52142 PCI-EXPRESS GEN 1, GEN 2, & GEN 3 TWO OUTPUT CLOCK GENERATOR WITH 25 MHZ REFERENCE CLOCK. Features. Applications.

Intel Internet of Things (IoT) Developer Kit

Implicit Sync. Professional Edition Users Guide

Ways to Use USB in Embedded Systems

STSW-IDW002. Hands-On Training for SPWF01SC and SPWF01SA Wi-Fi modules. Features. Description

NetIQ Sentinel Quick Start Guide

An Oracle White Paper May Creating Custom PDF Reports with Oracle Application Express and the APEX Listener

Why API? Using the REST API in an education environment. JAMF Software, LLC

Figure 1. Classes of Jitter

HTML5 Standard Banner

Building and Debugging a project using Keil MDK-ARM Eclipse plug-in

Interworks. Interworks Cloud Platform Installation Guide

Intel Storage System SSR212CC Enclosure Management Software Installation Guide For Red Hat* Enterprise Linux

Software Distribution Reference

DKWF121 WF121-A B/G/N MODULE EVALUATION BOARD

AN10860_1. Contact information. NXP Semiconductors. LPC313x NAND flash data and bad block management

Connect the EFM32 with a Smart Phone through the Audio Jack

MDM Mass Configuration Tool User s Manual

Using the vcenter Orchestrator Plug-In for vsphere Auto Deploy 1.0

Advanced User Guide Vibe 4.0 March 2015

Avaya Identity Engines Ignition Server Release: Avaya Inc. All Rights Reserved.

CodeWarrior Development Studio Floating Licensing Quick Start

AT&T Global Network Client Domain Logon Guide. Version 9.6

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

Title page. Alcatel-Lucent 5620 SERVICE AWARE MANAGER 13.0 R7

USB Stick Driver Installation Instructions

Zynq-7000 Platform Software Development Using the ARM DS-5 Toolchain Authors: Simon George and Prushothaman Palanichamy

Transcription:

AN1025: SD CARD EXAMPLE APPLICATION NOTE Tuesday, 22 September 2015 Version 1.0

Contents APPLICATION NOTE...1 1 File Manager Project...3 1.1 Project Configuration...3 1.2 BGScript...3 2 Accessing the SD Card Content...4 2.1 Accessing the file manager with a browser...4 2.2 Accessing the file manager with REST API commands...4 Silicon Labs Page 2 of 7

1 File Manager Project The filemgr example project included in the latest official version of the SDK (version 1.3.0 build 83) demonstrates how files can be uploaded, indexed, accessed, retrieved, and deleted to/from an SD card which is connected to a module via a web page based user interface. The project includes a BGScript source file, called main.bgs, an html file, index.html, a style sheet for the html file, style.css, the project configuration file, project. xml, and three image files used by index.html. The html page, in conjunction with the style sheet and the image files, makes up the web page that provides the user interface allowing for files to be uploaded, indexed, accessed, retrieved, or deleted to/from the SD card connected to the SD card hardware interface on the WF121 module (SPI3 in the case of this example project). The BGScript file, main.bgs implements the application logic involved with the operation of the WF121 hardware. 1.1 Project Configuration The project configuration includes the 4 tags: <scripting>, <hardware>, and <files>. The <scripting> tag is used to specify the main BGScript file to use for the project. In this example the main.bgs will including another script file, api.bgs, with import command. Project tags: <hardware> tag is used to define the hardware configuration of the WF121. <sdhc> tag within the hardware section configures the SD card interface. In order to use the SD Card interface, the <sdhc> settings shown above must be used. <uart> tag configures the UART interface, which has to be connected and buffers read, for example using the WF121 GUI, when the API is enabled. <files> Defines the HTML, CSS and image files used by the embedded HTTP server. 1.2 BGScript The BGScript source file, main.bgs, is responsible for the application logic primarily concerned with the hardware operation of the WF121 and importing the REST API functionality from the api.bgs file. Specifically, main.bgs is responsible for turning WiFi on and setting the operating mode to Access Point when the module boots, then starting Access Point mode, and adding HTTP server accessible URL paths to the SD card and module's Flash. The https_add_path API method is used to add new URL paths to resources accessible by the HTTP sever. Such resources can be any of the following: the device flash, the SD card, or the API. Silicon Labs Page 3 of 7

2 Accessing the SD Card Content 2.1 Accessing the file manager with a browser The html source file, index.html, implements the web based interface allowing files to be uploaded, indexed, accessed, retrieved, or deleted to/from the SD card connected to the WF121 module. After associating the remote device with the module's Access Point called "WF121 Example", browse with using Chrome,IE, Safari etc. to http://192.168.1.1/ The files currently stored on the SD card will be listed on the body of the page. New files, located on the device accessing the page, may be uploaded to the SD Card using the "Upload" button. Existing files on the SD Card can be deleted using the "Delete" button. Files listed under the index can be selected and viewed within the browser if they are of a format the browser being used can interpret such as html files. 2.2 Accessing the file manager with REST API commands The web page is powered by Javascript code which exposes the HTTP server's built-in functionality meant to manipulate the files in the SD card filesystem. The below operations are available, assuming the usage of call https_add_path(2, 7, "/sdcard") in the script: Read a file called 123.txt which exists in the root directory of the SD Card: GET /sdcard/123.txt Write a file called 123.txt into the root directory of the SD Card PUT /sdcard/123.txt Read the content of the directory /mydir: Silicon Labs Page 4 of 7

GET /sdcard/mydir?dir Delete a file called 123.txt which exists in the root directory of the SD Card: DELETE /sdcard/123.txt Any of the above HTTP requests could be also issued for example by the "curl" program in a Linux system, like in the following example: curl -v -X GET http://192.168.1.1/sdcard/123.txt Since the HTTP server running in the module has no capability to create a directory, the solution in this case would be to intercept a custom HTTP request and adapt the BGScript to parse it and then launch the call sdhc_fmkdir() which is one of the BGAPI/BGScript commands in the SD memory card interface class meant to fully manipulate the filesystem of an attached SD card Silicon Labs Page 5 of 7

Simplicity Studio One-click access to MCU and wireless tools, documentation, software, source code libraries & more. Available for Windows, Mac and Linux! IoT Portfolio www.silabs.com/iot SW/HW www.silabs.com/simplicity Quality www.silabs.com/quality Support and Community community.silabs.com Disclaimer Silicon Laboratories intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Laboratories products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Laboratories reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Laboratories shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products are not designed or authorized to be used within any Life Support System without the specific written consent of Silicon Laboratories. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Laboratories products are not designed or authorized for military applications. Silicon Laboratories products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons. Trademark Information Silicon Laboratories Inc., Silicon Laboratories, Silicon Labs, SiLabs and the Silicon Labs logo, Bluegiga, Bluegiga Logo, Clockbuilder, CMEMS, DSPLL, EFM, EFM32, EFR, Ember, Energy Micro, Energy Micro logo and combinations thereof, "the world s most energy friendly microcontrollers", Ember, EZLink, EZRadio, EZRadioPRO, Gecko, ISOmodem, Precision32, ProSLIC, Simplicity Studio, SiPHY, Telegesis, the Telegesis Logo, USBXpress and others are trademarks or registered trademarks of Silicon Laboratories Inc. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders. Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 USA http://www.silabs.com