SourcePoint AMD Help

Table of Contents

msgreturndatasize

Retrieve the size (in bytes) of the return data that the JTAG message generates when scanned to the target devices.

Syntax

[result =] msgreturndatasize (msg-handle, data-size-var, device-array)

[result =] msgreturndatasize (msg-handle, data-size-var, device-id)

Where:

result

is a boolean variable that contains the return value of this command. TRUE indicates the command was successful. FALSE indicates an error occurred, such as the JTAG message was not found.

msg-handle

is the name of a previously defined debug variable of type handle.

data-size-var

is an ord4 debug variable that contains the return data size (in bytes). This is a reference parameter and is modified by the msgreturndatasize command.

device-array

is the previously defined ord2 array of device ids (so that multiple devices can be scanned simultaneously).

device-id

is the device id for a single target system device. This is a boundary scan list device position.

Discussion

Use the msgreturndatasize command to determine the size (in bytes) of the array to pass in to msgdata. The return-array used in the msgscan and msgdata commands must be at least this large, or an error is returned. The command returns an error if called before the JTAG message has been closed.

Different sets of devices can be used with this command as the number of bytes returned depends on the devices specified in the scan command. An error is returned if the devices in the device-array are not on the same debug port; no other verification of the list is done.

Example

Command input:

// Read JTAG ID from processor
define handle h
define ord2 device = 0
msgopen(h)
msgir(h, 8, 2) ย ย ย ย // 8=ir length, 2=idcode
msgdr(h, 0n32, 2)

msgclose(h)
msgscan(h, device)
define ord4 count = 0
msgreturndatasize(h, count, device)
define ord1 data[count]
msgdata(h, data)
data
msgdelete(h)

Related Topics: