GS2K Module Programming and Protocol Reference Rev 1
GS2K Module Programming and Protocol Reference Rev 1
GS2K Module Programming and Protocol Reference Rev 1
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.
PRODUCT
GS2K based Modules
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.
GS2K Module Programming and Protocol Reference Guide
Table of Contents
This manual provides information required to program the GainSpan® GS2000 based
modules using host interfaces like UART and SPI through individual commands, formats,
and protocols. It describes memory map and file systems used to control how data is
tracked, organized, stored and retrieved during different types of operations.
Refer to the following sections:
• Revision History, page 8
• Audience, page 8
• Standards, page 8
• Documentation Conventions, page 9
• Documentation, page 12
• References, page 14
• Contact Information, Support, page 16
• Returning Products to GainSpan, page 17
• Accessing the GainSpan Portal, page 18
Revision History
This version of the GainSpan GS2000 Based Module Programming and Protocol
Reference Guide contains the following new information listed in Table 1, page 8.
Audience
This manual is designed for software engineers who want to know how to program the
on-board Flash and describes the software and host interfaces, memory map file structure
of the GS2000 based module commands, and steps for programming binaries and firmware.
It is also intended for users of boot ROM commands who want to know the available
commands and formats.
Standards
The GainSpan GS module series supports the IEEE 802.11 b/g/n standards.
Documentation Conventions
This manual uses the following text and syntax conventions:
– Special text fonts represent particular commands, keywords, variables, or window
sessions
– Color text indicates cross-reference hyper links to supplemental information
– Command notation indicates commands, subcommands, or command elements
Table 2, page 9, describes the text conventions used in this manual for software procedures
that are explained using the AT command line interface.
UPPERCASE Indicates user input. Enter a value according to the descriptions that
follow. Each uppercased token expands into one or more other token.
Variable parameter
Table 3, page 11, describes the symbol conventions used in this manual for notification and
important instructions.
Documentation
The GainSpan documentation suite listed in Table 4, page 12 includes the part number,
documentation name, and a description of the document. The documents are available on
the GainSpan Portal. Refer to , page 17 for details.
Table 4 Documentation List
Part Number Document Title Description
Provides users steps to program the
on-board Flash utilizing either UART
or SPI interface for the GainSpan
GS2000 based modules using DOS or
1VV0301435 GS2K Module Evaluation Board Hardware User Guide
Graphical User Interface utility
provided by GainSpan. The user guide
uses the evaluation boards as a
reference example board.
GS2011M S2W Adapter Command Reference Guide Provides a complete listing of AT serial
GS2100M S2W Adapter Command Reference Guide commands, including configuration
1VV0301463 examples for initiating, maintaining,
GS2101M S2W Adapter Command Reference Guide and evaluating GainSpan WiFi
GS2200M S2W Adapter Command Reference Guide GainSpan series modules.
Documentation Feedback
We encourage you to provide feedback, comments, and suggestions so that we can improve
the documentation. You can send your comments by logging into Telit Support Portal. If
you are using e-mail, be sure to include the following information with your comments:
– Document name
– URL or page number
– Hardware release version (if applicable)
– Software release version (if applicable)
References
The GainSpan references listed in Table 5, page 14 are available on the GainSpan Portal.
Refer to , page 17 for details.
NOTE: Do not return any components to GainSpan Corporation unless you have
first obtained an RMA number. GainSpan reserves the right to refuse shipments
that do not have an RMA. Refused shipments will be returned to the customer by
collect freight.
NOTE: You must first contact GainSpan to set up an account, and obtain a
customer user name and password before you can access the GainSpan Portal.
This chapter provides information about programming the GS2000 based modules and
describes the procedure to transfer binaries into the modules. It is assumed that the reader
is generally familiar with GainSpan® SoC products, Internet Protocol (IP) networks and
the operation and management of 802.11 wireless devices.
• Programming Mode, page 19
• GS2000 Boot ROM Flow in Program Mode, page 24
• Host Interface Overview, page 25
Table 6, page 20 describes the boot control pin functions for the GS2000 based module.
NOTE: Both GPIO25 and GPIO21 MUST NOT be high in Run Mode at reset
release.
NOTE: GPIO27 (or GPIO31), GPIO25, and GPIO21 should ONLY be used as
outputs, and should not be used as inputs.
NOTE: In Run Mode, Boot ROM leaves all GPIO pins as input with pull resistor
enabled until flash code sets them.
NOTE: In Program Mode, only the pins required for the Program Mode specified
interfaces are set to non-gpio mode.
• UART0 Interface: It is used to program the module flash and it runs with the
following settings:
Baud rate: 115200/921600 bps
Data: 8 bits
Parity: None
Stop: 1 bit
Flow control: None
Figure 1, page 21 shows the UART interface between the GS2000 based module and a
Host.
• SPI0 Interface: It is used to program the module flash using a SPI master.
SPI Mode: Mode 1
SPI Clock: Up to 1.3MHz using Cheetah SPI adapter, 4MHz using Aardvark SPI
adapter (www.totalphase.com for SPI adapters)
SPI Bit Order: MSB first
Slave Select: Active Low
Figure 2, page 22 shows the SPI interface between the GS2000 based module acting as an
SPI Slave and a SPI Master.
Figure 2 SPI Interface Between GS2000 Based Module and SPI Master
3. HI Parameters: It is the section that consists of data specific for relevant messages.
For more information, refer Chapter 2 Download Class Messages, page 27.
NOTE: The multi-byte fields in all of the commands are specified with lower byte
first. That means 0x40080000 would be seen as 00 00 08 40.
This chapter describes the format of different messages in download class. Figure 5,
page 27 shows the HI frame for Download Class Messages. The class field of HI Header
contains value 0x02 for Downloaded Class Messages.
• Download Request, page 28
• Copy Request, page 29
• Error Indication, page 30
• Ack (Acknowledgment), page 31
NOTE: What is a File? The binary which needs to be downloaded is divided into
multiple fragments and each fragment (maximum of 16KB) is termed as a File.
Example - Download Table 8, page 28 shows the Download Request Command and Response that is
Request Command sent/received to/from the GS2000 based module.
and Response
Table 8 Download Request Command and Response
Command Response Ack
A5 02 00 00 00 ED 03 0D 01 00 00 40 A5 02 00 00 00 02 00 FB 05 00
00 00 E1 03 00 00 00 00 66 77 6F 6B
FF FF FF FF 50 00 00 00 04 30 00 00
00 ……
Example - Copy Table 10, page 29 shows the Copy Request Command and Response that is sent/received
Request Command to/from the GS2000 based module.
and Response
Table 10 Copy Request Command and Response
Command Response Ack
A5 02 00 00 00 16 00 E7 82 11 00 00 A5 02 00 00 00 02 00 FB 05 11
01 00 00 40 00 00 00 00 00 00 3A D9
EC FF 00 00 00 08
This chapter provides various boot ROM commands for the GS2000 based module for
reading and writing registers, memory and external flash through flash interface. This
chapter also describes the commands and their responses with examples. The HI Frame
Format including Download Class, Download Request, Copy Request, Error Indication,
and Ack are described in Chapter 1 Programming the GS2000 Based Modules, page 19.
• RegPeek, page 36
• RegPoke, page 37
• MemRead, page 38
• MemWrite, page 39
• FlashRead, page 40
• FlashErase, page 41
• FlashEraseCheck, page 42
• FlashCheckSum, page 43
• Execute at Address, page 44
• WLAN Start, page 45
• WLAN Stop, page 46
Figure 11, page 35 shows the ROM debug message format that forms the data portion of
messages, i.e., HI Parameters portion.
3.1 RegPeek
Command Table 13, page 36 describes the RegPeek Command Format.
Notes:
1. Both request and response contain [addr, val, width] tuples even though request does
not really need to contain val.
2. The maximum number of registers is limited by maximum HI frame size; i.e., 1500
bytes.
3. HI Header Additional Info field set to 1 to send the message to WLAN.
4. There shall be additional Addr, Val and Width fields (tuple) required in case there are
more than one register.
5. Content of the response frame in this case shall be same as request frame except the
response opcode = (request opcode + 0x40).
Example - RegPeek Table 15, page 37 shows the RegPeek Command and Response that is sent/received to/from
Command and the GS2000 based module.
Response
Table 15 RegPeek Command and Response
Command Response
A5 07 00 00 00 11 00 E7 41 01 00 00 A5 07 00 00 00 11 00 E7 81 01 00 00 00
00 00 00 08 40 00 00 00 00 04 00 00 00 00 08 40 50 50 41 00 04 00 00 00
00
3.2 RegPoke
Command Table 16, page 37 describes the RegPoke Command Format.
Notes:
1. Request contain [addr, val, width] tuples.
2. The maximum number of registers is limited by maximum HI frame size; i.e., 1500
bytes.
3. HI Header Additional Info field set to 1 to send the message to WLAN.
4. There shall be additional Addr, Val, and Width fields (tuple) required in case there are
more than one register.
5. Content of the response frame in this case shall be same as request frame except the
response opcode = (request opcode + 0x040).
Example - RegPoke Table 17, page 38 shows the RegPoke Command that is sent to the GS2000 based module.
Command
Table 17 RegPoke Command
Command Response
A5 07 00 00 00 11 00 E7 42 01 00 00 -
00 18 00 08 40 78 56 34 12 04 00 00
00
3.3 MemRead
Command Table 18, page 38 describes the MemRead Command Format.
Notes:
1. HI Header Additional Info field set to 1 to send the message to WLAN.
2. The maximum number of registers is limited by maximum HI frame size; i.e., 1500
bytes.
3. Content of the response frame in this case shall be same as request frame except the
response code = (request code + 0x40).
Example - MemRead Table 20, page 39 shows the MemRead Command and Response that is sent/received
Command and to/from the GS2000 based module.
Response
Table 20 MemRead Command and Response
Command Response
A5 07 00 00 00 09 00 EF 43 00 05 04 A5 07 00 00 00 19 00 DF 83 00 05 04 20
20 10 00 00 00 10 00 00 00 00 00 00 00 33 33 00 3E 45
49 4D 31 31 30 32 00
3.4 MemWrite
Command Table 21, page 39 describes the MemWrite Command Format.
Notes:
1. HI Header Additional Info field set to 1 to send the message to WLAN.
2. The maximum number of registers is limited by maximum HI frame size; i.e., 1500
bytes.
3. Content of the response frame in this case shall be same as request frame except the
response code = (request code + 0x40).
Example - MemWrite Table 22, page 39 shows the MemWrite Command that is sent to the GS2000 based module.
Command
Table 22 MemWrite Command
Command Response
A5 07 00 00 00 F7 03 FE 44 00 00 03 -
20 EE 03 00 00 80 B5 00 F0 ED FA 01
BD 2D E9 F2 4F 84 B0 07 00 15 00 1C
00 5F ……
3.5 FlashRead
Command Table 23, page 40 describes the FlashRead Command Format.
Notes:
1. The maximum read data is limited by maximum HI frame size; i.e., 1500 bytes.
2. Content of the response frame in this case shall be same as request frame except the
response code = (request code + 0x40).
Example - FlashRead Table 25, page 40 shows the FlashRead Command and Response that is sent/received
Command and to/from the GS2000 based module.
Response
Table 25 FlashRead Command and Response
Command Response
A5 07 00 00 00 09 00 EF 46 00 00 01 A5 07 00 00 00 15 00 E3 86 00 00 01 00
00 0C 00 00 00 0C 00 00 00 66 77 6F 6B FF FF FF FF 50
00 00 00
3.6 FlashErase
Command Table 26, page 41 describes the FlashErase Command Format.
Note:
1. The minimum erase size for Flash erase is 4096 bytes. Less than that would yield
success but no operation.
Notes:
1. The maximum read data is limited by maximum HI frame size; i.e., 1500 bytes.
2. Content of the response frame in this case shall be same as request frame except the
response code = (request code + 0x40).
Example - Table 28, page 41 shows the FlashErase Command and Response that is sent/received
FlashErase to/from the GS2000 based module.
Command and
Response
Table 28 FlashErase Command and Response
Command Response
A5 07 00 00 00 09 00 EF 49 00 00 00 00 00 A5 07 00 00 00 09 00 EF 89 00 00 00 00 00
00 40 00 00 40 00
Notes:
1. If the length is 4095 bytes, then nothing will get erased. However you will see boot
ROM returning success.
2. If the length is 4096 bytes are erased, then 4K sector of the Flash gets erased.
3. If the length is 4097 bytes get erased, then it will erase 8K sector (assuming the start
address is 0x00000000).
3.7 FlashEraseCheck
Command Table 29, page 42 describes the FlashEraseCheck Command Format.
Example - Flash Table 31, page 42 shows the Flash Erase Check Command and Response that is
Erase Check sent/received to/from the GS2000 based module.
Command and
Response
Table 31 Flash Erase Check Command and Response
Command Response
A5 07 00 00 00 09 00 EF 4D 00 00 20 00 00 00 20 A5 07 00 00 00 09 00 EF 8D 00 00 20 00
00 00 00 06 00
The use of FlashEraseCheck is to reduce the erase time. Erasing an entire 2MB flash is a
costly operation. The erase command takes the longest time to execute in the GS2000. In
order to save time for erasing, perform an erase check which returns how much of the flash
is erased. Based on this value, you can calculate how much flash needs to be erased and
erase only that portion.
As mentioned previously in this document, you can do a binary search operation type Erase
check in our FlashProgram tool; so for a 2MB:
1. Check from 0x100000 to 0x200000. If this check returns with a value indicating “not
erased.” it is assumed there would be data between 0x000000 to 0x200000 and erase
entire 2MB from 0x00 location.
2. Check from 0x80000 to 0x100000. If check returns with a value indicating “not
erased,” then it is assumed there would be data between 0x000000 to 0x100000 and
erase 1MB from 0x00 location.
3. Check from 0x80000 to 0x100000. If this check returns with a value indicating “not
erased,” it is assumed there would be data between 0x000000 to 0x80000 and erase
512KB from 0x00 location.
4. Continue the check till you find some data and execute the erase command else
indicate flash was erased already.
Erasing 4MB takes 22 seconds, but erasing 2MB takes around 12 seconds. So with the
combination of erase check and erase, you might have to do an erase of only 1MB of
the flash (since the single image firmware and Super Block is less than 1MB
combined). This could save a few seconds.
3.8 FlashCheckSum
Command Table 32, page 43 describes the FlashCheckSum Command Format.
Example - Flash Table 34, page 43 shows the Flash Checksum Command and Response that is sent/received
Checksum to/from the GS2000 based module.
Command and
Response
Table 34 Flash Checksum Command and Response
Command Response
A5 07 00 00 00 09 00 EF 4C 00 10 01 00 00 E0 0F A5 07 00 00 00 05 00 F3 8C 52 1B 09 B7
00
Note:
1. Thumb bit has to be set for execute command (0x20010000 is address to write data
then in execute command give it as 01 00 01 20).
Response Table 36, page 44 describes the Execute at Address Response Format.
Note:
1. HI Header Additional Info field is set to 1 to send the message to WLAN.
Example - Execute at Table 37, page 44 shows the Execute at Address Command and Response that is
Address Command sent/received to/from the GS2000 based module.
and Response
Table 37 Execute at Address Command and Response
Command Response
A5 07 00 00 00 05 00 F3 45 01 00 03 20 A5 07 00 00 00 05 00 F3 85 00 01 00 03
Response Table 39, page 45 describes the WLAN Start Response Format.
Example - WLAN Table 40, page 45 shows the WLAN Start Command and Response that is sent/received
Start Command and to/from the GS2000 based module.
Response
Table 40 WLAN Start Command and Response
Command Response
A5 07 00 01 00 01 00 F6 47 -
Response Table 42, page 46 describes the WLAN Stop Response Format.
Example - WLAN Table 43, page 46 shows the WLAN Stop Command and Response that is sent/received
Stop Command and to/from the GS2000 based module.
Response
Table 43 WLAN Stop Command and Response
Command Response
A5 07 00 01 00 01 00 F6 48 -
This chapter provides an overview about the Memory Map and types of file system
structure used in GainSpan® GS2000 based modules. This manual also reviews the Flash
structure and provides necessary information required to understand. The GS2000 based
modules use different types of memory maps and file systems to control how data is stored
and retrieved. Applications use these memory maps and file system to track, organize,
store, and retrieve files during various operations. The chapter mainly focuses on the
in-module flash.
• Flash Structure, page 48
• Firmware Block, page 53
• In-Module Flash File System, page 57
Table 46, page 55 describes the Control Block in Module Flash fields.
NOTE: It is not recommended to modify the static file system using Application
software. For example, adding new file using API fopen, write operations, or
modify operations are not recommended.
NOTE: It is recommended to use the Dynamic File System for storing custom
information (e.g., sensor data, data logs, etc.). Custom applications that need
data logging size of lesser than 128KB can use the On-module Dynamic File
System. If the requirement is more than 128KB, it is highly recommended to use
the external flash system.
This chapter provides instructions on how to program binaries and how the information
given in the previous chapters are implemented in the GainSpan® gs2k_flashprogram tool.
This will allow you to build your own programming tool.
• Programming the Binaries, page 59
• Programming At One Location, page 64
• Programming At Multiple Locations, page 64
Super Block
The Super Block binary gets programmed at the 0x00000000 location (see Figure 15,
page 60). “superblock_4MB_3_Copy.bin” is the name of the Super Block provided. Every
Super Block includes a Boot ROM Super Block and an Application Super Block. The
address where the Single Image Firmware would get programmed is taken from the
Application Super Block. The Application Super Block starts at 0x1000 location of the
main Super Block (see 4.1.1 Super Block Structure, page 49).
Single Image Firmware: The Single Image gets programmed at FW0 Control Block
Address Field as shown in the illustrations below. This address would change based on the
Super Block being used so it has to be read from the Super Block. In case of the
superblock_4MB_3_Copy.bin, this address would be 0x00010000.
After the Single Image is programmed, you need to extract the first 4KB of the Single
Image and Program it at the FW0 Backup Control Block address which is 0x001f0000 in
case of the binaries sent. This 4KB is called as the Control Block. The Control Block is a
part of the Single Image at the beginning but in order to complete the Firmware Block you
need to put the same Control Block copied from the Single Image at the Backup Control
Block location.
Update the REVISION Number field in both the Control Block areas. The default revision
field of the Control Block (copied from the first 4KB of Single Image) contains
0xFFFFFFFF (see Figure 17, page 63). This should be modified to 0x01 (see 4.2.1 Control
Block, page 54).
Programming
Every GainSpan module flash can have one or more than one firmware at a time. The
firmware with the highest REVISION number is the copy that would be active and is called
as the CURRENT VERSION.
The firmware with the lowest REVISION number is called the FACTORY VERSION and
the firmware with a REVISION number between the highest and the lowest REVISION
numbers is the PREVIOUS VERSION.
Select three options for firmwares other than for Super Block Image:
• Current Version
• Previous Version
• Factory Version
Figure 16, page 62 shows the flash memory structure for Two Firmware Model or Three
Firmware Model.
Case 1 - Regardless of the Super Block file selected, program the firmware at FW0 Control Block
Programming Only address with REVISION Number 0x01. This firmware would be the CURRENT
One Firmware Image VERSION.
Case 2 - Use any of the above mentioned four Super Blocks and program the CURRENT VERSION
Programming Two firmware at FW1 Control Block address with REVISON Number 0x02 and the PREVIOUS
Firmware Images VERSION firmware at the FW0 Control Block address with REVISION Number 0x01.
NOTE: The Control Block is part of the Single Image Firmware that is provided.
This is the first 4KB of the image.
The REVISION Number field in this image would be 0xFFFFFFFF and should be modified
on the flash appropriately based upon which copy is it, and which Super Block type is
selected. The same Control Block needs to be programmed at the Backup Control Block
Address as explained in the document we sent.
NOTE: For detailed explanation at byte level, refer to Chapter 2 Download Class
Messages, page 27, and Chapter 3 ROM Debug Class Messages, page 35.
Appendix A Opcodes
This chapter provides an overview of the Opcodes for the GS2000 based modules. Table
47, page 65 describes the Opcode message and command response examples.
This chapter provides an overview of the Firmware Model Memory Map for software
releases 5.1.x and 5.2.x.
Figure 18, page 68 shows the memory map for a 2MB Two Firmware Model in 5.1.x
releases.
Figure 19, page 69 shows the memory map for a 2MB Three Firmware Model in 5.1.x
releases.
Figure 20, page 70 shows the memory map for a 4MB Two Firmware Model in 5.1.x
releases.
Figure 21, page 71 shows the memory map for a 4MB Three Firmware Model in 5.1.x
releases.
Figure 22, page 73 shows the memory map for a 2MB Two Firmware Model 5.2.x releases.
Figure 23, page 74 shows the memory map for a 4MB Two Firmware Model 5.2.x releases.
Figure 24, page 75 shows the memory map for a 4MB Three Firmware Model 5.2.x
releases.