WRITING AN EMBEDDED APPLICATION LOADER
5
LZT 123 8094 R1A
2
Overview
To download a script to the module the file transfer needs
to follow certain procedures and formats. The following
sections describe these and enable the developer to write
their own loader which will work in conjunction with the
module.
2.1 AT
commands
The download is initially started off using AT commands,
specifically they are AT*E2APD and AT*E2APC these are
described in full in the GR47 AT commands manual.
2.2 The first packet
The first packet is sent to the unit to give it some
information about the script that is about to be downloaded
this aids a more reliable download. It is downloaded in X
modem protocol as described in section 2.3.1.
The first packet consists of the following information about
the script.
1. Number of lines (first 2 bytes)
2. Number of constants (second 2 bytes)
3. Number of tokens (third 2 bytes)
4. Number of keywords (fourth 2 bytes)
5. Number of identifiers (fifth 2 bytes)
Note!
These values are sent little-endian (low byte, high byte).
As per the description of the X modem packet any unused
bytes of the 128 byte word are packed out with FF’s and
the CRC checksum calculated as normal.
When downloading with the IDE it will calculate these
numbers and then create the packet itself. To have this
implemented in an application it needs to calculate these
figure from the script. These numbers should be
calculated using the tool described in section 2.4.