diff --git a/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h b/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h index a47e5c92a..dab12d79c 100644 --- a/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h +++ b/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h @@ -1,15 +1,16 @@ #pragma once /* Definitions for FPGA*/ +#define REG_OFFSET (4) #define BASE_CONTROL (0x000) #define BASE_ACQUISITION (0x200) #define BASE_UDP_RAM (0x1000) /* Module Control Board Serial Number register */ -#define MCB_SERIAL_NO_REG (0x00 + BASE_CONTROL) +#define MCB_SERIAL_NO_REG (0x000 * REG_OFFSET + BASE_CONTROL) /* FPGA Version register */ -#define FPGA_VERSION_REG (0x04 + BASE_CONTROL) +#define FPGA_VERSION_REG (0x001 * REG_OFFSET + BASE_CONTROL) #define FPGA_COMPILATION_DATE_OFST (0) #define FPGA_COMPILATION_DATE_MSK (0x00FFFFFF << FPGA_COMPILATION_DATE_OFST) @@ -17,7 +18,7 @@ #define DETECTOR_TYPE_MSK (0x000000FF << DETECTOR_TYPE_OFST) /* API Version register */ -#define API_VERSION_REG (0x08 + BASE_CONTROL) +#define API_VERSION_REG (0x002 * REG_OFFSET + BASE_CONTROL) #define API_VERSION_OFST (0) #define API_VERSION_MSK (0x00FFFFFF << API_VERSION_OFST) @@ -25,20 +26,22 @@ #define API_VERSION_DETECTOR_TYPE_MSK (0x000000FF << API_VERSION_DETECTOR_TYPE_OFST) //Not used in software /* Fix pattern register */ -#define FIX_PATT_REG (0x0D + BASE_CONTROL) +#define FIX_PATT_REG (0x003 * REG_OFFSET + BASE_CONTROL) #define FIX_PATT_VAL (0xACDC2019) /* Status register */ -#define STATUS_REG (0x12 + BASE_CONTROL) +#define STATUS_REG (0x004 * REG_OFFSET + BASE_CONTROL) #ifdef VIRTUAL #define RUN_BUSY_OFST (0) #define RUN_BUSY_MSK (0x00000001 << RUN_BUSY_OFST) #endif -/* Look at me register */ -#define LOOK_AT_ME_REG (0x16 + BASE_CONTROL) +/* Look at me read only register */ +#define LOOK_AT_ME_REG (0x005 * REG_OFFSET + BASE_CONTROL) +/** DTA Offset Register */ +#define DTA_OFFSET_REG (0x104 * REG_OFFSET + BASE_CONTROL) /* Pattern Control FPGA registers TODO --------------------------------------------------*/ diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 714924ac2..bfd2b0ccf 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 46fe54b8f..e07b0a009 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -73,7 +73,7 @@ void basictests() { return; } // does check only if flag is 0 (by default), set by command line - if ((!debugflag) && ((testFpga() == FAIL))) { + if ((!debugflag) && ((testFpga() == FAIL) || (testBus() == FAIL))) { sprintf(firmware_message, "Could not pass basic tests of FPGA and bus. Dangerous to continue. (Firmware version:0x%llx) \n", getDetectorId(DETECTOR_FIRMWARE_VERSION)); FILE_LOG(logERROR, ("%s\n\n", firmware_message)); @@ -193,7 +193,7 @@ int testBus() { FILE_LOG(logINFO, ("Testing Bus:\n")); int ret = OK; - u_int32_t addr = LOOK_AT_ME_REG; + u_int32_t addr = DTA_OFFSET_REG; int times = 1000 * 1000; int i = 0; diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 83e54db84..73b682cd6 100755 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -37,8 +37,6 @@ void basictests(); #if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D) int checkType(); int testFpga(); -#endif -#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) int testBus(); #endif