pfbCmd

pfbCmd — issues queries and low-level commands to the Pfbprofi module.

Synopsis

(pfbCmd)
(pfbCmd card_id cmd)
(pfbCmd card_id)
  

Parameters

card_id
The target card ID (0..3). If no parameters are specified, then the command will scan the system for a new SST-PFB PCI card.
cmd
The command to execute, one of:
CMD_GO_ONGo online.
CMD_GO_OFFGo offline, or abort configuration. (See Description.)
CMD_REINITReinitialize card memory and all parameters.
CMD_CLR_CFG_BUFInitialize binary cfg data page.
CMD_CPY_MAS_CFGRead current binary cfg data page.
CMD_CFG_2BF_SHRAMProcess binary cfg data.
CMD_CHK_NET_CFGCheck network parameters and assign defaults.
CMD_AUTO_BAUD_DETDo automatic network baud rate detection.
CMD_MAS_ASIGN_ADDRAssign and fill in page/offset for DP master.
CMD_AUTO_DP_CFGDo automatic scan for slave configuration.
CMD_CFG_FROM_FLASHConfigure card from configuration in flash.
CMD_FLASH_GO_ONConfigure card from flash, then go online.
CMD_PGM_TO_FLASHBurn card configuration into flash.
CMD_ERR_ACKAcknowledge offline error.

Returns

If successful, the response will depend on the form of the command (see below) and the Pfbprofi command, if issued. Otherwise, one of the following:

(error "pfbCmd DR_ERR_CARD_INVALID (time) invalid card: card_id")
(error "pfbCmd PFB_ERR_NO_CARD (time) Card not available")
(error "pfbCmd PFB_ERR_CMD_UNDEFINED (time) Cmd not defined")
(error "pfbCmd PFB_ERR_CMD_TIMEOUT (time) Cmd failed (timeout)")
(error "pfbCmd PFB_ERR_CMD_INVALID (time) Cmd not valid in current card state")

Description

This command provides access to the command register. The card accepts commands only when it is offline, with the exception of the command to go offline. If any other command is issued when the card is online, the command register is set to CMD_ERROR, the status register to STS_BAD_CMD, and the card goes offline.

[Important]

If the card is taken off-line, the network parameters must be reconfigured (see pfbNetParms).

The pfbCmd command supports the three following syntax variations:

  1. (pfbCmd)  queries the list of available Pfbprofi commands. This serves as a helpful reminder in interactive debug scenarios.
    Returns a list of the above commands:
    (pfbCmd CMD_GO_ON .... CMD_ERR_ACK)
  2. (pfbCmd card_id cmd) executes the specified command.
    Returns the list:
    (pfbCmd card_id cmd response response_str)
    where cmd is one of the commands defined above; and response and response_str is are in one of the following groups:
    responseresponse_strdescription
    0xe0CMD_OFFCard is offline, ready to receive commands.
    0xe1CMD_ONCard is online, ready to receive offline command.
    0xe2CMD_COM_CFGCard is being configured via the serial port.
    0xe3CMD_ERRORCard is in error, see status code.
  3. (pfbCmd card_id)  queries the status of the last command issued to the card.
    Returns the list:
    (pfbCmd card_id response status status_str)
    where response is one of the command responses defined above and status and status_str are in one of the following groups:
    statusstatus_str
    0x00"PFB: Cmd status: no error"
    0x01"PFB: Cmd invalid"
    Network Parameter errors
    0x02"PFB: Bad Baud"
    0x03"PFB: Bad Station Address"
    0x04"PFB: Bad HI Station Address"
    0x05"PFB: Bad Token Rot"
    0x06"PFB: Bad Slot Time"
    0x07"PFB: Bad Idle 1"
    0x08"PFB: Bad Idle 2"
    0x09"PFB: Bad Ready Time"
    0x0a"PFB: Bad Quit Time"
    0x0b"PFB: Bad Gap Update"
    0x0c"PFB: Bad Token Retry"
    0x0d"PFB: Bad Message Retry"
    0x0e"PFB: Bad Token Error Limit"
    0x0f"PFB: Bad Response Error Limit"
    0x10"PFB: Unable to detect baud rate"
    Siemens COM PROFIBUS (ET200) Configuration Errors
    0x20"PFB: ET200 Binary file corrupted (chk pattern)"
    0x21"PFB: ET200 Binary file corrupted (too short)"
    0x22"PFB: ET200 Binary file corrupted (too long)"
    0x23"PFB: ET200 Binary file corrupted (bad checksum)"
    0x24"PFB: ET200 Binary file corrupted (invalid cpu header)"
    0x25"PFB: ET200 Binary file corrupted (invalid slave record type)"
    0x26"PFB: Too much Master Rx data has been configured (16k max)"
    0x27"PFB: Too much Master Tx data has been configured (16k max)"
    0x28"PFB: Name parm too long (>12 chrs)"
    0x29"PFB: Unrecognized argument"
    0x2a"PFB: Invalid Rx offs parm (0000-3ff8)"
    0x2b"PFB: Invalid Tx offs parm (0000-3ff8)"
    0x2c"PFB: Rx,Tx Ofs have been spec'd for one but not all slaves"
    0x2d"PFB: Rx data of one blk overlaps another"
    0x2e"PFB: Tx data of one blk overlaps another"
    0x2f"PFB: Invalid parm or check data length"
    0x35"PFB: Out of master extension memory"
    0x37"PFB: Address out of range"
    0x38"PFB: Not enough room in copy table"
    Flash Programming Errors
    0x30"PFB: No cfg to program into flash"
    0x31"PFB: Bad Flash ID"
    0x32"PFB: Flash Erase error"
    0x33"PFB: Flash Program error"
    0x34"PFB: Flash Verify error"
    Layer2 Errors
    0x36"PFB LAY2M: Invalid Maximum Length"
    Fatal Errors where Card must be Rerun or Reloaded
    0x80"PFB FATAL: Internal Configuration Error"
    0x81"PFB FATAL: Out of APBS"
    0x82"PFB FATAL: Watchdog timeout"
    0x83"PFB FATAL: Heap Allocation Failure"
    0x84"PFB FATAL: SH Heap Allocation Failure"
    0x90"PFB FATAL: Net error, OPTION_STAY_OFF_ERR set, card is offline"

Example

> (pfbCmd 0 CMD_GO_ON)
(pfbCmd 0 CMD_GO_ON 0xe1 "CMD_ON")
> (pfbCmd 0)
(dnsCmd 0 CMD_ON 0 "PFB: Cmd status: no error")