Startup Options

From dmon2
Jump to navigationJump to search

Reference List

DMON supports the command line options below; further detail is provided according to category in the sections below.

Option Description
-abaud [integer] Set default baud rates for UARTs (not debug UART) - nearest valid rate is used - current default 38400
-allowips [IP IP1 ... IPn] Set allowed IP/IPs/HostName in Server mode; comma or space separated list.
-arm Start DMON in ARM mode and load ARM specific commands
-baud [integer] Set serial debug baud rate to 9600,19200,38400,57600,115200,230400,460800;(default 115200)
-brd [S698T,S698MIL,AT697,AGGA4] Specifies target board if no Plug-and-Play
-c [filename] Read and execute commands from file
-cas [delay] Programs SDRAM to either 2 or 3 cycles CAS delay. Default is 2.
-cfg [filename] read board configuration from file
-cginit Enable clock for all devices which have clock gating
-ddrinit Initialise S698PM DDR2 PHY (specific to DDR2 and S698PM, mandatory option after cold start)
-device specify the device for the Segger JLink (for ARM support)
-digilent Use JTAG debug link with Digilent JTAG-HS1 cable
-echo Echo batch commands to console
-eclipse Redirect output from DMON console to default stdout console. This allows another program ֠for example eclipse ֠to capture the output and display it.
-edac Enable EDAC operation (FTMCTRL only)
-eth <IP> Debug link to Ethernet; optional IP - default 192.168.0.51
-freq [double] Set the system frequency in MHz overriding the attempt to calculate using the timer.
-ftdi use FTDI JTAG link
-ftdilocid Set location ID to connect to FTDI if more than one connected to the PC
-ftdispeed Set user defined FTDI frequency passed in MHz
-gb2315 Use GB2312 character set for displaying memory and UART data
-gdb <port> Start GDB on start-up to listen on optional port - default 1234
-grcg [enable|disable][all|bit..bitN] Switch to Enable|Disable all, single bit or array of bits for GRCLKGATE_0 or -grcg_1 for GRCLKGATE_1, at DMON start up
-gui Start DMON in GUI Mode
-help <option> Show help for all command line options or one if an option specified after this option. DMON will exit afterwards.
-init [filename] Run a script prior to initialisation
-iomx set [configName configName ...] Switch to set IOMX configurations for Device or Array of Devices, when DMON starts
-ip [IP] Set default IP address for use on ethernet EDCL debug link; current value 192.168.0.51. DEPRECATED.
-lang [language] Change Language of Help file. Supported languages: English(en), Chinese(zh), Korean(ko), Russian(ru), Italian(it), Spanish(es). Sample: -lang zh
-leon2 Use internal LEON2 configuration
-license <haspid> Choose License key to use by setting HASP ID
-log [filename] Append commands and responses to the specified log file
-mcfg1 [value] Set the default value for memory configuration register 1
-mcfg2 [value] Set the default value for memory configuration register 2
-mcfg3 [value] Set the default value for memory configuration register 3
-nb Disable break on error traps (required for operating systems such as Linux which use traps)
-ni Do not initialise target on start-up. (Note: DDR Memory if present will be probed)
-niddr Do not probe DDR if present
-noflash Do not probe for flash memory at start-up
-nolink Do not use a debug link. For test purposes only. Not intended for users.
-noreadline Disable DMON console (for use when DMON is being used in the background as a GDB remote target for e.g. eclipse)
-normw Disables read-modify-write cycles for sub-word writes to 16- bit 32-bit areas with common write strobe
-nosdram Disable SDRAM
-nosram Disable SRAM and map SDRAM from the lowest address controlled by memory controller - usually 0x40000000
-pageb Enable SDRAM page-burst
-port [integer] Specify port for use with -gdb or GDB command. DEPRECATED pass the port to -gdb instead.
-postinit [filename] Run a script just after initialisation
-ppaddr [address] AHB Plug & Play start address. Required if Plug and Play area is not at standard address (0xFFFFF000 or 0xEFFFF000 for N2X)
-prefix [String] No effect without -echo. Prefix the echo of start-up batch commands with String (Note: spaces will be removed)
-preload Load python libraries before first use. Speeds up python initialisation of python command is issued later.
-python Set console language to python
-ram [ram_size] Overrides the auto-probed amount of static ram. Size is given in Kbytes.
-rambanks [ram_banks] Overrides the auto-probed number of populated ram banks.
-ramrws [waitstates] Set waitstates number of waitstates for ram reads.
-ramws [waitstates] Set waitstates number of waitstates for both ram reads and writes.
-ramwws [waitstates] Set waitstates number of waitstates for ram writes.
-remote [ipaddress] <port> connect to a DMON server at ipaddress and optionally on port - default port 55555
-romrws [waitstates] Set waitstates number of waitstates for rom reads.
-romws [waitstates] Set waitstates number of waitstates for both rom reads and writes.
-romwws [waitstates] Set waitstates number of waitstates for rom writes.
-rsedac Enable Reed-Solomon EDAC operation (FTMCTRL only)
-sampling_rate <rate> Set Sampling rate in ms for GUI to be refreshed
-segger Use Segger JLink (for ARM mode)
-server <ip address>:<port> Listen for DMON client connections on IP address and/or port (default local host IP and port 55555). IP Address listened on will be printed to console. DMON must be able to bind a socket to this address and port.
-session [String] Identity of existing session on server to which want to connect as remote client.
-setdownloaddir Set directory on Server to keep downloaded files
-spw <IP> <port> SpaceWire AGGA4 debug link over TCP/IP
-stack Set initial value for stack pointer
-swd use Segger JLink in swd mode (ARM mode)
-tcf Start TCF Agent. More can be found in 'Debugging with Eclipse TCF'
-tcl Set console language to Tcl
-trfc [val] Programs the SDRAM trcf field in mcfg2 to represent val nanoseconds.
-trp3 Programs the SDRAM trp timing to 3 (sets bit 30 in mcfg2). Default is 2.
-u <number or all> Set uart (not debug uart) to loopback. Sets UART0 by default
-uart <name or port no> Serial debug link. Optional device name or port number 0;1;.. default first available. e.g. on Linux ׵art /dev/ttyUSB0
-udip Start DMON in User defined IP mode. Expects to find a THIRD_PARTY.JAR. see User Defined IP section.
-udp [int] Default target port to use with Ethernet EDCL debug link - current value 8000
-usb use USB debug link
-utf8 Use UTF-8 character set for displaying memory and UART data
-xilinx <PRODUCT ID> use Xilinx USB to JTAG link; <Specify Product ID of XILINX device>
-xilinxindex <index> Specify Debug JTAG Interface if JTAG Chain has more than one device

Connection to the target

Options for connecting to the target are discussed in Srarting DMON along with the other details of the target link.

Configuring DMON

Some of the command line options are intended to modify the behaviour of DMON and do not affect the target. In particular, there are commands to modify the logging and display of start-up scripts.

Option Description
-echo Echo batch commands to console. If this option is not used then commands in scripts run with the c option will not be echoed to either the console or the log file.
-prefix [STRING] If the echo command is in use then the prefix will be prefixed to the commands echoed to the screen/log file. Note however that internal spaces will be removed from the string.
-log [FILENAME] Log commands and output to the specified file.
-freq [double] Set the system frequency in MHz overriding the attempt to calculate using the timer. This frequency is used in initialising memory and some other device initialisations where the correct value depends on the AHB bus speed.
-gb2312 Use GB2312 character set for displaying memory and UART data
-gui Start DMON in GUI Mode
-sampling_rate <rate> Set Sampling rate in ms for GUI to be refreshed
-help <option> Prints help for all command line options to stdout (not the DMON console). If an option is specified only the help for that command line option will be printed. DMON will exit afterwards.
-utf8 Use UTF-8 character set for displaying memory and UART data

Selecting a Target

DMON will detect the devices on a System on a Chip which implements the plug and play system at the expected address. For other systems, the configuration must be communicated to DMON. Some configurations are pre-coded in DMON and it only necessary to supply a command line switch. For others, a configuration file must be supplied. For ARM based systems, see ARM section.

Option Description
-brd [S698T,S698MIL,AT697,AGGA4] Specifies target board if no Plug-and-Play
-cfg [filename] read board configuration from file
-leon2 Use internal LEON2 configuration
-ppaddr [address] AHB Plug & Play start address. Required if Plug and Play area is not at standard address (0xFFFFF000 or 0xEFFFF000 for N2X recognised from the Board ID read at address 0xFFFFFFF0)

At present two configuration file formats are in use, one for SPARC systems (used with the –cfg switch), one for ARM systems (XML format but not loadable from file in the initial version). Further configuration file formats and associated start-up switches may be added in the future. The configuration file format used for SPARC emulates what would be read from a plug-and-play area with the addition of comment lines, indicated by an initial #

vnd dev ahbstart ahbend                                       apbstart apbend   irq
01  02  90000000 A0000000 00000000 00000000 00000000 00000000 00000000 00000000   0  # DSU
04  02  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000   0  # CPU
04  0F  00000000 1fffffff 20000000 3fffffff 40000000 7fffffff 80000000 80000008   0  # MEMCTRL
01  07  00000000 00000000 00000000 00000000 00000000 00000000 800000C0 800000CF   0  # Debug UART
 


The space separated columns are as follows:

1. Vendor ID

2. Device ID

3. 3 pairs of AHB start and end addresses

4. APB start and end addresses

5. IRQ Number

# defines a comment to the end of the line, which will be ignored.

(see also the savecfg DMON command)


Lines which contain errors will be ignored. The following error can occur

• one or more fields cannot be parsed as a hex number

• there are not 12 fields


DMON will accept configuration files with errors in the memory map, for example devices which overlap. However, a warning message will be printed to the console after initialisation.

Example error and warning messages, see below:

ERRORS/WARNINGS during configuration:
ERRORS/WARNINGS during configuration:
WARNING: line 22: Got 13 items, expected 11
WARNING: line 23: Got 11 items, expected 11
WARNING: Overlapping AHB addresses for 1:002 (line 21) and 4:00f (line 9): Start 0x50000000 < End 0x7fffffff
WARNING: Overlapping AHB addresses for 1:002 (line 6) and 1:002 (line 21): Start 0x90000000 < End 0xa0000000
WARNING: Overlapping AHB addresses for 1:002 (line 7) and 1:002 (line 6) : Start 1 0x00000006 == Start 2 0x90000000
WARNING: Line 17: Inconsistent APB address block for 4:009: Start 0x800000ae > End 0x800000ac
WARNING: Overlapping APB addresses for 4:017 (line 20) and 4:00f (line 9): Start 0x8000000c < End 0x80000010
WARNING: Overlapping APB addresses for 1:00c (line 12) and 1:00c (line 11): Start 0x80000074 < End 0x8000007f
WARNING: Overlapping APB addresses for 4:009 (line 19) and 4:009 (line 18): Start 1 0x00000012 == Start 2 0x800000b0

In Leon 2 mode DMON will ignore the plug-and-play area on the SoC (if present) and configure itself to work with the devices below at predefined bus addresses.


N.B. This is the default configuration, used if no plug-and-play area is found, or no DSU is identified in the plug and play area, and no other option is specified.


The default system is shown below:

LEON2 Debug Support Unit
8/16/32-bit PROM/SRAM/SDRAM controller	
Programmable UART with APB interface x 2	
LEON2 Interrupt Controller	
LEON2 Configuration Register	
LEON2 AHB Status Register	
LEON2 SPARC V8 Processor 
Serial/AHB debug interface 
LEON2 Timer Block 
LEON2 Write Protection Register
LEON2 Input/Output
 

Configuring the Target

Option Description
-ni Do not initialise target on start-up. (Note: DDR Memory if present will be probed)
-niddr "Do not initialise target on start-up, also do not probe DDR if present"
-noflash Do not probe for flash memory at start-up. Commands related to flash which are specific to the device connected will not be available until initialised using the flash command.

These options are designed to allow connecting to a target which is already executing a program without changing anything. Note that if the initialisation is not performed DMON will not be able to detect the properties of the attached memory and may not know the configuration of some devices. For example, the number of bits in timers is determined by writing to the registers and reading back what has been written. If –ni is used, then 32 bit timers and scalers will be assumed.

Initialisation at run time can be carried out using the init command.

Memory related options

On start-up DMON probes the memory attached to the chip depending on the memory controllers identified. The user can bypass this probe either partly or completely using a range of command line switches. Some of these take precedence over others. See also –ni and –niddr which bypass the memory initialisation as well as other initialisation steps. DMON will update the registers in the memory controller to reflect the memory identified by the probe.

Option Description
-cas [delay] Programs SDRAM to either 2 or 3 cycles CAS delay. Default is 2.
-ddrinit Initialise S698PM DDR2 PHY (specific to DDR2 and S698PM). Must be done once after power up. If not done when the DMON initialisation sequence attempts to read and write the DDR RAM area the debug link will be lost and the board will have to be reset. Note: on the N2X board a similar sequence is autonomously executed by DMON.
-edac Enable EDAC operation (FTMCTRL only)
-mcfg1 [value] Set the default value for memory configuration register 1
-mcfg2 [value] Set the default value for memory configuration register 2
-mcfg3 [value] Set the default value for memory configuration register 3
-normw Disables read-modify-write cycles for sub-word writes to 16-bit 32-bit areas with common write strobe
-nosdram Disable SDRAM
-nosram Disable SRAM and map SDRAM from the lowest address controlled by memory controller usually 0x40000000
-pageb Enable SDRAM page-burst
-ram [ram_size] Overrides the auto-probed amount of static ram. Size is given in Kbytes.
-rambanks [ram_banks] Overrides the auto-probed number of populated ram banks.
-ramrws [waitstates] Set waitstates number of waitstates for ram reads.
-ramws [waitstates] Set waitstates number of waitstates for both ram reads and writes.
-ramwws [waitstates] Set waitstates number of waitstates for ram writes.
-romrws [waitstates] Set waitstates number of waitstates for rom reads.
-romws [waitstates] Set waitstates number of waitstates for both rom reads and writes.
-romwws [waitstates] Set waitstates number of waitstates for rom writes.
-rsedac Enable Reed-Solomon EDAC operation (FTMCTRL only)
-stack Set initial value for stack pointer

Note: there are commands which can be run when DMON is running to modify values in the memory control registers.


Scripts run at start-up and during initialisation

Option Description
-c [filename] Read and execute commands from file; these will be run after start-up and initialisation
-init [filename] Run a script prior to initialisation
-postinit [filename] Run a script just after initialisation
-log [filename] Append commands and responses to file

DMON, Tcl or Python scripts can be specified on the command line to be run at particular points during start up. If a Tcl or Python script is specified a prior command or command line switch must have been specified for DMON to be in the correct mode: if a command line switch is used then the “shell” command must be issued in a script. Multiple scripts are executed in the order specified on the command line.

-init scripts are executed after the Plug and Play area or file is read to configure DMON, but before device initialisation is called. –postinit scripts are executed after DMON initialisation is complete.

Any valid DMON command may be used in these scripts; however the user needs to be aware of the side effects, attempting to run a programme prior to initialisation is likely to fail.  

Running with GDB and/or an IDE

It is possible to configure many ideas to communicate with a GDB remote target; DMON can function as a remote target. If DMON is to be run in the background, the options below can be used. Otherwise – to have the GUI available for example – only the –gdb switch should be used.

Option Description
-gdb <port> Start GDB on start-up to listen on optional port (default is 1234)
-eclipse Redirect output from DMON console to default stdout console. This allows another program (for example eclipse) to capture the output and display it.
-noreadline Disable DMON console (for use when DMON is being used in the background as a GDB remote target for e.g. eclipse)
-port [integer] Specify port for use with gdb option or GDB command. (DEPRECATED; pass the port to -gdb instead.)