1srec_input(1) General Commands Manual srec_input(1)
2
3
4
6 srec_input - input file specifications
7
9 srec_* filename [ format ]
10
12 This manual page describes the input file specifications for the
13 srec_cat(1), srec_cmp(1) and srec_info(1) commands.
14
15 Input files may be qualified in a number of ways: you may specify their
16 format and you may specify filters to apply to them. An input file
17 specification looks like this:
18 filename [ format ][ -ignore‐checksums ][ filter ... ]
19
20 The filename may be specified as a file name, or the special name “-”
21 which is understood to mean the standard input.
22
23 Grouping with Parentheses
24 There are some cases where operator precedence of the filters can be
25 ambiguous. Input specifications may also be enclosed by ( parentheses
26 ) to make grouping explicit. Remember that the parentheses must be
27 separate words, i.e. surrounded by spaces, and they will need to be
28 quoted to get them past the shell's interpretation of parentheses.
29
30 Those Option Names Sure Are Long
31 All options may be abbreviated; the abbreviation is documented as the
32 upper case letters, all lower case letters and underscores (_) are
33 optional. You must use consecutive sequences of optional letters.
34
35 All options are case insensitive, you may type them in upper case or
36 lower case or a combination of both, case is not important.
37
38 For example: the arguments “-help”, “-HEL” and “-h” are all interpreted
39 to mean the -Help option. The argument “-hlp” will not be understood,
40 because consecutive optional characters were not supplied.
41
42 Options and other command line arguments may be mixed arbitrarily on
43 the command line.
44
45 The GNU long option names are understood. Since all option names for
46 srec_input are long, this means ignoring the extra leading “-”. The
47 “--option=value” convention is also understood.
48
49 File Formats
50 The format is specified by the argument after the file name. The for‐
51 mat defaults to Motorola S‐Record if not specified. The format speci‐
52 fiers are:
53
54 -Absolute_Object_Module_Format
55 This option says to use the Intel Absolute Object Module Format
56 (AOMF) to read the file. (See srec_aomf(5) for a description
57 of this file format.)
58
59 -Ascii_Hex
60 This option says to use the Ascii‐Hex format to read the file.
61 See srec_ascii_hex(5) for a description of this file format.
62
63 -Atmel_Generic
64 This option says to use the Atmel Generic format to read the
65 file. See srec_atmel_genetic(5) for a description of this file
66 format.
67
68 -Binary This option says the file is a raw binary file, and should be
69 read literally. (This option may also be written -Raw.) See
70 srec_binary(5) for more information.
71
72 -B‐Record
73 This option says to use the Freescale MC68EZ328 Dragonball
74 bootstrap b‐record format to read the file. See
75 srec_brecord(5) for a description of this file format.
76
77 -COsmac This option says to use the RCA Cosmac Elf format to read the
78 file. See srec_cosmac(5) for a description of this file for‐
79 mat.
80
81 -Dec_Binary
82 This option says to use the DEC Binary (XXDP) format to read
83 the file. See srec_dec_binary(5) for a description of this
84 file format.
85
86 -Elektor_Monitor52
87 This option says to use the EMON52 format to read the file.
88 See srec_emon52(5) for a description of this file format.
89
90 -FAIrchild
91 This option says to use the Fairchild Fairbug format to read
92 the file. See srec_fairchild(5) for a description of this file
93 format.
94
95 -Fast_Load
96 This option says to use the LSI Logic Fast Load format to read
97 the file. See srec_fastload(5) for a description of this file
98 format.
99
100 -Formatted_Binary
101 This option says to use the Formatted Binary format to read the
102 file. See srec_formatted_binary(5) for a description of this
103 file format.
104
105 -Four_Packed_Code
106 This option says to use the FPC format to read the file. See
107 srec_fpc(5) for a description of this file format.
108
109 -Guess This option may be used to ask srec_input to guess the input
110 format. This is slower than specifying an explicit format, as
111 it may open and close the file a number of times.
112
113 -Intel This option says to use the Intel hex format to read the file.
114 See srec_intel(5) for a description of this file format.
115
116 -INtel_HeX_16
117 This option says to use the Intel hex 16 (INHX16) format to
118 read the file. See srec_intel16(5) for a description of this
119 file format.
120
121 -Memory_Initialization_File
122 This option says to use the Memory Initialization File (MIF)
123 format by Altera to read the file. See srec_mif (5) for a
124 description of this file format.
125
126 -MOS_Technologies
127 This option says to use the Mos Technologies format to read the
128 file. See srec_mos_tech(5) for a description of this file for‐
129 mat.
130
131 -Motorola [ width ]
132 This option says to use the Motorola S‐Record format to read
133 the file. (May also be written -S‐Record.) See
134 srec_motorola(5) for a description of this file format.
135
136 The optional width argument describes the number of bytes which
137 form each address multiple. For normal uses the default of one
138 (1) byte is appropriate. Some systems with 16‐bit or 32‐bit
139 targets mutilate the addresses in the file; this option will
140 correct for that. Unlike most other parameters, this one can‐
141 not be guessed.
142
143 -MsBin This option says to use the Windows CE Binary Image Data Format
144 to read the file. See srec_msbin(5) for a description of this
145 file format.
146
147 -Needham_Hexadecimal
148 This option says to use the Needham Electronics ASCII file for‐
149 mat to read the file. See srec_needham(5) for a description of
150 this file format.
151
152 -Ohio_Scientific
153 This option says to use the Ohio Scientific format. See
154 srec_os65v(5) for a description of this file format.
155
156 -SIGnetics
157 This option says to use the Signetics format. See
158 srec_spasm(5) for a description of this file format.
159
160 -SPAsm This option says to use the SPASM assembler output format (com‐
161 monly used by PIC programmers). See srec_spasm(5) for a
162 description of this file format.
163
164 -SPAsm_LittleEndian
165 This option says to use the SPASM assembler output format (com‐
166 monly used by PIC programmers). But with the data the other
167 way around.
168
169 -STewie This option says to use the Stewie binary format to read the
170 file. See srec_stewie(5) for a description of this file for‐
171 mat.
172
173 -Tektronix
174 This option says to use the Tektronix hex format to read the
175 file. See srec_tektronix(5) for a description of this file
176 format.
177
178 -Tektronix_Extended
179 This option says to use the Tektronix extended hex format to
180 read the file. See srec_tektronix_extended(5) for a descrip‐
181 tion of this file format.
182
183 -Texas_Instruments_Tagged
184 This option says to use the Texas Instruments Tagged format to
185 read the file. See srec_ti_tagged(5) for a description of this
186 file format.
187
188 -Texas_Instruments_Tagged_16
189 This option says to use the Texas Instruments SDSMAC 320 format
190 to read the file. See srec_ti_tagged_16(5) for a description
191 of this file format.
192
193 -Texas_Instruments_TeXT
194 This option says to use the Texas Instruments TXT (MSP430) for‐
195 mat to read the file. See srec_ti_txt(5) for a description of
196 this file format.
197
198 -VMem This option says to use the Verilog VMEM format to read the
199 file. See srec_vmem(5) for a description of this file format.
200
201 -WILson This option says to use the wilson format to read the file.
202 See srec_wilson(5) for a description of this file format.
203
204 Ignore Checksums
205 The -ignore‐checksums option may be used to disable checksum validation
206 of input files, for those formats which have checksums at all. Note
207 that the checksum values are still read in and parsed (so it is still
208 an error if they are missing) but their values are not checked. Used
209 after an input file name, the option affects that file alone; used any‐
210 where else on the command line, it applies to all following files.
211
212 Generators
213 It is also possible to generate data, rather than read it from a file.
214 You may use a generator anywhere you could use a file. An input gener‐
215 ator specification looks like this:
216
217 -GENerate address‐range -data‐source
218
219 The -data‐source may be one of the following:
220
221 -CONSTant byte‐value
222 This generator manufactures data with the given byte value of
223 the the given address range. It is an error if the byte‐value
224 is not in the range 0..255.
225
226 For example, to fill memory addresses 100..199 with newlines
227 (0x0A), you could use a command like
228
229 srec_cat -generate 100 200 -constant 10 -o newlines.srec
230
231 This can, of course, be combined with data from files.
232
233 -REPeat_Data byte‐value...
234 This generator manufactures data with the given byte values
235 repeating over the the given address range. It is an error if
236 any of the the byte‐values are not in the range 0..255.
237
238 For example, to create a data region with 0xDE in the even
239 bytes and 0xAD in the odd bytes, use a generator like this:
240
241 srec_cat -generate 0x1000 0x2000 -repeat‐data 0xDE 0xAD
242
243 The repeat boundaries are aligned with the base of the address
244 range, modulo the number of bytes.
245
246 -REPeat_String text
247 This generator is almost identical to -repeat‐data except that
248 the data to be repeated is the text of the given string.
249
250 For example, to fill the holes in an EPROM image eprom.srec
251 with the text “Copyright (C) 1812 Tchaikovsky”, combine a gen‐
252 erator and an -exclude filter, such as the command
253
254 srec_cat eprom.srec \
255 -generate 0 0x100000 \
256 -repeat‐string 'Copyright (C) 1812 Tchaikovsky. ' \
257 -exclude -within eprom.srec \
258 -o eprom.filled.srec
259
260 The thing to note is that we have two data sources: the
261 eprom.srec file, and generated data over an address range which
262 covers first megabyte of memory but excluding areas covered by
263 the eprom.srec data.
264
265 -Litte_Endian_CONSTant value width
266 This generator manufactures data with the given numeric value,
267 of a given byte width, in little‐endian byte order. It is an
268 error if the given value does not fit into the given byte
269 width. It will repeat over and over within the address range
270 range.
271
272 For example, to insert a subversion commit number into 4 bytes
273 at 0x0008..0x000B you would use a command like
274
275 srec_cat -generate 8 12 -l‐e‐constant $VERSION 4 \
276 -o version.srec
277
278 This generator is a convenience wrapper around the -REPeat_Data
279 generator. It can, of course, be combined with data from
280 files.
281
282 -Big_Endian_CONSTant value width
283 As above, but using big‐endian byte ordering.
284
285 Anything else will result in an error.
286
287 Input Filters
288 You may specify zero or more filters to be applied. Filters are
289 applied in the order the user specifies.
290
291 -AND value
292 This filter may be used to bit‐wise AND a value to every data
293 byte. This is useful if you need to clear bits. Only existing
294 data is altered, no holes are filled.
295
296 -Big_Endian_Adler_16 address
297 This filter may be used to insert an “Adler” 16‐bit checksum of
298 the data into the data. Two bytes, big‐endian order, are
299 inserted at the address given. Holes in the input data are
300 ignored. Bytes are processed in ascending address order (not
301 in the order they appear in the input).
302
303 Note: If you have holes in your data, you will get a different
304 Adler checksum than if there were no holes. This is important
305 because the in‐memory EPROM image will not have holes. You
306 almost always want to use the -fill filter before any of the
307 Adler checksum filters. You will receive a warning if the data
308 presented for Adler checksum has holes.
309
310 You should also be aware that the lower and upper bounds of
311 your data may not be the same as the lower and upper bounds of
312 your EPROM. This is another reason to use the -fill filter,
313 because it will establish the data across the full EPROM
314 address range.
315
316 http://en.wikipedia.org/wiki/Adler‐32
317
318 -Big_Endian_Adler_32 address
319 This filter may be used to insert a Adler 32‐bit checksum of
320 the data into the data. Four bytes, big‐endian order, are
321 inserted at the address given. Holes in the input data are
322 ignored. Bytes are processed in ascending address order (not
323 in the order they appear in the input).
324
325 Note: If you have holes in your data, you will get a different
326 Adler checksum than if there were no holes. This is important
327 because the in‐memory EPROM image will not have holes. You
328 almost always want to use the -fill filter before any of the
329 Adler checksum filters. You will receive a warning if the data
330 presented for Adler checksum has holes.
331
332 You should also be aware that the lower and upper bounds of
333 your data may not be the same as the lower and upper bounds of
334 your EPROM. This is another reason to use the -fill filter,
335 because it will establish the data across the full EPROM
336 address range.
337
338 http://en.wikipedia.org/wiki/Adler‐32
339
340 -Big_Endian_Checksum_BitNot address [ nbytes [ width ]]
341 This filter may be used to insert the one's complement checksum
342 of the data into the data, most significant byte first. The
343 data is literally summed; if there are duplicate bytes, this
344 will produce an incorrect result, if there are holes, it will
345 be as if they were filled with zeros. If the data already con‐
346 tains bytes at the checksum location, you need to use an
347 exclude filter, or this will generate errors. You need to
348 apply and crop or fill filters before this filter. The value
349 will be written with the most significant byte first. The num‐
350 ber of bytes of resulting checksum defaults to 4. The width
351 (the width in bytes of the values being summed) defaults to 1.
352
353 -Big_Endian_Checksum_Negative address [ nbytes [ width ]]
354 This filter may be used to insert the two's complement (nega‐
355 tive) checksum of the data into the data. Otherwise similar to
356 the above.
357
358 -Big_Endian_Checksum_Positive address [ nbytes [ width ]]
359 This filter may be used to insert the simple checksum of the
360 data into the data. Otherwise similar to the above.
361
362 -Big_Endian_CRC16 address [ modifier... ]
363 This filter may be used to insert an industry standard 16‐bit
364 CRC checksum of the data into the data. Two bytes, big‐endian
365 order, are inserted at the address given. Holes in the input
366 data are ignored. Bytes are processed in ascending address
367 order (not in the order they appear in the input).
368
369 The following additional modifiers are understood:
370
371 number Set the polynomial to be used to the given number.
372
373 -Most_To_Least
374 The CRC calculation is performed with the most signifi‐
375 cant bit in each byte processed first, and then pro‐
376 ceeding towards the least significant bit. This is the
377 default.
378
379 -Least_To_Most
380 The CRC calculation is performed with the least signif‐
381 icant bit in each byte processed first, and then pro‐
382 ceeding towards the most significant bit.
383
384 -CCITT The CCITT calculation is performed. The initial seed
385 is 0xFFFF. This is the default.
386
387 -XMODEM The alternate XMODEM calculation is performed. The
388 initial seed is 0x0000.
389
390 -BROKEN A common‐but‐broken calculation is performed. The ini‐
391 tial seed is 0x84CF.
392
393 -AUGment
394 The CRC is augmented by sixteen zero bits at the end of
395 the calculation. This is the default.
396
397 -No‐AUGment
398 The CRC is not augmented at the end of the calculation.
399 This is less standard conforming, but some implementa‐
400 tions do this.
401
402 Note: If you have holes in your data, you will get a different
403 CRC than if there were no holes. This is important because the
404 in‐memory EPROM image will not have holes. You almost always
405 want to use the -fill filter before any of the CRC filters.
406 You will receive a warning if the data presented for CRC has
407 holes.
408
409 You should also be aware that the lower and upper bounds of
410 your data may not be the same as the lower and upper bounds of
411 your EPROM. This is another reason to use the -fill filter,
412 because it will establish the data across the full EPROM
413 address range.
414
415 Note that there are a great many CRC16 implementations out
416 there, see http://www.joegeluso.com/software/articles/ccitt.htm
417 for more information. If all else fails, SRecord is open
418 source software: read the SRecord source code. The CRC16
419 source code (found in the lib/crc16.cc file of the distribution
420 tarball) has a great many explanatory comments.
421
422 Please try all twelve combinations of the above options before
423 reporting a bug in the CRC16 calculation.
424
425 -Big_Endian_CRC32 address [ modifier... ]
426 This filter may be used to insert an industry standard 32‐bit
427 CRC checksum of the data into the data. Four bytes, big‐endian
428 order, are inserted at the address given. Holes in the input
429 data are ignored. Bytes are processed in ascending address
430 order (not in the order they appear in the input). See also
431 the note about holes, above.
432
433 The following additional modifiers are understood:
434
435 -CCITT The CCITT calculation is performed. The initial seed
436 is all one bits. This is the default.
437
438 -XMODEM An alternate XMODEM‐style calculation is performed.
439 The initial seed is all zero bits.
440
441 -Big_Endian_Exclusive_Length address [ nbytes [ width ]]
442 The same as the -Big_Endian_Length filter, except that the
443 result does not include the length itself.
444
445 -Big_Endian_Exclusive_MAXimum address [ nbytes ]
446 The same as the -Big_Endian_MAXimum filter, except that the
447 result does not include the maximum itself.
448
449 -Big_Endian_Exclusive_MINimum address [ nbytes ]
450 The same as the -Big_Endian_MINimum filter, except that the
451 result does not include the minimum itself.
452
453 -Big_Endian_Fletcher_16 address
454 This filter may be used to insert an Fletcher 16‐bit checksum
455 of the data into the data. Two bytes, big‐endian order, are
456 inserted at the address given. Holes in the input data are
457 ignored. Bytes are processed in ascending address order (not
458 in the order they appear in the input).
459
460 Note: If you have holes in your data, you will get a different
461 Fletcher checksum than if there were no holes. This is impor‐
462 tant because the in‐memory EPROM image will not have holes.
463 You almost always want to use the -fill filter before any of
464 the Fletcher checksum filters. You will receive a warning if
465 the data presented for Fletcher checksum has holes.
466
467 You should also be aware that the lower and upper bounds of
468 your data may not be the same as the lower and upper bounds of
469 your EPROM. This is another reason to use the -fill filter,
470 because it will establish the data across the full EPROM
471 address range.
472
473 http://en.wikipedia.org/wiki/Fletcher%27s_checksum
474
475 -Big_Endian_Fletcher_32 address
476 This filter may be used to insert a Fletcher 32‐bit checksum of
477 the data into the data. Four bytes, big‐endian order, are
478 inserted at the address given. Holes in the input data are
479 ignored. Bytes are processed in ascending address order (not
480 in the order they appear in the input).
481
482 Note: If you have holes in your data, you will get a different
483 Fletcher checksum than if there were no holes. This is impor‐
484 tant because the in‐memory EPROM image will not have holes.
485 You almost always want to use the -fill filter before any of
486 the Fletcher checksum filters. You will receive a warning if
487 the data presented for Fletcher checksum has holes.
488
489 You should also be aware that the lower and upper bounds of
490 your data may not be the same as the lower and upper bounds of
491 your EPROM. This is another reason to use the -fill filter,
492 because it will establish the data across the full EPROM
493 address range.
494
495 http://en.wikipedia.org/wiki/Fletcher%27s_checksum
496
497 -Big_Endian_Length address [ nbytes [ width ]]
498 This filter may be used to insert the length of the data (high
499 water minus low water) into the data. This includes the length
500 itself. If the data already contains bytes at the length loca‐
501 tion, you need to use an exclude filter, or this will generate
502 errors. The value will be written with the most significant
503 byte first. The number of bytes defaults to 4. The width
504 defaults to 1, and is divided into the actual lenght, thus you
505 can insert the width in units of words (2) or longs (4).
506
507 -Big_Endian_MAXimum address [ nbytes ]
508 This filter may be used to insert the maximum address of the
509 data (high water
510 + 1) into the data. This includes the maximum itself. If the
511 data already contains bytes at the given address, you need to
512 use an exclude filter, or this will generate errors. The value
513 will be written with the most significant byte first. The num‐
514 ber of bytes defaults to 4.
515
516 -Big_Endian_MINimum address [ nbytes ]
517 This filter may be used to insert the minimum address of the
518 data (low water) into the data. This includes the minimum
519 itself. If the data already contains bytes at the given
520 address, you need to use an exclude filter, or this will gener‐
521 ate errors. The value will be written with the most signifi‐
522 cant byte first. The number of bytes defaults to 4.
523
524 -bit_reverse [ width ]
525 This filter maye be used to reverse the order of the bits in
526 each data byte. By specifying a width (in bytes) it is possi‐
527 ble to reverse the order multi‐byte values; this is implemented
528 using the byte‐swap filter.
529
530 -Byte_Swap [ width ]
531 This filter may be used to swap pairs of odd and even bytes.
532 By specifying a width (in bytes) it is possible to reverse the
533 order of 4 and 8 bytes, the default is 2 bytes. (Widths in
534 excess of 8 are assumed to be number of bits.) It is not pos‐
535 sible to swap non‐power‐of‐two addresses. To change the align‐
536 ment, use the offset filter before and after.
537
538 -Crop address‐range
539 This filter may be used to isolate a section of data, and dis‐
540 card the rest.
541
542 -Exclude address‐range
543 This filter may be used to exclude a section of data, and keep
544 the rest. The is the logical complement of the -Crop filter.
545
546 -eXclusive‐OR value
547 This filter may be used to bit‐wise XOR a value to every data
548 byte. This is useful if you need to invert bits. Only exist‐
549 ing data is altered, no holes are filled.
550
551 -Fill value address‐range
552 This filter may be used to fill any gaps in the data with bytes
553 equal to value. The fill will only occur in the address range
554 given.
555
556 -Little_Endian_Adler_16 address
557 This filter may be used to insert an Adler 16‐bit checksum of
558 the data into the data. Two bytes, in little‐endian order, are
559 inserted at the address given. Holes in the input data are
560 ignored. Bytes are processed in ascending address order (not
561 in the order they appear in the input).
562
563 Note: If you have holes in your data, you will get a different
564 Adler checksum than if there were no holes. This is important
565 because the in‐memory EPROM image will not have holes. You
566 almost always want to use the -fill filter before any of the
567 Adler filters. You will receive a warning if the data pre‐
568 sented for Adler checksum has holes.
569
570 You should also be aware that the lower and upper bounds of
571 your data may not be the same as the lower and upper bounds of
572 your EPROM. This is another reason to use the -fill filter,
573 because it will establish the data across the full EPROM
574 address range.
575
576 http://en.wikipedia.org/wiki/Adler‐32
577
578 -Little_Endian_Adler_32 address
579 This filter may be used to insert a Adler 32‐bit checksum of
580 the data into the data. Four bytes, in little‐endian order,
581 are inserted at the address given. Holes in the input data are
582 ignored. Bytes are processed in ascending address order (not
583 in the order they appear in the input).
584
585 Note: If you have holes in your data, you will get a different
586 Adler checksum than if there were no holes. This is important
587 because the in‐memory EPROM image will not have holes. You
588 almost always want to use the -fill filter before any of the
589 Adler checksum filters. You will receive a warning if the data
590 presented for Adler checksum has holes.
591
592 You should also be aware that the lower and upper bounds of
593 your data may not be the same as the lower and upper bounds of
594 your EPROM. This is another reason to use the -fill filter,
595 because it will establish the data across the full EPROM
596 address range.
597
598 http://en.wikipedia.org/wiki/Adler‐32
599
600 -Little_Endian_Checksum_BitNot address [ nbytes [ width ]]
601 This filter may be used to insert the one's complement (bitnot)
602 checksum of the data into the data, least significant byte
603 first. Otherwise similar to the above.
604
605 -Little_Endian_Checksum_Negative address [ nbytes [ width ]]
606 This filter may be used to insert the two's complement (nega‐
607 tive) checksum of the data into the data. Otherwise similar to
608 the above.
609
610 -Little_Endian_Checksum_Positive address [ nbytes [ width ]]
611 This filter may be used to insert the simple checksum of the
612 data into the data. Otherwise similar to the above.
613
614 -Little_Endian_CRC16 address [ modifier... ]
615 The same as the -Big_Endian_CRC16 filter, except little‐endian
616 order.
617
618 -Little_Endian_CRC32 address
619 The same as the -Big_Endian_CRC32 filter, except little‐endian
620 order.
621
622 -Little_Endian_Exclusive_Length address [ nbytes [ width ]]
623 The same as the -Little_Endian_Length filter, except that the
624 result does not include the length itself.
625
626 -Little_Endian_Exclusive_MAXimum address [ nbytes ]
627 The same as the -Little_Endian_MAXimum filter, except that the
628 result does not include the maximum itself.
629
630 -Little_Endian_Exclusive_MINimum address [ nbytes ]
631 The same as the -Little_Endian_MINimum filter, except that the
632 result does not include the minimum itself.
633
634 -Little_Endian_Fletcher_16 address
635 This filter may be used to insert an Fletcher 16‐bit checksum
636 of the data into the data. Two bytes, in little‐endian order,
637 are inserted at the address given. Holes in the input data are
638 ignored. Bytes are processed in ascending address order (not
639 in the order they appear in the input).
640
641 Note: If you have holes in your data, you will get a different
642 Fletcher checksum than if there were no holes. This is impor‐
643 tant because the in‐memory EPROM image will not have holes.
644 You almost always want to use the -fill filter before any of
645 the Fletcher filters. You will receive a warning if the data
646 presented for Fletcher checksum has holes.
647
648 You should also be aware that the lower and upper bounds of
649 your data may not be the same as the lower and upper bounds of
650 your EPROM. This is another reason to use the -fill filter,
651 because it will establish the data across the full EPROM
652 address range.
653
654 http://en.wikipedia.org/wiki/Fletcher%27s_checksum
655
656 -Little_Endian_Fletcher_32 address
657 This filter may be used to insert a Fletcher 32‐bit checksum of
658 the data into the data. Four bytes, in little‐endian order,
659 are inserted at the address given. Holes in the input data are
660 ignored. Bytes are processed in ascending address order (not
661 in the order they appear in the input).
662
663 Note: If you have holes in your data, you will get a different
664 Fletcher checksum than if there were no holes. This is impor‐
665 tant because the in‐memory EPROM image will not have holes.
666 You almost always want to use the -fill filter before any of
667 the Fletcher checksum filters. You will receive a warning if
668 the data presented for Fletcher checksum has holes.
669
670 You should also be aware that the lower and upper bounds of
671 your data may not be the same as the lower and upper bounds of
672 your EPROM. This is another reason to use the -fill filter,
673 because it will establish the data across the full EPROM
674 address range.
675
676 http://en.wikipedia.org/wiki/Fletcher%27s_checksum
677
678 -Little_Endian_Length address [ nbytes [ width ]]
679 The same as the -Big_Endian_Length filter, except the value
680 will be written with the least significant byte first.
681
682 -Little_Endian_MAXimum address [ nbytes ]
683 The same as the -Big_Endian_MAXimum filter, except the value
684 will be written with the least significant byte first.
685
686 -Little_Endian_MINimum address [ nbytes ]
687 The same as the -Big_Endian_MINimum filter, except the value
688 will be written with the least significant byte first.
689
690 -Message_Digest_5 address
691 This filter may be used to insert a 16 byte MD5 hash into the
692 data, at the address given.
693
694 -NOT This filter may be used to bit‐wise NOT the value of every data
695 byte. This is useful if you need to invert the data. Only
696 existing data is altered, no holes are filled.
697
698 -OFfset nbytes
699 This filter may be used to offset the addresses by the given
700 number of bytes. No data is lost, the addresses will wrap
701 around in 32 bits, if necessary. You may use negative numbers
702 for the offset, if you wish to move data lower in memory.
703
704 Please note: the execution start address is a different concept
705 than the first address in memory of your data. If you want to
706 change where your monitor will start executing, use the -execu‐
707 tion‐start‐address option (srec_cat(1) only).
708
709 -OR value
710 This filter may be used to bit‐wise OR a value to every data
711 byte. This is useful if you need to set bits. Only existing
712 data is altered, no holes are filled.
713
714 -Random_Fill address‐range
715 This filter may be used to fill any gaps in the data with ran‐
716 dom bytes. The fill will only occur in the address range
717 given.
718
719 -Ripe_Message_Digest_160 address
720 This filter may be used to insert an RMD160 hash into the data.
721
722 -Secure_Hash_Algorithm_1 address
723 This filter may be used to insert a 20 byte SHA1 hash into the
724 data, at the address given.
725
726 -Secure_Hash_Algorithm_224 address
727 This filter may be used to insert a 28 byte SHA224 hash into
728 the data, at the address given. See Change Notice 1 for FIPS
729 180‐2 for the specification.
730
731 -Secure_Hash_Algorithm_256 address
732 This filter may be used to insert a 32 byte SHA256 hash into
733 the data, at the address given. See FIPS 180‐2 for the speci‐
734 fication.
735
736 -Secure_Hash_Algorithm_384 address
737 This filter may be used to insert a 48 byte SHA384 hash into
738 the data, at the address given. See FIPS 180‐2 for the speci‐
739 fication.
740
741 -Secure_Hash_Algorithm_512 address
742 This filter may be used to insert a 64 byte SHA512 hash into
743 the data, at the address given. See FIPS 180‐2 for the speci‐
744 fication.
745
746 -SPlit multiple [ offset [ width ] ]
747 This filter may be used to split the input into a subset of the
748 data, and compress the address range so as to leave no gaps.
749 This useful for wide data buses and memory striping. The mul‐
750 tiple is the bytes multiple to split over, the offset is the
751 byte offset into this range (defaults to 0), the width is the
752 number of bytes to extract (defaults to 1) within the multiple.
753 In order to leave no gaps, the output addresses are (width /
754 multiple) times the input addresses.
755
756 -TIGer address
757 This filter may be used to insert a 24 byte TIGER/192 hash into
758 the data at the address given.
759
760 -UnFill value [ min‐run‐length ]
761 This filter may be used to create gaps in the data with bytes
762 equal to value. You can think of it as reversing the effects
763 of the -Fill filter. The gaps will only be created if the are
764 at least min‐run‐length bytes in a row (defaults to 1).
765
766 -Un_SPlit multiple [ offset [ width ] ]
767 This filter may be used to reverse the effects of the split
768 filter. The arguments are identical. Note that the address
769 range is expanded (multiple / width) times, leaving holes
770 between the stripes.
771
772 -WHIrlpool address
773 This filter may be used to insert a 64 byte WHIRLPOOL hash into
774 the data, at the address given.
775
776 Address Ranges
777 There are eight ways to specify an address range:
778
779 minimum maximum
780 If you specify two number on the command line (decimal, octal
781 and hexadecimal are understood, using the C conventions) this
782 is an explicit address range. The minimum is inclusive, the
783 maximum is exclusive (one more than the last address). If the
784 maximum is given as zero then the range extends to the end of
785 the address space.
786
787 -Within input‐specification
788 This says to use the specified input file as a mask. The range
789 includes all the places the specified input has data, and holes
790 where it has holes. The input specification need not be just a
791 file name, it may be anything any other input specification can
792 be.
793
794 See also the -over option for a discussion on operator prece‐
795 dence.
796
797 -OVER input‐specification
798 This says to use the specified input file as a mask. The range
799 extends from the minimum to the maximum address used by the
800 input, without any holes, even if the input has holes. The
801 input specification need not be just a file name, it may be
802 anything any other input specification can be.
803
804 You may need to enclose input‐specification in parentheses to
805 make sure it can't misinterpret which arguments go with which
806 input specification. This is particularly important when a
807 filter is to follow. For example
808 filename -fill 0 -over filename2 -swap‐bytes
809 groups as
810 filename -fill 0 -over '(' filename2 -swap‐bytes ')'
811 when what you actually wanted was
812 '(' filename -fill 0 -over filename2 ')' -swap‐bytes
813 The command line expression parsing tends to be “greedy” (or
814 right associative) rather than conservative (or left associa‐
815 tive).
816
817 address‐range -RAnge‐PADding number
818 It is also possible to pad ranges to be whole aligned multiples
819 of the given number. For example
820 input‐file -fill 0xFF -within input‐file -range‐pad 512
821 will fill the input‐file so that it consists of whole 512‐byte
822 blocks, aligned on 512 byte boundaries. Any large holes in the
823 data will also be multiples of 512 bytes, though they may have
824 been shrunk as blocks before and after are padded.
825
826 This operator has the same precedence as the explicit union
827 operator.
828
829 address‐range -INTERsect address‐range
830 You can intersect two address ranges to produce a smaller
831 address range. The intersection operator has higher precedence
832 than the implicit union operator (evaluated left to right).
833
834 address‐range -UNIon address‐range
835 You can union two address ranges to produce a larger address
836 range. The union operator has lower precedence than the inter‐
837 section operator (evaluated left to right).
838
839 address‐range -DIFference address‐range
840 You can difference two address ranges to produce a smaller
841 address range. The result is the left hand range with all of
842 the right hand range removed. The difference operator has the
843 same precedence as the implicit union operator (evaluated left
844 to right).
845
846 address‐range address‐range
847 In addition, all of these methods may be used, and used more
848 than once, and the results will be combined (implicit union
849 operator, same precedence as explicit union operator).
850
851 Calculated Values
852 Most of the places above where a number is expected, you may supply one
853 of the following:
854
855 - value
856 The value of this expression is the negative of the expression
857 argument. Note the space between the minus sign and its argu‐
858 ment: this space is mandatory.
859 srec_cat in.srec -offset − -minimum‐addr in.srec -o
860 out.srec
861 This example shows how to move data to the base of memory.
862
863 ( value )
864 You may use parentheses for grouping. When using parentheses,
865 they must each be a separate command line argument, they can't
866 be within the text of the preceding or following option, and
867 you will need to quote them to get them past the shell, such as
868 '(' and ')'.
869
870 -MINimum‐Address input‐specification
871 This inserts the minimum address of the specified input file.
872 The input specification need not be just a file name, it may be
873 anything any other input specification can be.
874
875 See also the -over option for a discussion on operator prece‐
876 dence.
877
878 -MAXimum‐Address input‐specification
879 This inserts the maximum address of the specified input file,
880 plus one. The input specification need not be just a file
881 name, it may be anything any other input specification can be.
882
883 See also the -over option for a discussion on operator prece‐
884 dence.
885
886 -Length input‐specification
887 This inserts the length of the address range in the specified
888 input file, ignoring any holes. The input specification need
889 not be just a file name, it may be anything any other input
890 specification can be.
891
892 See also the -over option for a discussion on operator prece‐
893 dence.
894
895 For example, the -OVER input‐specification option can be thought of as
896 short‐hand for '(' -min file -max file ')', except that it is much eas‐
897 ier to type, and also more efficient.
898
899 In addition, calculated values may optionally be rounded in one of
900 three ways:
901
902 value -Round_Down number
903 The value is rounded down to the the largest integer smaller
904 than or equal to a whole multiple of the number.
905
906 value -Round_Nearest number
907 The value is rounded to the the nearest whole multiple of the
908 number.
909
910 value -Round_Up number
911 The value is rounded up to the the smallest integer larger than
912 or equal to a whole multiple of the number.
913
914 When using parentheses, they must each be a separate command line argu‐
915 ment, they can't be within the text of the preceding or following
916 option, and you will need to quote them to get them past the shell, as
917 '(' and ')'.
918
920 srec_input version 1.55
921 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
922 2007, 2008, 2009, 2010 Peter Miller
923
924 The srec_input program comes with ABSOLUTELY NO WARRANTY; for details
925 use the 'srec_input -VERSion License' command. This is free software
926 and you are welcome to redistribute it under certain conditions; for
927 details use the 'srec_input -VERSion License' command.
928
930 Peter Miller E‐Mail: pmiller@opensource.org.au
931 /\/\* WWW: http://miller.emu.id.au/pmiller/
932
933
934
935Reference Manual SRecord srec_input(1)