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

NAME

6       MSPDebug - debugging tool for MSP430 MCUs
7

SYNOPSIS

9       mspdebug [options] driver [command ...]
10

DESCRIPTION

12       MSPDebug  is a command-line tool designed for debugging and programming
13       the MSP430 family of MCUs. It supports the  eZ430-F2013,  eZ430-RF2500,
14       Launchpad,  Chronos,  FET430UIF,  GoodFET,  Olimex MSP430-JTAG-TINY and
15       MSP430-JTAG-ISO programming tools, as well as a simulation mode.
16
17       When started with appropriate options, MSPDebug will attempt to connect
18       to  the  debugging  tool  specified and identify the device under test.
19       Once connected, the user is presented with a command prompt  which  can
20       be used to reflash the device memory, inspect memory and registers, set
21       registers, and control the CPU (single step,  run  and  run  to  break‐
22       point).
23
24       It  supports a variety of file formats, described in the section BINARY
25       FORMATS below. It can also be used as a remote stub for gdb(1).
26
27       On startup, MSPDebug will look for a file called .mspdebug first in the
28       current  directory,  and  then  in the user's home directory. If either
29       file exists, commands will be read and executed from this  file  before
30       executing any other commands or starting the interactive reader.
31
32       Alternatively,  a  configuration  file can be explicitly specified with
33       the -C option.
34

COMMAND-LINE OPTIONS

36       Command-line options accepted by MSPDebug are described below. If  com‐
37       mands  are specified on the end of the command-line, then they are exe‐
38       cuted after connecting to the device, and the interactive prompt is not
39       started.  Please  be  aware  that commands consisting of multiple words
40       need to be enclosed in quotation marks, otherwise they are  treated  as
41       single  commands.  Thus  the common prog command would be used as "prog
42       main.elf".  See the section labelled COMMANDS for more information.
43
44       -q     Start in quiet mode. See the "quiet" option described below.
45
46       -v voltage
47              Set the programming voltage. The voltage should be specified  as
48              an integer in millivolts. It defaults to 3000 (3.0 V).
49
50       -j     Use  JTAG instead of Spy-Bi-Wire to communicate with the MSP430.
51              This option doesn't work with  eZ430  or  eZ430-RF2500  devices,
52              which support Spy-Bi-Wire only.
53
54       -d device
55              Specify  that  the driver should connect via a tty device rather
56              than USB.  The supported connection methods  vary  depending  on
57              the driver. See the section DRIVERS below for details.
58
59       -U bus:device
60              Specify  a  particular  USB  device  to connect to. Without this
61              option, the first device of the appropriate type is opened.
62
63       -s serial
64              Specify a particular USB device serial number to connect to. Use
65              this  option to distinguish between multiple devices of the same
66              type.
67
68       -n     Do not process the startup file (~/.mspdebug).
69
70       -C file
71              Specify an alternative configuration file (default is  ~/.mspde‐
72              bug). If -n is specified as well, no file will be read.
73
74       --long-password
75              When  using  the  flash-bsl  driver, send a 32-byte BSL password
76              instead of the standard 16-byte password.
77
78       --help Display a brief help message and exit.
79
80       --fet-list
81              Display a list of chips supported by the FET driver (the  driver
82              used for UIF, RF2500 and Olimex devices).
83
84       --fet-force-id string
85              When  using  a FET device, force the connected chip to be recog‐
86              nised by MSPDebug as one of the given  type  during  initializa‐
87              tion.  This  overrides  the  device  ID returned by the FET. The
88              given string should be a chip name in  long  form,  for  example
89              "MSP430F2274".
90
91       --fet-skip-close
92              When using a FET device, skip the JTAG close procedure when dis‐
93              connecting.  With some boards, this removes the need  to  replug
94              the debugger after use.
95
96       --usb-list
97              List available USB devices and exit.
98
99       --force-reset
100              When  using a FET device, always send a reset during initializa‐
101              tion. By default, an initialization without reset will be  tried
102              first.
103
104       --allow-fw-update
105              When using a V3 FET device via the TI library, allow the library
106              to perform a firmware update if the FET firmware is incompatible
107              with the library.
108
109       --require-fw-update image.txt
110              When  using  a V3 FET device, or certain Olimex devices, force a
111              firmware update using the given  firmware  image.  The  firmware
112              format depends on the driver.
113
114       --version
115              Show program version and copyright information.
116
117       --embedded
118              Start  mspdebug as an embedded subprocess. See the documentation
119              accompanying the source release for more information on embedded
120              mode.
121
122       --bsl-entry-sequence seq
123              Specify  a  BSL entry sequence. Each character specifies a modem
124              control line transition (R: RTS on, r: RTS off, D:  DTR  on,  d:
125              DTR  off).  A  comma  indicates  a  delay.  The  entry  and exit
126              sequences are  separated  by  a  colon.  The  default  value  is
127              dR,r,R,r,R,D:dR,DR, for the flash-bsl driver.
128

DRIVERS

130       For  drivers  supporting  both  USB and tty access, USB is the default,
131       unless specified otherwise (see -d above).
132
133       On Linux, if USB access is used, the kernel driver (if any) is detached
134       from  the  tty  device.  If further access to the tty device is needed,
135       unloading and re-loading of the driver (e.g. cdc-acm.ko) is required.
136
137       A driver name must be specified on the command  line  for  MSPDebug  to
138       connect to. Valid driver names are listed here.
139
140       rf2500 Connect  to  an  eZ430-RF2500, Launchpad or Chronos device. Only
141              USB connection is supported.
142
143       olimex Connect to an Olimex MSP430-JTAG-TINY device. Both USB  and  tty
144              access are supported.
145
146       olimex-v1
147              Connect  to an Olimex MSP430-JTAG-TINY (V1) device. Both USB and
148              tty access are supported. This driver must be  used  instead  of
149              olimex if connecting to a V1 device via a tty interface.
150
151       olimex-iso
152              Connect  to  an  Olimex MSP430-JTAG-ISO device. Both USB and tty
153              access are supported.
154
155       olimex-iso-mk2
156              Connect to an Olimex MSP430-JTAG-ISO-MK2 device.  Both  USB  and
157              tty access are supported.
158
159       sim    Do not connect to any hardware device, but instead start in sim‐
160              ulation mode. A 64k buffer is allocated to simulate  the  device
161              memory.
162
163              During  simulation,  addresses below 0x0200 are assumed to be IO
164              memory.  Programmed IO writes to and from IO memory are  handled
165              by the IO simulator, which can be configured and controlled with
166              the simio command, described below.
167
168              This mode is intended for testing of changes  to  MSPDebug,  and
169              for aiding the disassembly of MSP430 binaries (as all binary and
170              symbol table formats are still usable in this mode).
171
172       uif    Connect to an eZ430-F2013 or  a  FET430UIF  device.  The  device
173              argument  should  be the filename of the appropriate tty device.
174              The TI serial converter chips on these devices are supported  by
175              newer  versions  of  the  Linux  kernel,  and  should  appear as
176              /dev/ttyXX when attached.
177
178              USB connection is supported for this driver. The  USB  interface
179              chip  in  these  devices  is a TI3410, which requires a firmware
180              download on startup. MSPDebug will  search  for  a  file  called
181              ti_3410.fw.ihex in the configured library directory and the cur‐
182              rent directory. You can specify an alternate  location  for  the
183              file via the MSPDEBUG_TI3410_FW environment variable.
184
185       uif-bsl
186              Connect  to  the bootloader on a FET430UIF device. These devices
187              contain  MSP430F1612  chips.  By  sending  a   special   command
188              sequence,  you  can  obtain access to the bootloader and inspect
189              memory on the MSP430F1612 in the programming device itself.
190
191              Currently, only memory read/write and erase are  supported.  CPU
192              control via the bootloader is not possible.
193
194       flash-bsl
195              Connect  to the built-in bootloader in MSP430 devices with flash
196              bootloader memory. Devices with ROM bootloaders require  another
197              driver.  Currently,  this  driver  must mass-erase the device in
198              order to gain access. Read, write, and erase operations are sup‐
199              ported.
200
201              USB  connection  is not supported for this driver. Connection is
202              via serial port, and bootloader entry is  accomplished  via  the
203              RTS and DTR lines.  Connect RTS to the device's TEST pin and DTR
204              to the device's RST  pin.   Use  an  appropriate  serial  level-
205              shifter  to make the connection, if necessary.  If connecting to
206              a device with non-multiplexed JTAG  pins,  connect  RTS  to  the
207              device's TCK pin via an inverter.
208
209       gdbc   GDB  client  mode.  Connect to a server which implements the GDB
210              remote protocol and provide an interface  to  it.  To  use  this
211              driver, specify the remote address in hostname:port format using
212              the -d option.
213
214       tilib  Use the Texas Instruments MSP430.DLL to access the  device.  The
215              library file (MSP430.DLL for Windows, libmsp430.so for Unix-like
216              systems) must be present in the dynamic loader search path.
217
218              USB connection is not supported for  this  driver.  This  driver
219              supports  watchpoints.  Note  that the -d option for this driver
220              passes  its  argument  straight   through   to   the   library's
221              MSP430_Initialize  function.  Any  special argument supported by
222              that function is therefore accessible via the -d option.
223
224              Automatic device discovery works only on Linux and  Windows.  On
225              other  systems,  the appropriate ACM serial node must be explic‐
226              itly specified.
227
228       goodfet
229              Connect to a GoodFET device. JTAG mode must be  used,  and  only
230              tty  access  is  supported.  This  device can be used for memory
231              access (read, erase and program), but CPU  control  is  limited.
232              The  CPU  may  be halted, run and reset, but register access and
233              breakpoints aren't supported.
234
235       pif    Connect to a parallel-port JTAG controller. JTAG  mode  must  be
236              used,  and  only tty access is supported. Currently, this driver
237              is only supported on Linux, FreeBSD and DragonFly BSD. A  paral‐
238              lel  port  device  (ppdev on Linux, ppi on FreeBSD and DragonFly
239              BSD) must be specified via the -d option.
240
241       gpio   Connect to system gpios. JTAG mode must be used,  and  only  tty
242              access is supported. Currently, this driver is only supported on
243              Linux, FreeBSD and DragonFly BSD. The gpios to used must defined
244              using  a string like "tdi=7 tdo=8 tms=9 tck=4 rst=10 tst=11" via
245              the -d option. (dont forget the quotes)
246
247
248       load-bsl
249              Connect to a USB bootloader. The stub bootloader will be used to
250              load a fuller-featured bootloader into RAM for execution.
251
252       ezfet  This  driver  is  for Texas Instruments' eZ-FET devices. It sup‐
253              ports USB and tty access. It does not  support  breakpoint  con‐
254              trol.
255
256       rom-bsl
257              This driver is for the old-style (ROM) bootstrap loader. It sup‐
258              ports tty access only. Entry is attempted via the  RTS/DTR  sig‐
259              nals.  The  default  sequence  is DR,r,R,r,d,R:DR,r, but you can
260              override this with the --bsl-entry-sequence option.
261
262              WARNING: this driver unlocks the BSL by performing a mass erase.
263              There  are  reports of this operation causing an erase of info A
264              in some devices. Use at your own risk.
265
266       bus-pirate
267              Raw JTAG using Bus Pirate devices.
268

COMMANDS

270       MSPDebug can accept commands either through an interactive  prompt,  or
271       non-interactively  when  specified  on  the command line. The supported
272       commands are listed below.
273
274       Commands take arguments separated by spaces. Any text  string  enclosed
275       in  double-quotation  marks is considered to be a single argument, even
276       if it contains space characters. Within a quoted string, the  usual  C-
277       style backslash substitutions can be used.
278
279       Commands  can  be  specified  by giving the first few characters of the
280       command name, provided that the prefix is  unambiguous.  Some  commands
281       support  automatic  repeat.  For  these commands, pressing enter at the
282       reader prompt without typing anything will cause repeat execution.
283
284       ! [command [args ...]]
285              Invoke an interactive operating system shell. If  any  arguments
286              are  specified,  the first one is taken as a command to execute,
287              with the rest of the arguments as the arguments to the command.
288
289              This command is not yet available on non-POSIX systems.
290
291       = expression
292              Evaluate an address expression and show both its value, and  the
293              result  when  the  value  is looked up in reverse in the current
294              symbol table. This result is of the  form  symbol+offset,  where
295              symbol is the name of the nearest symbol not past the address in
296              question.
297
298              See the section marked ADDRESS EXPRESSIONS for more  information
299              on the syntax of expressions.
300
301       alias  Show a list of defined command aliases.
302
303       alias name
304              Remove a previously defined command alias.
305
306       alias name command
307              Define a command alias. The text command will be substituted for
308              name when looking up commands. The given command text  may  con‐
309              tain  a command plus arguments, if the entire text is wrapped in
310              quotes when defining the alias. To avoid alias substitution when
311              interpreting  commands,  prefix  the command with \ (a backslash
312              character).
313
314       blow_jtag_fuse
315              Blow the device's JTAG fuse.
316
317              WARNING: this is an irreversible operation!
318
319       break  Show a list of active breakpoints. Breakpoints can be added  and
320              removed with the setbreak and delbreak commands. Each breakpoint
321              is numbered with an integer index starting at 0.
322
323       cgraph address length [address]
324              Construct the call graph of all functions  contained  or  refer‐
325              enced  in the given range of memory. If a particular function is
326              specified, then details for that node  of  the  graph  are  dis‐
327              played. Otherwise, a summary of all nodes is displayed.
328
329              Information  from  the  symbol  table is used for hinting at the
330              possible locations of function starts. Any symbol which does not
331              contain a "."  is considered a possible function start.
332
333              Callers  and  callee names are shown prefixed by a "*" where the
334              transition is a tail-call type transition.
335
336       delbreak [index]
337              Delete one or  all  breakpoints.  If  an  index  is  given,  the
338              selected  breakpoint  is deleted. Otherwise, all breakpoints are
339              cleared.
340
341       dis address [length]
342              Dissassemble a section of memory. Both arguments may be  address
343              expressions. If no length is specified, a section of the default
344              length (64 bytes) is disassembled and shown.
345
346              If symbols are available, then all addresses  used  as  operands
347              are translated into symbol+offset form.
348
349              This  command supports repeat execution. If repeated, it contin‐
350              ues to disassemble another block of memory following  that  last
351              printed.
352
353       erase [all|segment|segrange] [address] [size] [segrange]
354              Erase  the device under test. With no arguments, all code memory
355              is erased (but not information or boot memory). With  the  argu‐
356              ment "all", a mass erase is performed (the results may depend on
357              the state of the LOCKA bit in the flash memory controller).
358
359              Specify "segment" and a memory address to  erase  an  individual
360              flash  segment. Specify "segrange", an address, size and segment
361              size to erase an arbitrary set of contiguous segments.
362
363       exit   Exit from MSPDebug.
364
365       fill address length b0 [b1 b2 ...]
366              Fill the memory region of size length starting at  address  with
367              the  pattern of bytes given (specified in hexadecimal). The pat‐
368              tern will be repeated without padding as many times as necessary
369              without exceeding the bounds of the specified region.
370
371       gdb [port]
372              Start  a  GDB  remote  stub, optionally specifying a TCP port to
373              listen on.  If no port is given, the default port is  controlled
374              by the option gdb_default_port.
375
376              MSPDebug  will  wait for a connection on this port, and then act
377              as a GDB remote stub until GDB disconnects.
378
379              GDB's "monitor" command can be used to issue  MSPDebug  commands
380              via the GDB interface. Supplied commands are executed non-inter‐
381              actively, and the output is sent back to be displayed in GDB.
382
383       help [command]
384              Show a brief listing of available commands. If  an  argument  is
385              specified,  show the syntax for the given command. The help text
386              shown when no argument is given  is  also  shown  when  MSPDebug
387              starts up.
388
389       hexout address length filename
390              Read  the  specified section of the device memory and save it to
391              an Intel HEX file. The address and length arguments may both  be
392              address expressions.
393
394              If  the specified file already exists, then it will be overwrit‐
395              ten. If you need to dump memory  from  several  disjoint  memory
396              regions,  you  can  do this by saving each section to a separate
397              file. The resulting files can then be concatenated  together  to
398              form a single valid HEX file.
399
400       isearch address length [options ...]
401              Search over the given range for an instruction which matches the
402              specified search criteria. The search may be narrowed by  speci‐
403              fying one or more of the following terms:
404
405              opcode opcode
406                     Match  the specified opcode. Byte/word specifiers are not
407                     recognised, as they are specified with other options.
408
409              byte   Match only byte operations.
410
411              word   Match only word operations.
412
413              aword  Match only address-word (20-bit) operations.
414
415              jump   Match only jump instructions  (conditional  and  uncondi‐
416                     tional  jumps, but not instructions such as BR which load
417                     the program counter explicitly).
418
419              single Match only single-operand instructions.
420
421              double Match only double-operand instructions.
422
423              noarg  Match only instructions with no arguments.
424
425              src address
426                     Match instructions with the specified value in the source
427                     operand. The value may be given as an address expression.
428                     Specifying this option implies matching of  only  double-
429                     operand instructions.
430
431              dst address
432                     Match instructions with the specified value in the desti‐
433                     nation operand.  This  option  implies  that  no-argument
434                     instructions are not matched.
435
436              srcreg register
437                     Match  instructions  using  the specified register in the
438                     source operand. This option implies matching of only dou‐
439                     ble-operand instructions.
440
441              dstreg register
442                     Match  instructions  using  the specified register in the
443                     destination operand.  This option implies  that  no-argu‐
444                     ment instructions are not matched.
445
446              srcmode mode
447                     Match instructions using the specified mode in the source
448                     operand. See below for a list of modes  recognised.  This
449                     option  implies  matching of only double-operand instruc‐
450                     tions.
451
452              dstmode mode
453                     Match instructions using the specified mode in the desti‐
454                     nation  operand.  See  below  for  a  list of modes. This
455                     option implies  that  no-argument  instructions  are  not
456                     matched.
457
458              For single-operand instructions, the operand is considered to be
459              the destination operand.
460
461              The seven addressing modes used by the MSP430 are represented by
462              single characters, and are listed here:
463
464              R      Register mode.
465
466              I      Indexed mode.
467
468              S      Symbolic mode.
469
470              &      Absolute mode.
471
472              @      Register-indirect mode.
473
474              +      Register-indirect mode with auto-increment.
475
476              #      Immediate mode.
477
478       load filename
479              Program  the  device  under test using the binary file supplied.
480              This command is like prog, but it does not load symbols or erase
481              the device before programming.
482
483              The CPU is reset and halted before and after programming.
484
485       load_raw filename address
486              Write  the data contained in a raw binary file to the given mem‐
487              ory address.
488
489              The CPU is reset and halted before and after programming.
490
491       md address [length]
492              Read the specified section of device memory and display it as  a
493              canonical-style  hexdump.  Both arguments may be address expres‐
494              sions. If no length is  specified,  a  section  of  the  default
495              length (64 bytes) is shown.
496
497              The  output  is split into three columns. The first column shows
498              the starting address for the line. The second column  lists  the
499              hexadecimal  values  of  the  bytes.  The final column shows the
500              ASCII characters corresponding to printable  bytes,  and  .  for
501              non-printing characters.
502
503              This  command supports repeat execution. If repeated, it contin‐
504              ues to  print  another  block  of  memory  following  that  last
505              printed.
506
507       mw address bytes ...
508              Write  a  sequence  of  bytes  at  the given memory address. The
509              address given may be an address  expression.  Bytes  values  are
510              two-digit hexadecimal numbers separated by spaces.
511
512       opt [name] [value]
513              Query, set or list option variables. MSPDebug's behaviour can be
514              configured using option variables, described below in  the  sec‐
515              tion OPTIONS.
516
517              Option  variables  may  be  of  three types: boolean, numeric or
518              text. Numeric values may be specified as address expressions.
519
520              With no arguments, this command displays  all  available  option
521              variables.   With  just  an option name as its argument, it dis‐
522              plays the current value of that option.
523
524       power info
525              Show basic power statistics gathered over the last few sessions.
526              This  includes  total  charge  consumption, run time and average
527              current.
528
529       power clear
530              Clear all recorded power statistics.
531
532       power all [granularity]
533              Show sample data gathered over all sessions. An optional  granu‐
534              larity  can  be specified, in microseconds. For each time slice,
535              relative session time, charge consumption,  current  consumption
536              and approximate code location are shown.
537
538       power session N [granularity]
539              Same  as  power  all, except that data is shown only for the Nth
540              session.
541
542       power export-csv N filename
543              Export raw sample data for the Nth session to the given file  in
544              CSV  format.  For each line, the columns are, in order: relative
545              time in microseconds, current consumption in  microamps,  memory
546              address.
547
548       power profile
549              If  a symbol table is loaded, compile and correlate all gathered
550              power data against the symbol table.  A  single  table  is  then
551              shown  listing,  per  function, charge consumption, run time and
552              average current. The functions are listed  in  order  of  charge
553              consumption (biggest consumers first).
554
555       prog filename
556              Erase  and reprogram the device under test using the binary file
557              supplied. The file format will be auto-detected and may  be  any
558              of the supported file formats.
559
560              In  the case of a file containing symbols, symbols will be auto‐
561              matically loaded from the file into the symbol table (discarding
562              any existing symbols), if they are present.
563
564              The CPU is reset and halted before and after programming.
565
566       read filename
567              Read commands from the given file, line by line and process each
568              one.  Any  lines  whose  first  non-space  character  is  #  are
569              ignored. If an error occurs while processing a command, the rest
570              of the file is not processed.
571
572       regs   Show the current value of all CPU registers in the device  under
573              test.
574
575       reset  Reset (and halt) the CPU of the device under test.
576
577       run    Start running the CPU. The interactive command prompt is blocked
578              when the CPU is started and the prompt  will  not  appear  again
579              until the CPU halts. The CPU will halt if it encounters a break‐
580              point, or if Ctrl-C is pressed by the user.
581
582              After the CPU halts, the current register values  are  shown  as
583              well  as  a  disassembly  of  the  first few instructions at the
584              address selected by the program counter.
585
586       save_raw address length filename
587              Save a region of memory to a raw binary file.  The  address  and
588              length arguments may both be address expressions.
589
590              If  the specified file already exists, then it will be overwrit‐
591              ten.
592
593       set register value
594              Alter the value of a register. Registers are specified  as  num‐
595              bers  from  0 through 15. Any leading non-numeric characters are
596              ignored (so a register may be specified as, for example, "R12").
597              The value argument is an address expression.
598
599       setbreak address [index]
600              Add  a  new  breakpoint.  The  breakpoint location is an address
601              expression. An optional index may be specified, indicating  that
602              this  new  breakpoint  should  overwrite an existing slot. If no
603              index is specified, then the breakpoint will be  stored  in  the
604              next unused slot.
605
606       setwatch address [index]
607              Add  a  new  watchpoint.  The  watchpoint location is an address
608              expression, and an optional index may be specified.  Watchpoints
609              are  considered  to be a type of breakpoint and can be inspected
610              or removed using the break and delbreak commands. Note that  not
611              all drivers support watchpoints.
612
613       setwatch_r address [index]
614              Add a watchpoint which is triggered only on read access.
615
616       setwatch_w address [index]
617              Add a watchpoint which is triggered only on write access.
618
619       simio add class name [args ...]
620              Add  a  new  peripheral to the IO simulator. The class parameter
621              may be any of the peripheral types named in the  output  of  the
622              simio  classes  command.  The  name  parameter  is a unique name
623              assigned by the user to this peripheral instance,  and  is  used
624              with other commands to refer to this instance of the peripheral.
625
626              Some  peripheral classes take arguments upon creation. These are
627              documented in the output to the simio help command.
628
629       simio classes
630              List the names of the different types of peripherals  which  may
631              be added to the simulator. You can use the simio help command to
632              obtain more information about each peripheral type.
633
634       simio config name param [args ...]
635              Configure or perform some action on a peripheral  instance.  The
636              param  argument  is  specific  to the peripheral type. A list of
637              valid configuration commands can be obtained by using the  simio
638              help command.
639
640       simio del name
641              Remove a previously added peripheral instance. The name argument
642              should be the name of the peripheral that was assigned with  the
643              simio add command.
644
645       simio devices
646              List  all peripheral instances currently attached to the simula‐
647              tor, along with their types and interrupt status. You can obtain
648              more  detailed information for each instance with the simio info
649              command.
650
651       simio help class
652              Obtain more information about a peripheral class. The documenta‐
653              tion  given  will  list  constructor arguments and configuration
654              parameters for the device type.
655
656       simio info name
657              Display detailed status information for a particular peripheral.
658              The  type  of  information displayed is specific to each type of
659              peripheral.
660
661       step [count]
662              Step the CPU through one or more instructions.  After  stepping,
663              the  new register values are displayed, as well as a disassembly
664              of the instructions at  the  address  selected  by  the  program
665              counter.
666
667              An optional count can be specified to step multiple times. If no
668              argument is given, the CPU steps  once.  This  command  supports
669              repeat execution.
670
671       sym clear
672              Clear the symbol table, deleting all symbols.
673
674       sym set name value
675              Set  or  alter  the value of a symbol. The value given may be an
676              address expression.
677
678       sym del name
679              Delete the given symbol from the symbol table.
680
681       sym import filename
682              Load symbols from the specified file and add them to the  symbol
683              table.   The file format will be auto-detected and may be either
684              ELF32 or a  BSD-style  symbol  listing  (like  the  output  from
685              nm(1)).
686
687              Symbols  can  be combined from many sources, as the syms command
688              adds to the existing symbol table  without  discarding  existing
689              symbols.
690
691       sym import+ filename
692              This  command  is  similar to sym import, except that the symbol
693              table is not cleared first. By using this command, symbols  from
694              multiple sources can be combined.
695
696       sym export filename
697              Save  all  symbols currently defined to the given file. The sym‐
698              bols are saved as a BSD-style symbol  table.  Note  that  symbol
699              types  are  not stored by MSPDebug, and all symbols are saved as
700              type t.
701
702       sym find [regex]
703              Search for symbols. If a regular expression is given,  then  all
704              symbols matching the expression are printed. If no expression is
705              specified, then the entire symbol table is listed.
706
707       sym rename regex string
708              Rename symbols by searching for those matching the given regular
709              expression  and  substituting  the  given string for the matched
710              portion. The symbols renamed are displayed, as well as  a  total
711              count of all symbols renamed.
712
713       verify filename
714              Compare  the  contents of the given binary file to the chip mem‐
715              ory. If any differences are found, a message is printed for  the
716              first mismatched byte.
717
718       verify_raw filename address
719              Compare  the  contents of a raw binary file to the device memory
720              at the given address. If any differences are found, a message is
721              printed for the first mismatched byte.
722

BINARY FORMATS

724       The following binary/symbol formats are supported by MSPDebug:
725
726              ELF32
727              COFF
728              Intel HEX (program only)
729              BSD symbol table (symbols only)
730              TI Text (program only)
731              SREC (program only)
732

IO SIMULATOR

734       The  IO  simulator  subsystem consists of a database of device classes,
735       and a list of instances of those classes. Each device class has a  dif‐
736       ferent  set  of  constructor  arguments,  configuration  parameters and
737       information which may be displayed. This section describes  the  opera‐
738       tion of the available device classes in detail.
739
740       In  the  list  below, each device class is listed, followed by its con‐
741       structor arguments.
742
743       gpio   Digital IO port simulator. This device simulates any of the dig‐
744              ital ports with or without interrupt capability. It has the fol‐
745              lowing configuration parameters:
746
747              base address
748                     Set the base address for this port. Note that  for  ports
749                     without  interrupt  capability,  the resistor enable port
750                     has a special address which is computable from  the  base
751                     address.
752
753              irq vector
754                     Enable  interrupt functionality for this port by specify‐
755                     ing an interrupt vector number.
756
757              noirq  Disable interrupt functionality for this port.
758
759              verbose
760                     Print a state change message every time the  port  output
761                     changes.
762
763              quiet  Don't  print  anything  when  the port state changes (the
764                     default).
765
766              set pin value
767                     Set the input pin state for the given pin on  this  port.
768                     The pin parameter should be an index between 0 and 7. The
769                     value should be either zero (for a low state) or non-zero
770                     (for a high state).
771
772       hwmult This  peripheral  simulates  the  hardware multiplier. It has no
773              constructor or configuration parameters, and  does  not  provide
774              any extended information.
775
776       timer [size]
777              This  peripheral  simulators Timer_A modules, and can be used to
778              simulate Timer_B modules, provided that  the  extended  features
779              aren't required.
780
781              The  constructor  takes a size argument specifying the number of
782              capture/compare registers in this peripheral instance. The  num‐
783              ber of such registers may not be less than 2, or greater than 7.
784
785              The  IO addresses and IRQs used are configurable. The default IO
786              addresses used are those specified for  Timer_A  in  the  MSP430
787              hardware documentation.
788
789              base address
790                     Alter the base IO address. By default, this is 0x0160. By
791                     setting this to 0x0180, a Timer_B  module  may  be  simu‐
792                     lated.
793
794              irq0 number
795                     Set  the TACCR0 interrupt vector number. By default, this
796                     is interrupt vector 9.  This interrupt is  self-clearing,
797                     and higher priority than the TACCR1/TAIFG vector.
798
799              irq1 number
800                     Set  the  TACCR1/TAIFG interrupt vector. By default, this
801                     is interrupt vector 8.
802
803              iv address
804                     Alter the address of the interrupt  vector  register.  By
805                     default,  this  is  0x012E.  By setting this to 0x011E, a
806                     Timer_B module may be simulated.
807
808              set channel value
809                     When Timer_A is used in capture mode, the CCI bit in each
810                     capture  register reflects the state of the corresponding
811                     input pin, and can't be altered in software. This config‐
812                     uration  command can be used to simulate changes in input
813                     pin state, and will trigger the corresponding  interrupts
814                     if the peripheral is so configured.
815
816       tracer [history-size]
817              The  tracer  peripheral is a debugging device. It can be used to
818              investigate and record the IO activity of a running program,  to
819              benchmark execution time, and to simulate interrupts.
820
821              The information displayed by the tracer gives a running count of
822              clock cycles from each of the system clocks, and an  instruction
823              count.  A  list of the N most recent IO events is also displayed
824              (this is configurable via the history-size argument of the  con‐
825              structor).  Each  IO  event is timestamped by the number of MCLK
826              cycles that have elapsed since the last reset  of  the  device's
827              counter.
828
829              The IO events that it records consist of programmed IO reads and
830              writes, interrupt acceptance, and  system  resets.  As  well  as
831              keeping  the  IO  events in a rotating buffer, the tracer can be
832              configured to display the events as they occur.
833
834              Note that since clock cycles don't advance while the  CPU  isn't
835              running,  this  peripheral  can  be  used to calculate execution
836              times for blocks of code. This can  be  achieved  by  setting  a
837              breakpoint  at  the  end  of the code block, setting the program
838              counter to the start of the code block, clearing the tracer  and
839              running  the code. After the breakpoint is reached, the informa‐
840              tion displayed by the tracer will contain a count of MCLK cycles
841              elapsed during the last run.
842
843              The configuration parameters for this device class are:
844
845              verbose
846                     Start  displaying  IO  events  as  they occur, as well as
847                     recording them in the rotating buffer.
848
849              quiet  Stop displaying IO events as they occur, and just  record
850                     them in the buffer.
851
852              trigger irq
853                     Signal an interrupt request to the CPU. This request will
854                     remain raised until accepted by the CPU or cleared by the
855                     user.
856
857              untrigger
858                     Clear a signalled interrupt request.
859
860              clear  Reset  the  clock  cycle and instruction counts to 0, and
861                     clear the IO event history.
862
863       wdt    This peripheral simulates the Watchdog Timer+, which can be used
864              in software either as a watchdog or as an interval timer. It has
865              no constructor arguments.
866
867              The simulated state  of  the  NMI/RST#  pin  can  be  controlled
868              through  a  configuration parameter. Note that if this pin state
869              is held low with the pin mode selected as a reset (the default),
870              the CPU will not run.
871
872              The  extended information for this peripheral shows all register
873              states, including the  hidden  counter  register.  Configuration
874              parameters are:
875
876              nmi state
877                     Set  the  NMI/RST# pin state. The argument should be zero
878                     to indicate a low state or non-zero for a high state.
879
880              irq irq
881                     Select the interrupt vector for interval timer mode.  The
882                     default is to use interrupt vector 10.
883

ADDRESS EXPRESSIONS

885       Any command which accepts a memory address, length or register value as
886       an argument may be given an address expression. An  address  expression
887       consists of an algebraic combination of values.
888
889       An address value can be one of the following:
890              A symbol name
891              A CPU register name preceded with "@"
892              A hex value preceded with the specifier "0x"
893              A decimal value preceded with the specifier "0d"
894              A  number  in the default input radix (without a specifier). See
895              the option iradix for more information.
896
897       The operators recognised are the usual algebraic operators: +, -, *, /,
898       %, ( and ). Operator precedence is the same as in C-like languages, and
899       the - operator may be used as a unary negation operator.
900
901       The following are all valid examples of address expressions:
902
903       2+2
904       table_start + (elem_size + elem_pad)*4
905       main+0x3f
906       __bss_end-__bss_start
907       @sp
908

OPTIONS

910       MSPDebug's behaviour can be configured via the following variables:
911
912       color (boolean)
913              If true, MSPDebug will colorize debugging output.
914
915       fet_block_size (numeric)
916              Change the size of the buffer used to  transfer  memory  to  and
917              from  the  FET. Increasing the value from the default of 64 will
918              improve transfer speed, but may cause problems with some chips.
919
920       enable_bsl_access (boolean)
921              If set, some drivers will allow erase/program  access  to  flash
922              BSL memory. If in doubt, do not enable this.
923
924       enable_locked_flash_access (boolean)
925              If set, some drivers will allow erase/program access to the info
926              A segment. If in doubt, do not enable this. Currently, the tilib
927              and uif drivers are affected by this option.
928
929       enable_fuse_blow
930              If  set,  some  drivers  will allow the JTAG security fuse to be
931              blown.
932
933              WARNING: this is an irreversible operation!
934
935              If in doubt, do not enable this option.
936
937       gdb_default_port (numeric)
938              This option controls the default TCP port for the GDB server, if
939              no argument is given to the "gdb" command.
940
941       gdb_loop (boolean)
942              Automatically  restart  the  GDB  server after disconnection. If
943              this option is set, then the GDB server keeps running  until  an
944              error occurs, or the user interrupts with Ctrl+C.
945
946       gdbc_xfer_size (numeric)
947              Maximum  size of memory transfers for the GDB client. Increasing
948              this value will result in faster transfers, but may cause  prob‐
949              lems with some servers.
950
951       iradix (numeric)
952              Default  input radix for address expressions. For address values
953              with no radix specifier, this value gives the input radix, which
954              is 10 (decimal) by default.
955
956       quiet (boolean)
957              If  set, MSPDebug will supress most of its debug-related output.
958              This option defaults to false, but can be set true  on  start-up
959              using the -q command-line option.
960

ENVIRONMENT

962       MSPDEBUG_TI3410_FW
963              Specifies the location of TI3410 firmware, for raw USB access to
964              FET430UIF or eZ430 devices. This  variable  should  contain  the
965              path  to  an Intel HEX file containing suitable firmware for the
966              TI3410.
967

FILES

969       ~/.mspdebug
970              File containing commands to be executed on startup.
971
972       ti_3410.fw.ihex
973              Firmware image for the TI3410 USB interface chip. This  file  is
974              only required for raw USB access to FET430UIF or eZ430 devices.
975

SEE ALSO

977       nm(1), gdb(1), objcopy(1)
978

BUGS

980       If  you  find  any  bugs,  you  should  report  them  to  the author at
981       dlbeer@gmail.com. It would help if you could include a transcript of an
982       MSPDebug  session  illustrating  the  program,  as well as any relevant
983       binaries or other files.
984
986       Copyright (C) 2009-2013 Daniel Beer <dlbeer@gmail.com>
987
988       MSPDebug is free software, distributed under the terms of the GNU  Gen‐
989       eral Public license (version 2 or later). See the file COPYING included
990       with the source code for more details.
991
992
993
994Version 0.25                      24 Jul 2017                      mspdebug(1)
Impressum