comparison loadtools/loadtool.help @ 105:02cb0206aa47

fc-loadtool help implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 03 Sep 2013 07:31:26 +0000
parents
children 4f8a9b2229e9
comparison
equal deleted inserted replaced
104:f65df1d640aa 105:02cb0206aa47
1 This is the help file for fc-loadtool. See lthelp.c for the code
2 that parses and displays it. The parsing code is the only
3 documentation for the format of this help file - if you are going to
4 edit this help text, read the parsing code first.
5
6 === main
7 This utility allows you to perform the following operations
8 on your Calypso GSM device:
9
10 * Peek and poke registers
11 * Dump any part of memory
12 * Read and program flash
13
14 See the following help topics for more information:
15
16 help peekpoke Register peek and poke commands
17 help flash Flash operation commands
18 help all List of all implemented commands
19 help exit Controlling the cleanup on exit
20
21 === all
22 baud Switch the serial comm with loadagent to a different baud rate
23 crc32 Get CRC-32 of a memory area on the target
24 dieid Read the Calypso die ID
25 dump Dump a target memory region in hex and ASCII
26 dump2bin Dump a target memory region to a file in binary format
27 dump2srec Dump a target memory region to a file in S-record format
28 exec Execute a command script
29 exit Exit from loadtool and clean up the target device state
30 flash Flash operations
31 flash2 Operations on the 2nd flash bank (Pirelli phone only)
32 quit Alias for exit
33 r8 Read an 8-bit register or memory location
34 r16 Read a 16-bit register or memory location
35 r32 Read a 32-bit register or memory location
36 w8 Write an 8-bit register or memory location
37 w16 Write a 16-bit register or memory location
38 w32 Write a 32-bit register or memory location
39
40 To get help on any command, type help and the command keyword.
41
42 === baud
43 baud Display the current baud rate
44 baud <rate> Switch the baud rate to <rate> (number in bps)
45
46 The supported baud rates are:
47
48 Standard: 19200, 38400, 57600, 115200
49 Calypso special: 203125, 406250, 812500
50
51 The baud command coordinates the necessary simultaneous switching of the
52 baud rate on both the host and the target (loadagent). Loadagent always
53 supports all of the listed rates and will switch happily, but in the case
54 of the higher non-standard baud rates fc-loadtool has no way of knowing
55 ahead of time whether or not the requested baud rate is supported by your
56 usb2serial adapter or whatever other serial port hardware and driver
57 you are using. If the baud rate switch fails, the communication link with
58 the target will be broken and fc-loadtool will exit ungracefully.
59
60 === crc32
61 crc32 hex-start hex-len
62
63 The first argument is the starting target memory address in hex; the second
64 argument is the length of the area to CRC, also in hex. The command will be
65 sent to loadagent; CRC-32 of the requested range will be computed on the target
66 and displayed in hex.
67
68 === dieid
69 dieid Display the Calypso die ID
70 dieid <filename> Display the Calypso die ID, and also save it in the
71 named file
72
73 The Calypso die ID resides in 4 16-bit registers at target addresses
74 0xFFFEF010 through 0xFFFEF016. It is displayed on the terminal and optionally
75 saved to a file in this simple form:
76
77 FFFEF010: xxxx
78 FFFEF012: xxxx
79 FFFEF014: xxxx
80 FFFEF016: xxxx
81
82 === dump
83 dump hex-start hex-len
84
85 The first argument is the starting target memory address in hex; the second
86 argument is the length of the area to dump, also in hex. The dump will be
87 displayed on the terminal in hex and ASCII.
88
89 === dump2bin
90 === dump2srec
91 dump2bin hex-start hex-len outfile
92 dump2srec hex-start hex-len outfile
93
94 The first argument is the starting target memory address in hex; the second
95 argument is the length of the area to dump, also in hex; the third argument
96 is the name of the output file to be created/written. The dump will be saved
97 in binary or S-records as per the chosen command, always in the native byte
98 order of the Calypso ARM7 target (little-endian).
99
100 === exec
101 exec <script-file>
102
103 Read and execute commands from the named file. If the given file name contains
104 no slashes, the script file is sought in the default directory (normally
105 /usr/local/share/freecalypso unless changed in the code); otherwise the given
106 name is used directly as the pathname.
107
108 === exit
109 === quit
110 exit Clean up the target in the default manner and exit
111 exit bare Exit loadtool without doing anything to the target
112 exit jump0 Exit loadtool and command the target to reboot via jump to 0
113
114 The default method of cleaning up the target device state upon exit is set
115 in the hardware parameters file selected with the -h or -H command line
116 option; it is the exit-mode setting. On the Pirelli phone the default exit
117 mode is jump0: it causes the phone to reboot and enter the "charging boot"
118 mode, as the USB cable is connected and VBUS is present.
119
120 If your device is a GTA02 and you are running fc-loadtool from inside the phone
121 (from the AP), the exit command will power off the modem from the AP. If you
122 are talking to GTA02 Calypso from an external host via the headset jack, there
123 is nothing that fc-loadtool can currently do to power the modem off (exit is
124 the same as exit bare in this case) - power it off yourself from the AP.
125
126 If you do an exit bare without powering the target device off in some other
127 way, the device will still be running loadagent, which is probably not what you
128 want. However, it is the proper exit mode if you have powered off or reset the
129 target device by brute force (yanking the battery).
130
131 === flash
132 === flash2
133 The primary end use of fc-loadtool is for reading and writing the NOR flash
134 memories of the supported GSM devices. The GTA0x GSM modem has only one 4 MiB
135 flash bank (as in chip select), and is manipulated with the flash command.
136 The Pirelli phone has two flash banks (as in chip selects) of 8 MiB each; they
137 are manipulated with the flash and flash2 commands.
138
139 The following flash operations are available:
140
141 flash blankchk Blank-check a region of flash
142 flash dump2bin Dump flash content to a file in binary format
143 flash dump2srec Dump flash content to a file in S-record format
144 flash erase Erase a region of flash
145 flash info Display flash configuration info
146 flash program-bin Program flash with a binary file
147 flash program-m0 Program flash with an image in TI's *.m0 format
148 flash program-srec Program flash with an image in standard S-record format
149 flash quickprog Program a few flash words from the command line
150 flash sectors Display the list of flash sector addresses and sizes
151
152 Substitute flash2 instead of flash when operating on the 2nd flash chip select
153 of Pirelli-style flash memory configurations. Prepend help before a command to
154 get usage information, e.g., help flash program-bin.
155
156 === flash:blankchk
157 flash[2] blankchk hex-start-offset hex-length
158
159 Blank-checks an area of flash starting at the specified hex offset (from the
160 base address of the flash bank) and extending for the specified hex length.
161 Reports whether the checked region is blank or not. Flash must be blank (FF in
162 all bytes) before it can be programmed.
163
164 === flash:dump2bin
165 flash[2] dump2bin outfile [offset [length]]
166
167 Read device flash content and save it to a file. If only a filename is
168 specified, the full flash bank is dumped; one can optionally specify a starting
169 offset and an explicit length, both in hex.
170
171 This command is merely a user-friendly front-end to the plain dump2bin command;
172 see help dump2bin.
173
174 === flash:dump2srec
175 flash[2] dump2srec outfile [offset [length]]
176
177 Read device flash content and save it to a file. If only a filename is
178 specified, the full flash bank is dumped; one can optionally specify a starting
179 offset and an explicit length, both in hex.
180
181 This command is merely a user-friendly front-end to the plain dump2srec command;
182 see help dump2srec.
183
184 === flash:erase
185 flash[2] erase hex-start-offset hex-length
186
187 Erases an area of flash starting at the specified hex offset (from the base
188 address of the flash bank) and extending for the specified hex length.
189
190 Flash memory can only be erased (turning 0 bits back to 1s) in units of
191 sectors, as set in stone by the design of the flash chip in use. Loadtool
192 knows the sector layout of the flash chip in your device from the hardware
193 parameters file (you can display it with the flash[2] sectors command), and
194 enforces that both arguments to the flash[2] erase command lie on sector
195 boundaries.
196
197 === flash:info
198 This command displays summary information about the flash memory configuration
199 of the Calypso target device loadtool thinks it's talking to.
200
201 === flash:program-bin
202 flash[2] program-bin flash-offset binfile [file-offset [length]]
203
204 This command programs flash, using a binary file as the data source. One must
205 always specify the starting flash offset (from the base address of the flash
206 bank), but the starting file offset and length are optional, defaulting to the
207 whole file.
208
209 The binary file must be in the native byte order of the Calypso ARM7 processor,
210 which is little-endian. Images produced by flash[2] dump2bin are suitable.
211
212 === flash:program-m0
213 flash[2] program-m0 image.m0
214
215 *.m0 is the format that has been used by companies like TI and Closedmoko for
216 their proprietary firmware images. It is emitted by TI's hex470 tool, and in
217 the proprietary environment it is fed as an input to FLUID. (The latter is
218 TI's Flash Loader Utility Independent of Device, and fc-loadtool can be seen as
219 an independent reimplementation thereof - although it doesn't have the same
220 level of device-independence.) The *.m0 format is actually a variant of
221 Motorola's SREC, but with a different byte order: each 16-bit word is
222 byte-reversed relative to the native byte order of the ARM7 processor.
223 (This strange byte order actually makes some sense if one views the image as a
224 long array of 16-bit hex values; 16 bits is the width of the flash memory on
225 Calypso GSM devices and thus the natural unit size for flash programming.)
226
227 Because each S-record contains an address, no addresses or offsets need to be
228 specified in the flash[2] program-m0 command, only the image file.
229
230 === flash:program-srec
231 flash[2] program-srec image.srec
232
233 This command programs the flash with an image in the standard S-record format,
234 in the native little-endian byte order of the Calypso ARM7 processor. It is
235 the opposite byte order from that used by TI's and Closedmoko's *.m0 files -
236 see help flash program-m0. Images produced by flash[2] dump2srec are suitable
237 for flash[2] program-srec.
238
239 Because each S-record contains an address, no addresses or offsets need to be
240 specified in the flash[2] program-srec command, only the image file.
241
242 === flash:quickprog
243 flash[2] quickprog hex-offset hex-data-string
244
245 This command is intended only for developers; it provides raw access to
246 loadagent's basic flash write primitive. Read the source code for more
247 information.
248
249 === flash:sectors
250 This command displays the list of sector offsets and sizes for the flash chip
251 in the Calypso target device loadtool thinks it's talking to.
252
253 === r8
254 === r16
255 === r32
256 === w8
257 === w16
258 === w32
259 === peekpoke
260 The register peek and poke commands are:
261
262 r8 addr Read an 8-bit register or memory location
263 r16 addr Read a 16-bit register or memory location
264 r32 addr Read a 32-bit register or memory location
265 w8 addr data Write an 8-bit register or memory location
266 w16 addr data Write a 16-bit register or memory location
267 w32 addr data Write a 32-bit register or memory location
268
269 All addresses and data values are in hex.
270