1srec_cat(1)                 General Commands Manual                srec_cat(1)
2
3
4

NAME

6       srec_cat - manipulate eprom load files
7

SYNOPSIS

9       srec_cat [ option...  ] filename...
10       srec_cat -Help
11       srec_cat -VERSion
12

DESCRIPTION

14       The  srec_cat  program is used to assemble the given input files into a
15       single output file.  The use of filters (see below) allows  significant
16       manipulations to be performed by this command.
17
18       A  warning will be emitted for each address which is redundantly set to
19       the same value.  A fatal error will be issued if  any  address  is  set
20       with  contradictory values.  To suppress this behavior, use an -exclude
21       -within filter.
22

INPUT FILE SPECIFICATIONS

24       Input may be qualified in two ways: you may specify a data  file  or  a
25       data  generator.   format and you may specify filters to apply to them.
26       An input file specification looks like this:
27              data-file [ filter ... ]
28              data-generator [ filter ... ]
29
30   Data Files
31       Input from data files is specified by file name and  format  name.   An
32       input file specification looks like this:
33              filename [ format ][ -ignore-checksums ]
34       The  default  format  is  Motorola S-Record format, but many others are
35       also understood.
36
37   Data Generators
38       It is also possible to generate data, rather than read it from a  file.
39       You may use a generator anywhere you could use a file.  An input gener‐
40       ator specification looks like this:
41              -GENerate address-range -data-source
42       Generators include random data and various forms of constant data.
43
44   Common Manual Page
45       See srec_input(1) for  complete  details  of  input  specifiers.   This
46       description in a separate manual page because it is common to more than
47       one SRecord command.
48

OPTIONS

50       The following options are understood:
51
52       @filename
53               The named text file is read for additional command  line  argu‐
54               ments.   Arguments  are  separated  by white space (space, tab,
55               newline, etc).  There is no wildcard mechanism.   There  is  no
56               quoting  mechanism.   Comments, which start with '#' and extend
57               to the end of the line, are ignored.  Blank lines are ignored.
58
59       -Output filename [ format ]
60               This option may be used to specify the output file to be  used.
61               The  special file name ``-'' is understood to mean the standard
62               output.  Output defaults to the standard output if this  option
63               is not used.
64
65               The format may be specified as:
66
67               -Absolute_Object_Module_Format
68                       An  Intel  Absolute  Object  Module Format file will be
69                       written.  (See srec_aomf(5) for a description  of  this
70                       file format.)
71
72               -Ascii_Hex
73                       An    Ascii-Hex    file    will   be   written.    (See
74                       srec_ascii_hex(5) for a description of this  file  for‐
75                       mat.)
76
77               -ASM [ prefix ][ -option... ]
78                       A series of assembler DB statements will be written.
79
80                       The  optional  prefix  may  be  specified to change the
81                       names  of  the  symbols  generated.   The  defaults  to
82                       "eprom" if not set.
83
84                       Several  options  are  available to modify the style of
85                       output:
86
87                       -Dot_STyle
88                               Use "dot" style pseudo-ops  instead  of  words.
89                               For example .byte instead of the DB default.
90
91                       -HEXadecimal_STyle
92                               Use  hexadecimal  numbers in the output, rather
93                               than the default decimal numbers.
94
95                       -Section_STyle
96                               By default the generated assemble of placed  at
97                               the correct address using ORG pseudo-ops.  Sec‐
98                               tion  style  output  emits  tables  of  section
99                               addresses  and  lengths,  so  the  data  may be
100                               related at runtime.
101
102                       -A430   Generate  output  which  is  compliant  to  the
103                               a430.exe  compiler  as  it is used, e.g. in IAR
104                               Embedded Workbench.   This  is  short-hand  for
105                               -section-style -hex-style
106
107                       -CL430  Generate   output which is Code Composer Essen‐
108                               tials compliant, i.e. the compiler of it.  This
109                               is  short-hand  for  -section-style  -hex-style
110                               -dot-style
111
112                       -Output_Word
113                               Generate output  which  is  in  two-byte  words
114                               rather  than bytes.  This assumes little-endian
115                               words; you will need to use the -Byte-Swap fil‐
116                               ter  if  your target is big-endian.  No attempt
117                               is made to align the words  onto  even  address
118                               boundaries; use and input filter such as
119                                       input-file -fill 0xFF -within input-file -range-pad 2
120                               to pad the data to whole words first.
121
122               -Atmel_Generic
123                       An   Atmel   Generic   file   will  be  written.   (See
124                       srec_atmel_generic(5) for a description  of  this  file
125                       format.)
126
127               -BASic  A series of BASIC DATA statements will be written.
128
129               -B-Record
130                       A  Freescale  MC68EZ328  Dragonball  bootstrap b-record
131                       format file will be written.  (See srec_brecord(5)  for
132                       a description of this file format.)
133
134               -Binary A  raw  binary  file will be written.  If you get unex‐
135                       pected results please see the srec_binary(5) manual for
136                       more information.
137
138               -C-Array [ identifier ][ -option... ]
139                       A C array defintion will be written.
140
141                       The  optional identifier is the name of the variable to
142                       be defined, or bugus if not specified.
143
144                       -INClude
145                               This option asks for an include file to be gen‐
146                               erated as well.
147
148                       -No-CONST
149                               This  options asks for the variables to not use
150                               the const keyword (they are  declared  constant
151                               be  default,  so  that they are placed into the
152                               read-only segment in embedded systems).
153
154                       -C_COMpressed
155                               These options ask  for  an  compressed  c-array
156                               whose memory gaps will not be filled.
157
158                       -Output_Word
159                               This  option  asks  for  an  output which is in
160                               words not in bytes.  This is little endian,  so
161                               you  may  need  to  use the -Swap-bytes filter.
162                               Filler bytes of 0xFF may be inserted if  neces‐
163                               sary;  use  -fill  -range-pad  for  a different
164                               value.
165
166                       -DECimal_STyle
167                               This option may be used  to  get  decimal  con‐
168                               stants  in  the output, rather than the default
169                               hexadecimal constants.
170
171               -COsmac An RCA Cosmac Elf format file will  be  written.   (See
172                       srec_cosmac(5) for a description of this file format.)
173
174               -Dec_Binary
175                       A  DEC Binary (XXDP) format file will be written.  (See
176                       srec_dec_binary(5) for a description of this file  for‐
177                       mat.)
178
179               -Elektor_Monitor52
180                       This  option  says  to  use the EMON52 format file when
181                       writing the file.  (See srec_emon52(5) for  a  descrip‐
182                       tion of this file format.)
183
184               -FAIrchild
185                       This  option  says  to use the Fairchild Fairbug format
186                       file when writing the file.  (See srec_fairchild(5) for
187                       a description of this file format.)
188
189               -Fast_Load
190                       This  option says to use the LSI Logic Fast Load format
191                       file when writing the file.  (See srec_fastload(5)  for
192                       a description of this file format.)
193
194               -Formatted_Binary
195                       A  Formatted  Binary format file will be written.  (See
196                       srec_formatted_binary(5) for a description of this file
197                       format.)
198
199               -Four_Packed_Code
200                       This  option says to use the PFC format file when writ‐
201                       ing the file.  (See srec_fpd(5) for  a  description  of
202                       this file format.)
203
204               -Intel  An  Intel  hex  format  file  will  be  written.   (See
205                       srec_intel(5) for a description of this  file  format.)
206                       The default is to emit 32-bit linear addressing; if you
207                       want  16-bit  extended  segment  addressing   use   the
208                       --address-length=2 option.
209
210               -MOS_Technologies
211                       An  Mos Technologies format file will be written.  (See
212                       srec_mos_tech(5) for a description of  this  file  for‐
213                       mat.)
214
215               -Motorola [ width ]
216                       A   Motorola  S-Record  file  will  be  written.   (See
217                       srec_motorola(5) for a description of  this  file  for‐
218                       mat.)   This is the default output format.  By default,
219                       the smallest possible address length is  emitted,  this
220                       will  be S19 for data in the first 64KB; if you wish to
221                       force S28 use the  --address-length=3  option;  if  you
222                       wish to force S37 use the --address-length=4 option
223
224                       The  optional  width  argument  describes the number of
225                       bytes which form each  address  multiple.   For  normal
226                       uses  the default of one (1) byte is appropriate.  Some
227                       systems with 16-bit  or  32-bit  targets  mutilate  the
228                       addresses  in  the  file; this option will imitate that
229                       behavior.  Unlike most other parameters, this one  can‐
230                       not be guessed.
231
232               -Needham_Hexadecimal
233                       This  option  says to use the Needham Electronics ASCII
234                       file format to write the file.  See srec_needham(5) for
235                       a description of this file format.
236
237               -Ohio_Scientific
238                       This option says to use the Ohio Scientific hexadecimal
239                       format.  See srec_os65v(5) for a  description  of  this
240                       format.
241
242               -SIGnetics
243                       This  option says to use the Signetics hex format.  See
244                       srec_signetics(5) for a description of this format.
245
246               -SPAsm  This option says to use the SPASM assembler output for‐
247                       mat   (commonly   used   by   PIC   programmers).   See
248                       srec_spasm(5) for a description of this format.
249
250               -SPAsm_LittleEndian
251                       This option says to use the SPASM assembler output for‐
252                       mat  (commonly  used by PIC programmers).  But with the
253                       data the other way around.
254
255               -STewie A Stewie binary format  file  will  be  written.   (See
256                       srec_stewie(5) for a description of this file format.)
257
258               -Tektronix
259                       A  Tektronix  hex  format  file  will be written.  (See
260                       srec_tektronix(5) for a description of this  file  for‐
261                       mat.)
262
263               -Tektronix_Extended
264                       A  Tektronix  extended hex format file will be written.
265                       (See srec_tektronix_extended(5) for  a  description  of
266                       this file format.)
267
268               -Texas_Instruments_Tagged
269                       A   TI-Tagged   format  file  will  be  written.   (See
270                       srec_ti_tagged(5) for a description of this  file  for‐
271                       mat.)
272
273               -Texas_Instruments_Tagged_16
274                       A  Texas  Instruments  SDSMAC  320  format file will be
275                       written.  (See srec_ti_tagged_16(5) for  a  description
276                       of this file format.)
277
278               -Texas_Instruments_TeXT
279                       This  option  says  to  use  the  Texas Instruments TXT
280                       (MSP430) format to write the file.  See  srec_ti_txt(5)
281                       for a description of this file format.
282
283               -VHdl [ bytes-per-word [ name ]]
284                       A VHDL format file will be written.  The bytes-per-word
285                       defaults to one,  the  name  defaults  to  eprom.   The
286                       etc/x_defs_pack.vhd  file  in  the  source distribution
287                       contains an example ROM definitions pack for the  type-
288                       independent output.  You may need to use the -byte-swap
289                       filter to get the byte order you want.
290
291               -VMem [ memory-width ]
292                       A Verilog VMEM format file will be written.   The  mem‐
293                       ory-width may be 8, 16, 32, 64 or 128 bits; defaults to
294                       32 if unspecified.  (See srec_vmem(5) for a description
295                       of  this  file format.)  You may need to use the -byte-
296                       swap filter to get the byte order you want.
297
298               -WILson A wilson format file will be written.   (See  srec_wil‐
299                       son(5) for a description of this file format.)
300
301       -Address_Length number
302               This option many be used to specify the minimum number of bytes
303               to be used in the output to represent an address (padding  with
304               leading zeros if necessary).  This helps when talking to brain-
305               dead EPROM programmers which do not fully implement the  format
306               specification.
307
308       -Data_Only
309               This  option  may  be  used  to suppress all output except data
310               fields.  This helps when talking to brain-dead  EPROM  program‐
311               mers which do not fully implement the format specification.
312
313       -IGnore_Checksums
314               The  -ignore-checksums  option  may be used to disable checksum
315               validation of input files, for those formats which have  check‐
316               sums  at  all.  Note that the checksum values are still read in
317               and parsed (so it is still an error if they  are  missing)  but
318               their  values  are not checked.  Used after an input file name,
319               the option affects that file alone; used anywhere else  on  the
320               command line, it applies to all following files.
321
322       -Enable_Sequence_Warnings
323               This  option  may  be used to enable warnings about input files
324               where the data records are not in  strictly  ascending  address
325               order.   Only  one  warning  is  issued per input.  This is the
326               default.  Note: the output of srec_cat(1)  is  always  in  this
327               order.
328
329       -Disable_Sequence_Warnings
330               This  option  may be used to disable warnings about input files
331               where the data records are not in  stricyly  ascending  address
332               order.
333
334       -CRLF   This  option  may  be used to specify CRLF line termination for
335               text output.  For use with brain-dead EPROM  programmers  which
336               assume  all  the world uses Evil Bill's operating system's line
337               termination.  The default is to use the current operating  sys‐
338               tem's  default line termination.  Use this option with caution,
339               because it will also introduce extra  (i.e.   wrong)  CR  bytes
340               into binary formats.
341
342       -Line_Length number
343               This option may be used to limit the length of the output lines
344               to at most number characters.  (Not meaningful for binary  file
345               format.)   Defaults  to  something  less  than  80  characters,
346               depending on the format.
347
348       -HEAder string
349               This option may be used to set the  header  comment,  in  those
350               formats which support it.
351
352       -Start_Address number
353               This option may be used to set the start address, in those for‐
354               mats which support it.
355
356       -MULTiple
357               Use this option to permit a file to contain  multiple  (contra‐
358               dictory)  values  for some memory locations.  A warning will be
359               printed.  The last value in the file will be used.  The default
360               is for this condition to be a fatal error.
361
362       All other options will produce a diagnostic error.
363
364       All  options  may be abbreviated; the abbreviation is documented as the
365       upper case letters, all lower case  letters  and  underscores  (_)  are
366       optional.  You must use consecutive sequences of optional letters.
367
368       All  options  are  case insensitive, you may type them in upper case or
369       lower case or a combination of both, case is not important.
370
371       For example: the arguments "-help", "-HEL" and "-h" are all interpreted
372       to  mean the -Help option.  The argument "-hlp" will not be understood,
373       because consecutive optional characters were not supplied.
374
375       Options and other command line arguments may be  mixed  arbitrarily  on
376       the command line.
377
378       The  GNU  long option names are understood.  Since all option names for
379       srec_cat are long, this means ignoring  the  extra  leading  '-'.   The
380       "--option=value" convention is also understood.
381

EXIT STATUS

383       The  srec_cat  command  will exit with a status of 1 on any error.  The
384       srec_cat command will only exit with a status of  0  if  there  are  no
385       errors.
386
388       srec_cat version 1.35
389       Copyright  (C)  1998,  1999,  2000, 2001, 2002, 2003, 2004, 2005, 2006,
390       2007 Peter Miller
391
392       The srec_cat program comes with ABSOLUTELY NO WARRANTY; for details use
393       the 'srec_cat -VERSion License' command.  This is free software and you
394       are welcome to redistribute it under certain  conditions;  for  details
395       use the 'srec_cat -VERSion License' command.
396

AUTHOR

398       Peter Miller   E-Mail:   millerp@canb.auug.org.au
399       /\/\*             WWW:   http://www.canb.auug.org.au/~millerp/
400
401
402
403Reference Manual                    SRecord                        srec_cat(1)
Impressum