GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22

 
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex
           Audio Video ADK
            Application Note
              80560NT11734A Rev. 0 – 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

SPECIFICATIONS ARE SUBJECT TO CHANGE WITHOUT NOTICE

NOTICE

While reasonable efforts have been made to assure the accuracy of this document, Telit
assumes no liability resulting from any inaccuracies or omissions in this document, or from
use of the information obtained herein. The information in this document has been carefully
checked and is believed to be reliable. However, no responsibility is assumed for
inaccuracies or omissions. Telit reserves the right to make changes to any products
described herein and reserves the right to revise this document and to make changes from
time to time in content hereof with no obligation to notify any person of revisions or changes.
Telit does not assume any liability arising out of the application or use of any product,
software, or circuit described herein; neither does it convey license under its patent rights or
the rights of others.
It is possible that this publication may contain references to, or information about Telit
products (machines and programs), programming, or services that are not announced in your
country. Such references or information must not be construed to mean that Telit intends to
announce such Telit products, programming, or services in your country.
COPYRIGHTS

This instruction manual and the Telit products described in this instruction manual may be,
include or describe copyrighted Telit material, such as computer programs stored in
semiconductor memories or other media. Laws in the Italy and other countries preserve for
Telit and its licensors certain exclusive rights for copyrighted material, including the exclusive
right to copy, reproduce in any form, distribute and make derivative works of the copyrighted
material. Accordingly, any copyrighted material of Telit and its licensors contained herein or in
the Telit products described in this instruction manual may not be copied, reproduced,
distributed, merged or modified in any manner without the express written permission of Telit.
Furthermore, the purchase of Telit products shall not be deemed to grant either directly or by
implication, estoppel, or otherwise, any license under the copyrights, patents or patent
applications of Telit, as arises by operation of law in the sale of a product.
COMPUTER SOFTWARE COPYRIGHTS

The Telit and 3rd Party supplied Software (SW) products described in this instruction manual
may include copyrighted Telit and other 3rd Party supplied computer programs stored in
semiconductor memories or other media. Laws in the Italy and other countries preserve for
Telit and other 3rd Party supplied SW certain exclusive rights for copyrighted computer
programs, including the exclusive right to copy or reproduce in any form the copyrighted
computer program. Accordingly, any copyrighted Telit or other 3rd Party supplied SW
computer programs contained in the Telit products described in this instruction manual may
not be copied (reverse engineered) or reproduced in any manner without the express written
permission of Telit or the 3rd Party SW supplier. Furthermore, the purchase of Telit products
shall not be deemed to grant either directly or by implication, estoppel, or otherwise, any
license under the copyrights, patents or patent applications of Telit or other 3rd Party supplied
SW, except for the normal non-exclusive, royalty free license to use that arises by operation
of law in the sale of a product.

80560NT11734A Rev. 0                      Page 2 of 65                                 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

USAGE AND DISCLOSURE RESTRICTIONS
  I.   License Agreements

The software described in this document is the property of Telit and its licensors. It is
furnished by express license agreement only and may be used only in accordance with the
terms of such an agreement.
 II.   Copyrighted Materials

Software and documentation are copyrighted materials. Making unauthorized copies is
prohibited by law. No part of the software or documentation may be reproduced, transmitted,
transcribed, stored in a retrieval system, or translated into any language or computer
language, in any form or by any means, without prior written permission of Telit
III.   High Risk Materials

Components, units, or third-party products used in the product described herein are NOT
fault-tolerant and are NOT designed, manufactured, or intended for use as on-line control
equipment in the following hazardous environments requiring fail-safe controls: the operation
of Nuclear Facilities, Aircraft Navigation or Aircraft Communication Systems, Air Traffic
Control, Life Support, or Weapons Systems (High Risk Activities"). Telit and its supplier(s)
specifically disclaim any expressed or implied warranty of fitness for such High-Risk Activities.
IV.    Trademarks

TELIT and the Stylized T Logo are registered in Trademark Office. All other product or service
names are the property of their respective owners.
 V.    Third Party Rights

The software may include Third Party Right software. In this case, you agree to comply with
all terms and conditions imposed on you in respect of such separate software. In addition to
Third Party Terms, the disclaimer of warranty and limitation of liability provisions in this
License shall apply to the Third-Party Right software.
TELIT HEREBY DISCLAIMS ANY AND ALL WARRANTIES EXPRESS OR IMPLIED FROM
ANY THIRD PARTIES REGARDING ANY SEPARATE FILES, ANY THIRD PARTY
MATERIALS INCLUDED IN THE SOFTWARE, ANY THIRD PARTY MATERIALS FROM
WHICH THE SOFTWARE IS DERIVED (COLLECTIVELY “OTHER CODE”), AND THE USE
OF ANY OR ALL THE OTHER CODE IN CONNECTION WITH THE SOFTWARE,
INCLUDING (WITHOUT LIMITATION) ANY WARRANTIES OF SATISFACTORY QUALITY
OR FITNESS FOR A PARTICULAR PURPOSE.
NO THIRD PARTY LICENSORS OF OTHER CODE SHALL HAVE ANY LIABILITY FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
AND WHETHER MADE UNDER CONTRACT, TORT OR OTHER LEGAL THEORY,
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE OTHER CODE OR
THE EXERCISE OF ANY RIGHTS GRANTED UNDER EITHER OR BOTH THIS LICENSE
AND THE LEGAL TERMS APPLICABLE TO ANY SEPARATE FILES, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES.

80560NT11734A Rev. 0                      Page 3 of 65                                2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

APPLICABILITY TABLE

                                       PRODUCT

                                  GS2K based Modules

                                      SW Version

                                      5.7.2 onwards

Note: The features described in the present document are provided by the products equipped with
      the software versions equal or higher than the versions shown in the table. See also the
      Revision History chapter.

80560NT11734A Rev. 0                     Page 4 of 65                               2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

Revision History

  Version      Date          Remarks

       0       Jan 2019      Initial release

80560NT11734A Rev. 0                    Page 5 of 65           2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

Table of Contents
NOTICE……… ........................................................................................................................... 2

COPYRIGHTS............................................................................................................................ 2

COMPUTER SOFTWARE COPYRIGHTS ................................................................................. 2

USAGE AND DISCLOSURE RESTRICTIONS .......................................................................... 3

APPLICABILITY TABLE ........................................................................................................... 4

CHAPTER 1. INTRODUCTION .............................................................................................. 11

 1.1. SCOPE ........................................................................................................................ 11
 1.2. OVERVIEW................................................................................................................... 11
 1.3. TERMINOLOGY ............................................................................................................. 12
 1.4. STANDARDS AND CONCEPTS ........................................................................................ 13
CHAPTER 2. FEATURES AND CAPABILITIES.................................................................... 14

CHAPTER 3. THEORY OF OPERATION .............................................................................. 15

CHAPTER 4. ARCHITECTURE ............................................................................................. 16

 4.1. COMPONENT ............................................................................................................... 17
   4.1.1.   Hardware ........................................................................................................ 18
   4.1.2.   Software ......................................................................................................... 21
 4.2. TASKS ......................................................................................................................... 22
 4.3. PROCESS FLOW .......................................................................................................... 23
 4.4. BUTTON AND ITS FUNCTIONALITIES ............................................................................... 24
 4.5. TASK INTERFACE ARCHITECTURE FOR APPLET–1 .......................................................... 26
 4.6. TASK INTERFACE ARCHITECTURE FOR APPLET–3 .......................................................... 30
 4.7. GS-OV INTERFACE ...................................................................................................... 31
   4.7.1.   Load OV Binary .............................................................................................. 31
   4.7.2.   Read OV Video Data ...................................................................................... 32
   4.7.3.   Read OV Audio Data ...................................................................................... 33
   4.7.4.   Write Audio Data ............................................................................................ 34
CHAPTER 5. EMBEDDED APPLICATION EXECUTION SEQUENCE ................................. 35

 5.1. PROGRAM OV BINARY IN GS NODE .............................................................................. 37
   5.1.1.   Method 1: Upload OV Binary to GS Module ................................................... 37
   5.1.2.   Method 2: Load OV Binary into External Flash via S2W ................................ 38
   5.1.3.   Method 3: Load OV Binary Directly to OV Chip via UART Interface ............... 38
 5.2. VIDEO APPLICATION EXECUTION ................................................................................... 40
   5.2.1    GS Boot up ..................................................................................................... 40
   5.2.2.   Load OV from External Flash to OV Chip via SPI........................................... 41
   5.2.3.   Start RTSP Server (and RTP Task) ................................................................ 42
   5.2.4.   RTSP Message Exchanges ............................................................................ 43
   5.2.5.   Start Forward Audio and Video Streaming ..................................................... 48
   5.2.6.   Reverse Audio Streaming ............................................................................... 52
   5.2.7.   Video Rate Adaptation using Remote RTCP Information and Local Data ...... 53
 5.3. CONFIGURATIONS ........................................................................................................ 57
   5.3.1.   Remote Configuration of Video Encoder Settings .......................................... 58
APPENDIX A REFERENCE CODES ...................................................................................... 60

   A.1.1 RTSP SDK REFERENCE CODE FLOW........................................................................... 60
   A.1.2 RTP VIDEO SDK REFERENCE CODE FLOW ................................................................... 60
   A.1.3 RTP AUDIO SDK REFERENCE CODE FLOW................................................................... 60
80560NT11734A Rev. 0                                         Page 6 of 65                                                    2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

  A.1.4 REVERSE AUDIO SDK REFERENCE CODE FLOW ........................................................... 61
  A.1.5 VIDEO ENCODER INTERFACE CODE FLOW ..................................................................... 61
  A.1.6 SIF PROTOCOL............................................................................................................ 61

80560NT11734A Rev. 0                                      Page 7 of 65                                                   2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

List of Figures
Figure 1: Client Mode .................................................................................................................... 16

Figure 2: Hardware Components – Front Side .............................................................................. 18

Figure 3: Hardware Components – Rear Side............................................................................... 19

Figure 4: IO Expander ................................................................................................................... 20

Figure 5: Task Interface Architecture ............................................................................................ 22

Figure 6: Process Flow Diagram ................................................................................................... 23

Figure 7: Task Structure – Applet-1 ............................................................................................... 26

Figure 8: Task Architecture for Applet- 3 ....................................................................................... 30

Figure 9: Loading OV Binary ......................................................................................................... 31

Figure 10: Reading OV Video Data ............................................................................................... 32

Figure 11: Reading OV Audio Data ............................................................................................... 33

Figure 12: Video ADK - Forward Audio ......................................................................................... 34

Figure 13: Video ADK - Reverse Audio ......................................................................................... 34

Figure 14: Firmware uploads Screen ............................................................................................ 37

Figure 15: Serial Port Selection ..................................................................................................... 38

Figure 16: OV Binary in Program Mode ........................................................................................ 38

Figure 17: Transfer Window .......................................................................................................... 39

Figure 18: OV Binary Location ...................................................................................................... 39

Figure 19: OV Binary in RUN Mode .............................................................................................. 40

Figure 20: GS UART Print after GS Module Restart ..................................................................... 40

Figure 21: RTSP Communication between GS Module and Smartphone ..................................... 44

Figure 22: Sample RTSP Packets ................................................................................................. 44

Figure 23: Fields in Actual Data .................................................................................................... 49

Figure 24: Fragmentation Unit ....................................................................................................... 50

Figure 25: RTP Packet Header ..................................................................................................... 51

Figure 26: Sample RTP Packets ................................................................................................... 52

Figure 27: Sample TEARDOWN Message .................................................................................... 52

Figure 28: SPI and Signaling Configurations ................................................................................. 57

Figure 29: Header Information....................................................................................................... 62

Figure 30: Payload ........................................................................................................................ 62
80560NT11734A Rev. 0                                    Page 8 of 65                                                           2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

Figure 31: Get Data ....................................................................................................................... 62

Figure 32: ACK/NACK Stage......................................................................................................... 63

80560NT11734A Rev. 0                                          Page 9 of 65                                                    2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note - 80560NT11734A Rev. 0 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

List of Tables
Table 1: Glossary of Terms ........................................................................................................... 12

Table 2: Hardware Components .................................................................................................... 19

Table 3: Software Components ..................................................................................................... 21

Table 4: GS2200M Button and Related Pins ................................................................................. 24

Table 5: Button Functionalities ...................................................................................................... 25

Table 6: Description of Fields in RTP Packet ................................................................................ 51

Table 7: Profile and its Corresponding Rates ................................................................................ 53

Table 8: Profile and its Quality....................................................................................................... 55

80560NT11734A Rev. 0                                        Page 10 of 65                                                  2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

Chapter 1.             Introduction
1.1.        SCOPE
This document provides an overview about the Telit GS2000® based HD Full-Duplex Audio
Video Application Development Kit (ADK). It describes the software and hardware architecture,
network topology, functional features, API’s, and Application execution sequence of the
Embedded and Mobile applications. The Video ADK provides a complete video reference design
that allows users to stream video and audio data to their iOS or Android based smartphones and
receives audio from smart phone or PC that played it on ADK.

This document assumes that the reader is generally familiar with Telit Wi-Fi products, Internet
Protocol (IP) networks and the operation of 802.11 wireless devices.

1.2.        OVERVIEW
Telit HD Full-duplex Audio Video ADK is a development platform enabling customers to build Wi-
Fi IP video streaming applications with HD video quality. By integrating the major hardware and
software components for Wi-Fi IP camera solution, this reference platform facilitates fast time to
market for customer projects.

Targeted applications for this platform include Wi-Fi IP cloud cameras, baby monitors, toy
cameras, automotive backup/drive recorder cameras, and variety of other systems where
customer would like to add IP video streaming functionality.

          NOTE:

          GainSpan SDK is mandatory for any development on OV1080p HD Full-duplex
          Audio Video ADK.

80560NT11734A Rev. 0                      Page 11 of 65                                2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

1.3.        TERMINOLOGY
Following table lists the different terminologies used in this document.

                          Table 1: Glossary of Terms

Term         Explanation

ADK          Application Development Kit

AP           Access Point

API          Application Programmer’s Interface

DIN          Data Input

DOUT         Data Output

HD           High Definition

IP           Internet Protocol

OTAFU        Over the Air Firmware Update

RTP          Real time Transport Protocol

RTSP         Real Time Streaming Protocol

SPI          Serial Peripheral Interface

STA          Client Station

TCP          Transmission Control Protocol

UART         Universal Asynchronous Receiver/Transmitter

UDP          User Datagram Protocol

VGA          Video Graphics Array

RTCP         RTP Control Protocol

WPS          Wi-Fi Protected Setup

80560NT11734A Rev. 0                         Page 12 of 65                 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

1.4.        STANDARDS AND CONCEPTS
Standards

Generic:

       None

ADK Specific:

       •    RTP
       •    RTSP
       •    SIF
       •    RTCP

Concepts

OV1080p HD Full-duplex Audio Video ADK uses RTP/RTSP streaming mechanism.

80560NT11734A Rev. 0                  Page 13 of 65                         2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

Chapter 2.              Features and Capabilities
This section provides the features and capabilities of the Telit OV1080p HD Full-duplex Audio
Video ADK:

Features:

    •   Resolution
            o   Video resolution: 1280*1080
            o   Bit rate: 1 Mbps
            o   Frame rate: 30 fps
    •   Format: h.264
    •   Audio
            o   Sample rate: 8k
            o   Formats: G711 (Linear PCM)
    •   Provisioning
    •   OTAFU
    •   mDNS/DNS-SD methods
    •   Standby
    •   Wakeup on Wi-Fi
    •   Applet mechanism
    •   Hibernate
Capabilities:

    •   It demonstrates dynamic loading of video application based on conditions.
    •   It demonstrates saving of network parameters before going into standby and restoring the
        same once GS node comes out of standby thereby removing the need of establishing new
        session across standby.
    •   It demonstrates putting the device in Hibernate mode which is the lowest power
        consumption mode available.
    •   It demonstrates waking up from Wi-Fi beacon being in lowest power consumption mode.
    •   In Hibernate mode it sends video snap shot data to user and waits for few seconds
        (configurable) for user request to stream.
    •   In Hibernate mode, switch to PSPOLL mode while waiting for user request.

80560NT11734A Rev. 0                      Page 14 of 65                              2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

Chapter 3.             Theory of Operation

The Telit OV1080p HD Full-duplex Audio Video ADK demonstrates wireless video streaming
using OV798 video encoder chip along with OV2736 camera sensor and two-way audio streaming
using Microsemi ZL38051. It uses RTSP for control path and RTP for video & audio data. For
reverse audio, GS module acts as a client, establishes UDP connection with smartphone as a
server and receives the data.

When the board is powered ON, it comes up as Limited AP, ready for verified provisioning, and
starts the RTSP server and RTP tasks. It cannot stream once provision starts RTSP Server. The
smartphone/laptop connects to GS module as STA. When VLC is launched, it acts as an RTSP
client and starts streaming and h.264 data in RTP packets is received. When a network stream is
opened, the URL that needs to be entered while using VLC is rtsp://
/live.h264.

The Video ADK can be operated in any one of the three modes (Use Cases) as mentioned below:
   • Always ON: This mode is used when there is line power supply available.
   • Wake on wireless (Deep Sleep/Standby): Based on beacon interval it will be on Deep
       sleep or in Standby mode.
   • Event based Wakeup (Alarm): The module will wake up based on event otherwise it’ll be
       on hibernate mode.
The mode type can be selected while building the binary from the SDK Builder.

80560NT11734A Rev. 0                     Page 15 of 65                              2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

Chapter 4.             Architecture
The Video Low Power ADK architecture consists of GS node working in limited AP/STA mode.
Limited-AP mode is used only for provisioning the module. It is in STA mode that GS node
showcases low power functionality.

The Telit Video LP works in two Low Power modes:

    PSPOLL

    HIBERNATE

PSPOLL Mode

                                     Figure 1: Client Mode

On wake up from standby, Base code loads into RAM check for any Data request packet
notification from Access Point. If there is no packet it goes to standby and wakes up every DTIM
interval. This cycle repeats.

 Once mobile application opens on smart phone or Open VLC player and request for video using
RTSP URL it sends mdns/rtsp packet to find Video service in LAN.GS Video module gets
notification through mdns/rtsp packet and starts the RTSP Server and waits for PLAY request.
The video mobile application uses the discovery feature provided by the video embedded
firmware application to enable automatic discovery of the available video profiles and services.

 Client launches the video application to initiate RTSP communication and acts as an RTSP client
in this process. It fetches h.264 video and G711 audio data from OV chip through SPI interface,
fragments and formats both video and audio data, and sends it over RTP/UDP. In reverse audio,
the audio data is received from the smartphone and is sent to Micro semi decoder through OV798
chip.

Hibernate mode:

In Hibernate mode, GS node wakeup on Button Press notification and sends video snap shot data
to pre-configured Server. After snap shot it starts RTSP Server application and waits for PLAY
request. On smart phone open GS Video app discovery video services that launches RTSP client
and request for data.

80560NT11734A Rev. 0                     Page 16 of 65                               2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.1. COMPONENT
The HD Full-Duplex Audio Video ADK components consist of:

       •   External flash (where OV image is optionally stored)
       •   GS Wi-Fi module and embedded application
       •   OV798 video encoder and its firmware
       •   OV2736 digital camera sensor
       •   ZL38051 audio encoder and decoder
       •   LEDs indicators
       •   Native application
       •   I/O expander (SX1503 16 Channel)
The video application board supports the Wi-Fi HD video streaming capability of the GS module
which,

   1. Has a GS Wi-Fi module and embedded application package to support its prescribed set
      of features and functionalities.
   2. Connects to the OV798 chip through SPI serial interface which fetches data from Camera
      sensor OV2736.
   3. OV798 chip has also interface with Microsemi’s ZL38051 audio processor which does
      both audio encoding and decoding.
   4. Has an external serial flash to store the OV binaries.
   5. Has various LED indicators for indicating,
           o   AP mode: IO expander glows Red
           o   Client mode: IO expander glows Red
           o   OV power on: IO expander glows Green
   6. Has IO expander which provides additional GPIO’s for future development. It creates I2C
      interface between GS and OV and helps to reset OV before any other functionality is
      started.
Native Application

GainSpan native app on Android is used as an application for video and two-way audio streaming.

80560NT11734A Rev. 0                      Page 17 of 65                              2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

     4.1.1. Hardware
     The Telit HD Full-duplex Audio Video ADK uses GS2200M Wi-Fi module-based video application
     board that consists of the following hardware components.

             921600 BAUD RATE SELECTOR                        PGM/RUN MODE SWITCH
                           IN PGM MODE
                            OV USB GS UART                  GS2200MIE

     OV UART

                                                                                        OV2736 CAMERA
                                                                                        MODULE
       OV798

POWER ON/OFF

     DC JACK

                             Figure 2: Hardware Components – Front Side

     80560NT11734A Rev. 0                   Page 18 of 65                            2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

SPEAKER

 ZL38051

                         Figure 3: Hardware Components – Rear Side

                               Table 2: Hardware Components

Component                           Description

Telit Wi-Fi Module                  GS2200M module streams video data over Wi-Fi.

Omnivision OV798                    Omnivision H.264 video compression chip which supports up to 30
                                    fps VGA and HD resolution.

Omnivision OV2736 HD Image          Omnivision OV2736 HD image sensor and lens module which
                                    supports 1280*1080 video resolutions.
Sensor and Lens module

Microsemi ZL38051                   Microsemi audio processing chip which supports G711 A/U law
                                    with 16k sampling rate.

GS Serial Flash                     Used for storage of provisioning, custom application web pages,
                                    backup firmware, and OV firmware.

LEDs                                Indicates Power On, Operation mode (Limited AP or Client) and
                                    Run or Program mode.

80560NT11734A Rev. 0                      Page 19 of 65                                 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

Component                            Description

GS USB port                          Used to power the board and upgrade firmware on the Wi-Fi
                                     module.

I/O Expander                         It is connected to GS I2C port and is used to enable power to
                                     OV798, ZL38051, reset OV and glow AP/Client mode LED’s.

4.1.1.1. I/O Expander
The SX1501, SX1502 and SX1503 are complete ultra-low voltage General Purpose Parallel
Input/output (GPIO) expanders ideal for low power handheld battery powered equipment. They
allow easy serial expansion of I/O through a standard I2C interface GPIO devices and can provide
additional control and monitoring when the microcontroller or chipset has insufficient I/O ports, or
in systems where serial communication and control from a remote location is advantageous.

These devices can also act as a level shifter to connect a microcontroller running at one voltage
level to a component running at a different voltage level. The core operates at as low as 1.2V
while the I/O banks can operate between 1.2V and 5.5V independent of the core voltage and each
other. Each GPIO is programmable via 8-bit configuration registers. Data registers, direction
registers, pullup/pull-down registers, interrupt mask registers and interrupt registers allow the
system master to program and configure 4 or 8 or 16-GPIOs using a standard 400kHz I2C
interface.

                                       Figure 4: IO Expander

80560NT11734A Rev. 0                       Page 20 of 65                                 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

  4.1.2.        Software
The Telit HD Full-Duplex Audio Video ADK uses the following software components.

                                    Table 3: Software Components

Component                             Description

GS Video Embedded         Firmware    An embedded application that runs on the Telit Video ADK
Application                           board which is the source of the video stream and runs the
                                      RTSP server and RTP.

A wrapper application for Android     Discovers and launches appropriate player that is installed on
                                      the system.

Video Mobile Application for          An RTP and RTSP based video player for playing live video
Android Smartphones                   stream.

OV798 firmware binary                 The OV configurations and functionalities come in a packaged
                                      binary with GS SDK/AEK.

            NOTE: OV source can be shared for customization requiring NDA with OV.

80560NT11734A Rev. 0                         Page 21 of 65                                    2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.2. TASKS

                               Figure 5: Task Interface Architecture

•   The main task is divided into two sections:
         o Base code, and
         o Applet.
•   Base code performs all basic system initialization.
•   Applet performs the following tasks:
         o Network initialization.
         o Start Video encoder thread.
         o Register for call backs and encoder events.
         o Start RTSP thread and register call back for RTSP events.
         o Start thread for video and audio streaming
•   SPI configurations are configured with GS node as SPI master and OV798 as SPI slave.
•   GS SPI is configured as SPI Master, Mode 0, and DMA mode.
•   OV binary is loaded from GS flash to OV chip.
•   RTSP server is created in RTSP task and poll for events DESCRIBE, SETUP, OPTIONS,
    PLAY and TEARDOWN.
•   As soon as PLAY command is received, RTP task is executed and starts requesting for video
    and audio data from OV on SPI.
•   RTSP Client task establishes the UDP connection with the server waits for the data and if data
    is received, it decodes and plays the audio.
•   RTSP task can receive TEARDOWN (ASYNC) event anytime while video streaming is going
    on in RTP task. If the TEARDOWN receives all the three tasks (forward audio, video, and
    reverse audio) get close.

80560NT11734A Rev. 0                      Page 22 of 65                                2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.3. PROCESS FLOW

                           Figure 6: Process Flow Diagram

80560NT11734A Rev. 0                  Page 23 of 65            2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.4. BUTTON AND ITS FUNCTIONALITIES
The following table details the button functionality with respect to the pin used:

                            Table 4: GS2200M Button and Related Pins

Button                        Pin Name                       Description

Reset Button                  EXT_RTC_RESET_N                This button resets the GS2200M module. It
                                                             remains unused during standby or
                                                             hibernate mode.

WPS/Snapshot Button           IO-Expander GPIO[4]            This button is is tied to the IO-Expander
                                                             GPIO4. This will trigger the interrupt on GS
                                                             RTC IO DC_DC_CNTRL_N/RTC_IO_4 and can
                                                             be used to wake up the system from
                                                             standby or hibernate mode. It is available
                                                             always.

Restore Button                GPIO25                         This is a GPIO in the core domain which is
                                                             only available when CPU is running. It is
                                                             used by the BOOTROM for the Firmware
                                                             Restore Functionality. When the BOOTROM
                                                             is executing the pin is checked in.
                                                             Otherwise, pushing this pin has no effect.

                                                             During normal resets, the pin is likely to
                                                             cause undesirable effects. Therefore, it is
                                                             highly recommended not to overload this
                                                             GPIO. However, due to limited availability
                                                             of GPIOs on our ADK Hardware, we are
                                                             overloading it in RUN mode after the initial
                                                             boot.

80560NT11734A Rev. 0                         Page 24 of 65                                     2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

The buttons and their functionalities are explained in the following table:
                                   Table 5: Button Functionalities

                                        Functionality Description
       Button                                                                         Remarks
                        5.3.0 (Video)                5.5.0 Low Power (Video)

Provisioning OTAFU     In AP mode, always ON         Push the WPS snapshot
Button                 and available all the         button for 5 secs to
                       times.                        toggle between
                                                                                         NA
                                                     RUN(Station) mode and
                                                     provisioning/OTA-FU(AP)
                                                     mode.

Reset Button           Push the reset button.        Push the WPS/Snapshot     In case of always ON,
                                                     button followed by the    the push of
                                                     RESET button.             WPS/Snapshot button
                                                                               is optional.

Factory Default        Push the WPS/Snapshot         Push the WPS/Snapshot     Note: The dynamic file
Button                 button.                       button for 10 sec.        system is erased to
                                                                               restore the board to
                                                                               factory default settings.

Firmware Restore       Push the restore button       Push the WPS/Snapshot     In case of always ON,
Button                 along with the reset          button followed by        the push of
                       button.                       restore plus the reset    WPS/Snapshot button
                                                     button.                   is optional.

80560NT11734A Rev. 0                           Page 25 of 65                                  2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.5. TASK INTERFACE ARCHITECTURE FOR APPLET–1

                           Figure 7: Task Structure – Applet-1

80560NT11734A Rev. 0                  Page 26 of 65              2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

The above Use Cases are explained as follows:

Use Case 1: Always ON (Line powered supply)

This mode is used when there is line power supply available. The module is always ready to take
a client request and comes up instantly. It loads the OV binary, starts RTSP server and waits for
the user request.

After teardown, it remains active searching for a new user request.

Use Case 2: Wake ON Wireless

This mode operates on battery. The module goes to Deep Sleep or Standby mode depending
upon the following settings:

   •   Standby mode - Delay of greater than 500ms
   •   Deep Sleep mode - Delay of less than 500ms
In Wake on Wireless mode, on the first boot up, the module waits for 15 secs (configurable) for a
user request and then goes to Deep Sleep/Standby mode depending on the beacon interval
selected.

On teardown, it immediately goes back to Deep Sleep without any delay.

Functionality:

This mode is also known as ‘PS POLL Applet mode’ where GS node will be constantly in low
power associated state waiting for Asynchronous events from the network. Low Power is achieved
by going into standby between the configured beacon interval. The beacon interval is
customizable and has a default wakeup on five beacons. The GS node wakes up just after five
beacons. Only unicast data will be buffered on the AP side which will be received by GS node
after five beacons by using the PS poll mechanism. Note that if any broadcast data comes during
this time, it will be missed.

Operation:

   •   Initializes clock and gets boot reason.
   •   Initializes basic hardware, soft timer, GPIO, alarm, UART, and persistent timer.
   •   Initializes the file system, loads default configuration from flash file system, initialize OV
       and start RTSP server along with PLAY request timeout timer, if it is first time boot.
   •   On expiry of PLAY request timer or Receive TEARDOWN, GS node goes back to standby.
   •   After Wakeup from standby, it initializes the lower system modules such as exception
       handler, HI layer, and sys ctl.
   •   Releases the reset of the WLAN and sends boot-up request informing WLAN that the APP
       CPU is operating in PS POLL Applet Mode.
   •   Registers for various events such as DAB Ready (Data After Beacon), DAB Done with
       Wireless Device Driver (WDD).
   •   Indicates WLAN to wake up on configured beacon interval.
   •   The WLAN wakes up and checks the boot-up message, in case the App CPU is
       functioning in PS poll Applet Mode, it will load a small footprint binary capable of handling
       only a subset of events (DAB Ready, DAB Done). It will check the beacon for any data
       available and accordingly send the event to the APP CPU.
   •   APP CPU will take the following action:
   If data is present:

   •   It receives a DabReady event from WLAN CPU.
80560NT11734A Rev. 0                       Page 27 of 65                                  2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

   •   It will load the Applet code dynamically which does the full initialization of the system,
       starts NCM, initializes the network interface, and is ready to receive data packets.
   • It calls and sends an Interface Resume event to WLAN.
   • If the data packet is a RTSP or mDNS packet, it loads the OV and start RTSP Server.
   • The RTSP Server waits for PLAY request from client.
   • In case, if APP CPU receives TEARDOWN after play or if no request is received within 30
       seconds (configurable time) it will stop NCM, save the parameters in RTC, and put the
       system in standby.
   If data is not present:

   •   APP CPU receives a DabDone event from WLAN CPU.
   •   APP CPU on receiving this event will put the system into standby.

Use Case 3: Event based wakeup (Alarm)
In this Use Case, the module goes on hibernate mode if no request is received.

Functionality:

On first boot, the module loads everything and waits for 15 secs (configurable time) for a user
request. If no request is received, after loading the OV binary, it goes to Standby/ Deep Sleep
mode based on the beacon configuration for the next 30 secs and still waits for a user request.

After these 30 secs are completed, it goes into hibernate mode. The Switch SW1 (snapshot/WPS
button) is configured as an alarm trigger before it goes to hibernate.

When SW1 is pressed, it wakes up and goes to Deep Sleep/Standby based on beacon
configuration for 30 secs. In case, if the user starts streaming, it loads the OV binary and starts
streaming. Once the stream is stopped, it immediately goes back to hibernate mode without a
delay.

Operation:

If macro APP_HIBERNATE_ENABLE is enabled, GS node works in Hibernate mode. ‘Basic code’
also called as base application is started which performs the following:

   •   Initializes clock and receives boot reason.
   •   Initializes basic hardware, soft timer, GPIO, alarm, and UART.
   •   Initializes file system and loads default configuration from flash file system, initialize OV
       and start RTSP server along with PLAY request timeout timer, if it is first time boot.
   •   On expire of PLAY request timer or receive teardown, GS node goes back to hibernate
       mode.
   •   If wakeup is from hibernate boot, it restores the hibernate data from LATCH RAM.
   •   Powers up the WLAN Core.
   •   Initializes the lower system modules such as exception handler, HI layer, sys ctl, and
       configures the clock source.
   •   Posts a message to the Applet loader thread to load Applet.

Applet is dynamically loaded by the Video LP base application which performs the following:

   •   Releases WLAN reset so that it gets initiated.
   •   Initializes the supplicant and random number generator.
   •   Initializes the remaining system (wdd msg handler, network stack, BSD, SM, and NCM).

80560NT11734A Rev. 0                       Page 28 of 65                                 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

   •   Initializes the interface, BSD, state machine (SM), and Network Connection Manager
       (NCM).
   •   Starts NCM to connect to the predefined SSID. If Hibernate mode, then it will take the
       scan entries and goes ahead with the Association. Also, it will be a lean DHCP where it
       will request for the last saved IP address.
   •   Power saving is achieved by switching to PSPOLL mode/Deep Sleep mode in
       WAITING_PERIOD. In case if play request is received, it loads OV and starts RTSP
       Server stream Video data to client.
   •   On timer expire or receiving teardown goes to hibernate mode.
   •   Saves the scan entry, IP address, PSK in RTC latch memory and goes to hibernate mode
       and is awakens only by the RTC alarm pins.

80560NT11734A Rev. 0                    Page 29 of 65                              2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.6. TASK INTERFACE ARCHITECTURE FOR APPLET–3
The Applet-3 is for verified provisioning. The process is as described below:

                                           Entry Function
                                       Applet 3 – Thread Entry
                            {
                            Initiate system (File System, Wi-Fi, HI
                            supplicant)
                            Give Boot reverse to WLAN
                            Initialize N/W stack, BSD layer, SM
                            Initiate NCM and start NCM
                            Event handling loop
                            {
                                 Wait ON message
                                 Process message
                            }
                            Starts concurrent mode
                            Handles provisioning events
                            Connect to Access Points, if credentials are
                            correct else stay in Limited AP
                            }

                               Figure 8: Task Architecture for Applet- 3

80560NT11734A Rev. 0                       Page 30 of 65                        2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.7. GS-OV INTERFACE
4.7.1. Load OV Binary

                            Figure 9: Loading OV Binary

       •   The OV binary is programmed in external flash*.
       •   On boot up, after GS initialization, the OV binary is loaded into OV chip.
       •   The OV binary has the default decoder configurations for fetching OV video.
       •   OV Binary is loaded in four parts:
           o First OV bootloader gets loaded with clock configuration 1 MHz
           o Followed by double data rate(DDR), MPU binaries, and firmware which is loaded
              and remains the same for data transfer.

80560NT11734A Rev. 0                   Page 31 of 65                            2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.7.2. Read OV Video Data

                               Figure 10: Reading OV Video Data

       •   After GS node initialization and network initialization, the main task creates RTSP and
           RTP video tasks.
       •   Once RTSP task receives PLAY event, RTSP server state is set from idle to running
           state.
       •   RTP waits until the server status goes to running and initiates the video and audio
           streaming.
       •   Video streaming:
           o Start video encoder.
           o Get video data length from the encoder.
           o Check for the frame size. It should not be more than 65KB.
           o Get video data from OV chip:
                   Make GPIO A* high.
                   Wait for GPIO B* high.
                   Enable the SPI0 CS.
                   Read data.
                   Disable the SPI0 CS.
                   Make GPIO A* low and wait for GPIO B* to be low.
           o Stop video encoder.

80560NT11734A Rev. 0                      Page 32 of 65                                2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.7.3. Read OV Audio Data

                              Figure 11: Reading OV Audio Data

       •   Along with the main task, RTSP, and RTP video tasks, creates RTP audio task.
       •   Once RTSP task receives PLAY event, RTSP server state is set from idle to running
           state.
       •   RTP waits until the server status goes to running and initiates the audio streaming.
       •   Audio streaming:
           o Start audio encoder.
           o Get audio data length from the encoder.
           o Check for the frame size. It should not be more than 65KB.
           o Get audio data from OV chip:
                   Make GPIO A* high.
                   Wait for GPIO B* high.
                   Enable the SPI0 CS.
                   Read data.
                   Disable the SPI0 CS.
                   Make GPIO A* low and wait for GPIO B* to be low.
           o Stop audio encoder

80560NT11734A Rev. 0                     Page 33 of 65                              2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

4.7.4. Write Audio Data

       •    Along with the RTP video and audio tasks, creates RTSP client task.
       •    It creates UDP socket and listens on audio port.
       •    When the user selects the call option from the native app, GS module receives the
            audio data and decodes the received data using g711 decoder.
       •    Sends data to OV:
            o Start audio decoder.
            o Send audio data length to the OV.
            o Send audio data to OV chip:
                      Make GPIO A* high.
                      Wait for GPIO B* high.
                      Enable the SPI0 CS.
                      Write data.
                      Disable the SPI0 CS.
                      Make GPIO A* low and wait for GPIO B* to be low.
            o Stop audio decoder.

                      ZL                 OV798                        GS

                                                             Convert to 8-Bit, 8KHz, G.711 µ-Law
     16-Bit Linear PCM, 8KHz

                                 Figure 12: Video ADK - Forward Audio

                      ZL                 OV798                        GS

                                                      Gets 8-Bit, 8KHz, G.711 µ-Law
       16-Bit Linear PCM, 8KHz                        And converts to 16-Bit, 8KHz, Linear PCM

                                 Figure 13: Video ADK - Reverse Audio

           NOTE:

           GPIO A, GPIO B and other GPIO configurations are explained in section 5.3
           Configurations.

80560NT11734A Rev. 0                         Page 34 of 65                                         2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

Chapter 5.             Embedded Application Execution Sequence
The Video Low power application by default comes in PSPOLL mode. The PSPOLL boot
sequence is as follows:

   1. Program OV binary in GS
       a) Upload OV binary to GS Module
   2. Video application execution
       a) After GS first Boot up
       b) Video_lp binary checks for Boot type as PSPOLL or Hibernate
            1. If PSPOLL Boot, restore the standby data and check DAB Ready indication.
            2. If DAB Ready indication notified loads applet (applet_1.bin) otherwise, goes to
                standby
   After applet loads and do default configuration initialization. The sequence is as follows:

       c) Load OV from GS flash via SPI at 10MHz
               a. Load Boot Loader
               b. Load OV binary
       d) Start RTSP Server (and RTP Task) and play time out timer
       e) RTSP Server waits for PLAY method till timer expires. On timer expires it goes to
          standby
       f)   Discover the video service in video application or launch via VLC
       g) RTSP message exchanges
       h) On receive of “PLAY”, sets the server status as running and initiate video and audio
          streaming
       i)   RTSP thread establishes UDP connection, connects to UDP server on the app and
            waits for the data. When the call button is pressed in the native app, UDP server in the
            smartphone sends data and GS module receives the audio stream and plays.
       j)   Terminate streaming (RTSP Server keeps running, TEARDOWN is sent when native
            APP is closed).
       k) On receiving TEARDOWN, it goes back to standby.
   In case Video Low power application compiled with APP_HIBERNATE_ENABLE flag
   application boot up in Hibernate mode. Sequence of Hibernate is as follows:

   1. Program OV binary in GS
       a) Upload OV binary to GS Module
   2. Video application execution
       a) GS node wakeup by pressing Alarm 3 button. On wakeup Video_lp binary loads into
          RAM.
       b) Video_lp binary checks for Boot type. As code compile with
          APP_HIBERNATE_ENABLE it boots up in Hibernate mode and Boot type set to
          HIBERNATE.
            1. Video_lp binary restore the Hibernate data.
            2. Loads applet (applet_1.bin).
    After applet loads and do default configuration initialization. The sequence is as follows:

80560NT11734A Rev. 0                        Page 35 of 65                                 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

       a) After NCM starts, loads OV binary.
       b) After send data waits for user response If user request to stream.
       c) Start RTSP Server (and RTP Task).
       d) Discover the Video service in Video Application or launch via VLC
       e) RTSP message exchanges
       f)   On receive of “PLAY”, sets the server status as running and initiate video and audio
            streaming.
       g) RTSP thread establishes UDP connection, connects to UDP server on the app and
          waits for the data. When the call button is pressed in the native app, UDP server in
          the smartphone sends data and GS module receives the audio stream and plays.
       h) Terminate streaming (RTSP Server keeps running, TEARDOWN is sent when native
          APP is closed).
       i)   On receiving TEARDOWN, it goes back to Hibernate.

80560NT11734A Rev. 0                      Page 36 of 65                              2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

    5.1. PROGRAM OV BINARY IN GS NODE
The OV binary is loaded into GS module via three methods:

    5.1.1. Method 1: Upload OV Binary to GS Module

Perform the following steps to do an over the air update for OV binary into the external flash of GS
module:

          NOTE: OV binary are provided as part of the release package from Telit which
          can be loaded directly via S2W into external flash.

•   Over the air firmware update for OV can be done only after once OV binary with required
    superblocks and control blocks have been programmed in external flash (It comes as a part of
    Quick start guide and can be done via S2w application).
•   OV firmware consists of dsif_sl.bin (slave image) and dsif_bt.bin (bootloader image), which
    are combined to make a 1MB (1024KB) file system for programming into external flash. This
    can be directly programmed to external flash via s2w application.
•   For performing OTAFU for OV image 4KB control block need to be appended at the start of
    image followed by the OV image. The size of image compatible for OTAFU comes to 1028KB.
    The steps and scripts to create the same has been shared at,
        ../SDK/embedded/tools/GS_Extflash_FS_Create_tool folder
    1. Generate the OV binary as explained above and copy into a Laptop or a PC.
    2. Switch on the Telit Video ADK board. It comes up in limited AP mode with SSID as
       GS_PROV_VIDEO_XXXXXX, and passphrase is “GS_XXXXXX” where XXXXXX are the
       last six digits of the MAC address of GS module.
    3. Connect the laptop or PC with the Telit Video ADK board through Wi-Fi.
    4. Access the GS module URL http://192.168.240.1/extotafu.html from Laptop or PC.
    5. Browse the valid firmware image (ov_av_otafu.bin) and click upload.

                               Figure 14: Firmware uploads Screen

    6. GS module restarts itself.

80560NT11734A Rev. 0                       Page 37 of 65                                 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

   5.1.2. Method 2: Load OV Binary into External Flash
          via S2W
The package consists of a single image which is built from OV bootloader, and an OV firmware
image which can be directly loaded to serial flash via S2W. When the module boots up, it loads
the OV binary from serial flash to OV chip.

   5.1.3. Method 3: Load OV Binary Directly to OV Chip
          via UART Interface
   1. Open the Tera Term terminal emulation application. Select the serial port for OV UART
      USB and set the Baud rate to 115200.

                               Figure 15: Serial Port Selection

   2. Press SHIFT+X keys simultaneously and a continuous stream of CCCCCC is displayed.
      This indicates the OV binary is in Program mode.

                            Figure 16: OV Binary in Program Mode

   3. From the Tera Term window, select File>Transfer >XMODEM > Send.

80560NT11734A Rev. 0                     Page 38 of 65                             2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

                                 Figure 17: Transfer Window

   4. Open the folder where the OV binary is located. Select the ov_boot.bin file. Click Open.

                                Figure 18: OV Binary Location

   5. ov_boot binary starts downloading. Once complete, the Tera Term window displays the
      version information of video ADK/AEK OV binary and automatically places the OV chip in
      Run mode.

80560NT11734A Rev. 0                     Page 39 of 65                               2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

                                 Figure 19: OV Binary in RUN Mode

    5.2. VIDEO APPLICATION EXECUTION
The sequence of execution after the GS module restarts is explained in the following sections.

5.2.1           GS Boot up
The sequence of execution followed for loading boot loader and OV firmware is as follows:

    1. On boot up, the GS node starts up with system initialization.

                        Figure 20: GS UART Print after GS Module Restart

At this point, the main task completes system initialization.
Code Ref:

AppMainCtx_ThreadEntry()

{
80560NT11734A Rev. 0                         Page 40 of 65                             2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

---//All system initializations are done here-

---

}

5.2.2.          Load OV from External Flash to OV Chip via SPI
First boot case applet loads without any notification which starts loading OV from external flash by
calling App_OVInit () that initializes OV.
Code Ref:

AppOV_Init(){

---//All system initializations are done here-

---

AppVideo_OVBootupFirmwareTransfer() // This functions initializes SPI for loading
bootloader and firmware to OV chip.

}

App_OVInit() contains AppGpioConfig_OVInit() which initializes I/O expander in
AppGpioConfig_Initialize(). This also creates I2C interface between GS and OV that
helps us to reset OV.

After first boot, the module goes to standby and wakeup, loads the applet by getting notification
from DAB Ready Indication call back. App_NwRecvFilter finds the packet type. If it is mDNS or
RTSP packet it pushes OV initialize message to App main Task message queue which is then
processed by AppSm_MsgProcess function.
OV Load PSPOLL Boot:

BOOL

App_NwRecvFilter (GSN_NWIF_CTX_T *pNwIf, UINT32 pktLen,

                       GSN_ETHERNET_FRAME_T *pEthFrame)

{

     --//Check for Packet type and push message to MainTask.

    if((GSN_SYS_IS_PS_BOOT_NORMAL() == TRUE ) && ((dType == APP_RTSP_PKT)

                  || (dType == APP_MDNS_PKT)) && (isOVInitDone == FALSE))

          {

              /*Initialise OV Once data request received */

              AppMainCtx_TaskNotify(APP_EVENT_OV_START, 0);

}

PUBLIC GSN_STATUS

AppSm_MsgProcess (APP_MAIN_CTX_T *pAppCtx, APP_MAINTASK_MSG_T msg )

{

80560NT11734A Rev. 0                       Page 41 of 65                                 2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

     case APP_EVENT_OV_START :

     {

          /* Flash OV binary to OV chip*/

          App_OVInit();

         }

         break;

}

Telit module performs the following steps to load OV firmware from external flash to OV chip
through SPI interface:

     1. Initially, the Wi-Fi module checks the actual length of the OV bootloader and provides the
        clock configuration with speed of 1 MHz

              NOTE: Telit SPI interface is the master and OV chip is the SPI slave.

     2. The module sends the header configuration parameters to the Video chip.

     3. Once OV receives header successfully, it sends ACK(0x48454144) to the module.

     4. Next, the module sends bootloader to OV through the SPI interface.

     5. Once OV receives the bootloader successfully, OV send an ACK(0x46574F4B) to the
        module.

     6. The Wi-Fi module changes the SPI clock to 10MHz and sends double data rate(DDR),
        MPU, and firmware binaries.

               NOTE: Before sending the above binaries, the module must send 4 bytes of
               header which informs the Video chip about the data flow.

    5.2.3. Start RTSP Server (and RTP Task)

     2. At this point of time, OV binary is loaded to the OV chip, and the main task is completed
        by creating RTP and RTSP tasks.

         Code Ref:
         AppRtsp_Init(){

             --- //All system initializations are done here-

             ---

             #ifdef RTSP_SERVER_EN

                //It acts like interface between App and VideoEnc chip

                // that performs start,stop the encoder and do encode audio.video frames

80560NT11734A Rev. 0                        Page 42 of 65                              2019-01-22
GS2K OV1080p HD Full-Duplex Audio Video ADK Application Note

           AppVideoEnc_ThreadStart();

           // Register application call back function to

           // Notifies when encoded frame is Ready

           AppVideoEnc_EventCbReg(AppRemainInit_VideoEncEventNotify);

           //Create RTSP Server socket and handles the RTSP methods

           RTSPThreadStart();

                AppVideoThreadSendStart();

                AppAudioThreadSendStart();

           //Register application call back function to get Notify when

           //event occur in RTSP framework

           GsnRtsp_EventNotifyCbReg(AppVideo_RtspCb);

       #endif

              NOTE:

              •   RTSP_SERVER_EN - Macro to enable the RTSP session

              •   RTSP_AUD_EN - Macro to enable forward Audio

              •   AUDIO_ONLY - Macro to enable audio only session

              •   RTSP_CLIENT_EN - Macro to enable reverse audio

   3. GS module starts the RTSP and RTP services after the boot loader and OV firmware are
      loaded on to the video chip. When RTSP receives the PLAY request, sets the status to
      running. RTP waits until the server state goes to running, reads the video and audio data
      over SPI interface and send the video and audio to the smartphone over the air. At the
      same time RTSP client task establish UDP connection waiting for audio data from smart
      phone. Once the user press call back button on Native app audio data starts streaming
      from smart phone to GS module.

          NOTE: RTSP uses the standard port number 554.

 5.2.4. RTSP Message Exchanges
RTSP task is handled in the function call RTSPThreadStart() and the detailed description is as
follows.

For more details about the code flow, refer section A.1.1 RTSP SDK Reference Code Flow.

80560NT11734A Rev. 0                     Page 43 of 65                              2019-01-22
You can also read
NEXT SLIDES ... Cancel