Introduction

This support module provides an ASYN driver to read board monitoring information from a QF2pre FPGA module.  The module consists of C source an example database and simple EDM engineering screens. 

Database Development

The example application distributed with this support module comes with a database containing all the following records and EDM screens to display them.  All record names begin with the macros $(P)$(R)QF2pre:.  Only the portion of the record names following this prefix are shown in the following tables.  All records have DTYP=asynInt32 and INP="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the qf2preMonitorConfigure command and xxx is a numeric value as described below. 

Readback Trigger

Board monitor readout is triggered whenever this binary-in record is processed.  Typically SCAN="10 second".  The QF2pre system controller FPGA scans the monitor points only once every couple of seconds so there is little reason to scan this record any faster.

Name
ASYN
Subaddress
Description
trigger_
0x00
Sends a monitor readback request to the QF2pre, awaits a reply, then initiates SCAN="I/O Intr" callbacks for all other records.

Board Monitors

These analog-in records must have SCAN="I/O Intr"and should have TSE="-2" to ensure that all receive the time stamp of the arrival of the readback packet.   The least significant 12 bits of the ASYN subaddress are the  index into the received packet of the most significant byte of the value.  The least significant byte of the value is the following byte.  The next three bits of the subaddress are the number of valid bits, minus 1, in the high byte of the value and the next bit of the subaddress is set if the value is signed.  All temperature values are in units of degrees Celsius, all voltage values are in units of Volts and all current values are in units of Amperes.

Name
ASYN
Subaddress
Description
K7:temp 0xB00 Kintex 7 tempeature sensor.
Board:temp 0xB04 Board temperature sensor.
TopFMCVADJ
0x704
Top FMC card VADJ supply voltage.
FMC3_3:V
0x706
FMC cards 3.3V supply voltage.
FMC12:V
0x708
FMC cards 12V supply voltage.
BtmFMCVADJ
0x70A
Bottom FMC card VADJ supply voltage.
LM4628:temp
0x70C
LM4628 voltage regulator temperature.
MAIN3_3
0x70E
Main 3.3V supply voltage.
K7A2_5:V
0x710
Kintex7 2.5V supply A voltage.
K7B2_5:V 0x712 Kintex7 2.5V supply B voltage.
Board12:V
0x714
QF2pre 12V supply voltage.
BOOT1_2:V
0x716
Bootstrap 1.2V supply voltage.
K7AUX1_8:V
0x718
Kintex7 auxiliary supply voltage.
K7INT1_0:V
0x71A
Kintex7 internal 1.0V supply voltage.
K7MGTAVTT
0x71C
Kintex 7 MGT VTT supply voltage.
K7MGTAVCC:V
0x71E
Kintex 7 MGT VCC supply voltage.
K7MGTAVCCAUX
0x720
Kintex 7 MGT auxiliary VCC supply voltage.
BOOT3_3:V
0x722
Bootstrap 3.3V supply voltage.
MAIN3_3:I
0x724
Main 3.3V supply current.
FMC3_3:I
0x728
FMC cards 3.3V supply current.
FMC12:I
0x72C
FMC cards 12V supply current.
VADJ:I
0x730
FMC cards VADJ supply current.
BOOT3_3:I
0x734
Bootstrap 3.3V supply current.
K7INT1_0:I
0x738
Kintex7 internal 1.0V supply current.
K7AUX1_8:I
0x73C
Kintex7 auxiliary supply current.
K7MGTAVCC:I
0x740
Kintex 7 MGT VCC supply current.
BOOT1_2:I
0x744
Bootstrap 1.2V supply current.
Board12:I
0x748
QF2pre 12V supply current.
fanSpeed
0x74C
Cooling fan speed (RPM).

Board Monitor Booleans

These analog-in records must have SCAN="I/O Intr"and should have TSE="-2" to ensure that all receive the time stamp of the arrival of the readback packet.   The least significant 12 bits of the ASYN subaddress are the  index into the received packet of the value. The next three bits of the subaddress are the number of the bit (0 is least significant).  The next bit is unused and the next bit is set to 0001 to indicate this is a Boolean value.

Name
ASYN
Subaddress
Description
I2Cerror 0x175E I2C readout fault latch.

Communication Statistics

These longin records form a histogram of I/O completion statistics.  Typically SCAN="10 second".

Name
ASYN
Subaddress
Description
CmdnRetryCount
0x200n
Number of monitor readback operations which completed in n (0 through 4) retries.
CmdFailedCount
0x2005
Number of monitor readback operations which failed to complete even after 4 retry attempts.


Using QF2preMonitor support in an application

Several files need minor modifications to use QF2preMonitor support in an application.

  1. Add the full path to the QF2preMonitor support directory to the application configure/RELEASE file:
    BPM=xxxx/modules/instrument/QF2PreMonitor/<release>/IOC/
    Where <release> is the release number of the QF2pre monitor support. You'll need to provide a similar line for the ASYN support module.
  2. Add instrument support to application database definition file
    The application database definition file must include the database definition files for the BPM. There are two ways that this can be done:
  3. Add the QF2preMonitor support libraries to the application
    You must link the QF2preMonitor support library and the ASYN support library with the application. Add the following lines to the application Makefile:
    xxx_LIBS += QF2preMonitor
    xxx_LIBS += asyn
    before the
    xxx_LIBS += $(EPICS_BASE_IOC_LIBS)
  4. Add one qf2preMonitorConfigure command for each QF2pre module, with arguments:
    1. The ASYN port name.
    2. The IPv4 address of the QF2pre module.
    3. The priority at which the port threads will run.  A missing value or a value of 0 confirms the default medium priority.
  5. Load a database file or files describing the records associated with each QF2pre board.  Set the $(PORT) macro to the ASYN port name given in the QF2preMonitor command and specify the $(P) and  $(R) macros to ensure unique record names.

Board Firmware/Reboot Control

Independent of the board health monitoring interface (described above), you may create an interface to read board ID/firmware information and to reboot the board. This interface uses the same mechanisms as the health monitoring interface but communicates via a different UDP port. (This interface is referred to as 'Utility' or 'Util' in the documentation, code, and databases.) To use this, make the following additions to the IOC startup file:
  • Add a qf2preUtilityConfigure command for each QF2pre module, with arguments:
    1. The ASYN port name. This name *must* be distinct from the port name used for the health monitoring interface.
    2. The IPv4 address of the QF2pre module.
    3. The priority at which the port threads will run.  A value of 0 confirms the default medium priority.
  • Load a database file or files describing the records associated with the QF2pre board utility support.  Set the $(PORT) macro to the ASYN port name given in the utility QF2preMonitor command and specify the $(P) and  $(R) macros to ensure unique record names.
  • Board Utility Booleans

    These analog-in records must have SCAN="I/O Intr"and should have TSE="-2" to ensure that all receive the time stamp of the arrival of the readback packet.   The least significant 12 bits of the ASYN subaddress are the  index into the received packet of the value. The next three bits of the subaddress are the number of the bit (0 is least significant).  The next bit is unused and the next bit is set to 0001 to indicate this is a Boolean value.

    Name
    ASYN
    Subaddress
    Description
    Type 0x00001 Board type, QF2-pre or BMB7.
    FwActive 0x00002 Active firmware, bootloader or runtime.

    Board Utility Waveforms/Strings

    These waveform records must have SCAN="I/O Intr"and should have TSE="-2" to ensure that all receive the time stamp of the arrival of the readback packet.   The least significant 7 bits of the ASYN subaddress are the byte index into received packet. The next 7 bits are the byte length. The last 2 bits give additional information:
  • Value of 0: QF2pre provides seconds since epoch, convert to UTC date string. (Use UTC for consistency with QF2pre python tools.)
  • Value of 1: Inverted order byte array waveform, convert to ASCII.


  • Name
    ASYN
    Subaddress
    Description
    BootldrFwDate 0x403 Bootloader FW build date.
    RuntimeFwDate 0x42B Runtime FW build date.
    BootldrFwHash 0x500A Bootloader FW SHA256
    RuntimeFwHash 0x5032 Runtime FW SHA256

    Board Utility Discrete Outputs

    This multi-bit binary output record, currently implemented, sends a single byte to the utility UDP port, so the mbbo 'VL' field values must be <= 255. The asyn address is 0.

    Name
    ASYN
    Subaddress
    Description
    Boot 0 Reboot board to specified firmware: Value of 0 for runtime FW. Value of 1 for bootloader FW.