background image

 

WRITING AN EMBEDDED APPLICATION LOADER 

 
 
 

  

 

LZT 123  8094 R1A 

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. 

Содержание Writing an embedded application loader

Страница 1: ...Application Note Writing an embedded application loader ...

Страница 2: ... Mobile Communications reserves the right to make modifications additions and deletions to this manual due to typographical errors inaccurate information or improvements to programs and or equipment at any time and without notice Such changes will nevertheless be incorporated into new editions of this manual All rights reserved Sony Ericsson Mobile Communications 2005 ...

Страница 3: ... AN EMBEDDED APPLICATION LOADER LZT 123 8094 P1A 3 Contents 1 Introduction 4 2 Overview 5 2 1 AT commands 5 2 2 The first packet 5 2 3 Subsequent packets 6 2 3 1 Xmodem CRC Protocol CCITT 6 2 4 SLP DLL tool 9 ...

Страница 4: ...edded application onto a GR or GT module In this case the developer needs to write a loader for themselves The integrators manual provides the integrator with some information but not enough to complete development of such a tool This application note provides the rest of the required information and explains some further tools that SonyEricsson have developed to aid in the implementation ...

Страница 5: ... 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...

Страница 6: ...he first packet bytes 128 255 make up the second packet etc The packet number sent is simply the number of the packet packet number starts at 0 at beginning of transmission If the packet number is greater than 255 then subtract 256 repeatedly until the number is between 0 and 255 For example if you were sending packet 731 then you would send 731 256 256 219 The 1 s complement of a byte is simply 2...

Страница 7: ...llowing elements 1 SOH byte 1 byte 2 The packet number 1 byte 3 The 1 s complement of the packet number 1 byte 4 The packet 128 bytes 5 The high byte of the CRC 16 1 byte 6 The low byte of the CRC 16 1 byte Note The CRC is calculated on the data packet only not including the header The CRC is also sent little endian so above should be 5 low byte CRC 6 high byte CRC The downloader 1 Ensures that th...

Страница 8: ...n of the block When the uploader sends an EOT byte instead of an SOH byte the downloader sends a NAK byte If the uploader sends another EOT immediately after that the downloader sends an ACK byte and the transfer is complete The downloader can cancel the transfer at any time by sending a CAN byte The uploader can only cancel between blocks by sending a CAN byte It is recommended that the applicati...

Страница 9: ...the first packet are calculated by the IDE using the SLP DLL file In the file package contained on the extranet SLP_loader_code zip is the current version of slp dll slpdll lib and header files with all the required definitions This should make linking across to slp dll quite straightforward ...

Отзывы: