http://www.wavecom.com/forum

Open AT ®  Release version:
4.10

Sample - External Storage

Changes

Dependencies

This sample depends on the following libraries :

Application Description

This application uses the Drivers library to access external storage chips.

As this application uses the MultiApp library, the following start/stop command has to be used to control the application execution.

 

  AT+EXTSTART (External Storage start/stop command)
CommandAnswers
AT+EXTSTART?+EXTSTART: <state>
OK
AT+EXTSTART=?+EXTSTART: (0-1)
OK
AT+EXTSTART= <state> +CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
state0-1The current application running state. This parameter is stored in non-volatile memory.0

The init entry point sent to the MultiApp library is the es_init() function. The start/stop entry points linked to the +EXTSTART command are the es_start() and es_stop() functions.

The application uses the Drivers library to store and read bytes in/from an external storage chip. It provides two AT commands, for each write and read process, and another one to select the current chip.

 

  AT+CHIP (External storage chip selection command)
CommandAnswers
AT+CHIP=?+CHIP: (0-2)
OK
AT+CHIP?+CHIP: <chip>
OK
AT+CHIP= <chip> OK
 
ParameterValues rangeDescriptionDefault value
chip0-2Used chip ID (stored in a flash object)
0: M95640 SPI E2P chip, connected on SPI2 bus
1: M24C64 I2C E2P chip, connected on I2C bus
2: NAND flash chip, connected on Parallel bus
0

 

  AT+WRITE (External storage chip write command)
CommandAnswers
AT+WRITE=?+WRITE: (0-1FFF or 7FFFFF) , (1-64 or 128)
OK
AT+WRITE= <address> , <data> OK
 
ParameterValues rangeDescriptionDefault value
address0-1FFF or 7FFFFFData start address of the bytes(or words for the NAND) to store, in hexadecimal formatmandatory
data1-64 or 128Bytes (or Word) to write in hexadecimal format
1-64 (or 128) is the maximum of bytes (or Word for the NAND) to write
mandatory

For the NAND flash, the maximum number of consecutive partial page program operations allowed in the same page is three. To avoid this protection, a Block Erase command is issued before any page program by the command +WRITE

 

  AT+READ (External storage chip read command)
CommandAnswers
AT+READ=?+READ: (0-1FFF or 7FFFFF) , (1-127)
OK
AT+READ= <address> ,[ <length> ]+READ: <address>,<data>
OK
 
ParameterValues rangeDescriptionDefault value
address0-1FFF or 7FFFFFData start address of the bytes to read, in hexadecimal formatmandatory
length1-127Maximum of bytes (or Word for the NAND) to read1
dataNARead bytes (or Word for the NAND), in hexadecimal formatNA

Updated: Tue Sep 19 17:08:22 CEST 2006;