General Purpose Flash Memory General Purpose Flash Memory
XBee®/XBee-PRO SX RF Module User Guide
171
General Purpose Flash Memory
XBee/XBee-PRO SX RF Modules provide 119 512-byte blocks of flash memory that an application can
read and write to. This memory provides a non-volatile data storage area that an application uses for
many purposes. Some common uses of this data storage include:
n Storing logged sensor data
n Buffering firmware update data for a host microcontroller
n Storing and retrieving data tables needed for calculations performed by a host microcontroller
The General Purpose Memory (GPM) is also used to store a firmware update file for over-the-air
firmware updates of the device itself.
Access General Purpose Flash Memory
To access the GPM of a target node locally or over-the-air, send commands to the MEMORY_ACCESS
cluster ID (0x23) on the DIGI_DEVICE endpoint (0xE6) of the target node using explicit API frames. For
a description of Explicit API frames, see Operate in API mode.
To issue a GPM command, format the payload of an explicit API frame as follows:
Byte offset
in payload
Number of
bytes Field name General field description
0 1 GPM_CMD_ID Specific GPM commands are described
in detail in the topics that follow.
1 1 GPM_OPTIONS Command-specific options.
2 2* GPM_BLOCK_NUM The block number addressed in the
GPM.
4 2* GPM_START_INDEX The byte index within the addressed
GPM block.
6 2* GPM_NUM_BYTES The number of bytes in the GPM_DATA
field, or in the case of a READ, the
number of bytes requested.
8 varies GPM_DATA
* Specify multi-byte parameters with big-endian byte ordering.
When a device sends a GPM command to another device via a unicast, the receiving device sends a
unicast response back to the requesting device's source endpoint specified in the request packet. It
does not send a response for broadcast requests. If the source endpoint is set to the DIGI_DEVICE
endpoint (0xE6) or Explicit API mode is enabled on the requesting device, then the requesting node
outputs a GPM response as an explicit API RX indicator frame (assuming it has API mode enabled).
The format of the response is similar to the request packet: