diff --git a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.7 b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.7 deleted file mode 100755 index 5338dc3b6..000000000 Binary files a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.7 and /dev/null differ diff --git a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.8 b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.8 new file mode 100755 index 000000000..059306311 Binary files /dev/null and b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.8 differ diff --git a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c index b4f89ff31..1c9ffe45f 100644 --- a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -25,11 +25,17 @@ int32_t clkPhase[2] = {0, 0}; /* basic tests */ -void checkFirmwareCompatibility() { +void checkFirmwareCompatibility(int flag) { defineGPIOpins(); resetFPGA(); - if ((mapCSP0() == FAIL) || (checkType() == FAIL) || (testFpga() == FAIL) || (testBus() == FAIL)) { + if (mapCSP0() == FAIL) { + cprintf(BG_RED, "Dangerous to continue. Goodbye!\n"); + exit(EXIT_FAILURE); + } + + // does check only if flag is 0 (by default), set by command line + if ((!flag) && ((checkType() == FAIL) || (testFpga() == FAIL) || (testBus() == FAIL))) { cprintf(BG_RED, "Dangerous to continue. Goodbye!\n"); exit(EXIT_FAILURE); } diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorFunctionList.h b/slsDetectorSoftware/slsDetectorServer/slsDetectorFunctionList.h index 648dbb448..02822cf5a 100644 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorFunctionList.h +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorFunctionList.h @@ -17,7 +17,7 @@ Here are the definitions, but the actual implementation should be done for each // basic tests -void checkFirmwareCompatibility(); +void checkFirmwareCompatibility(int flag); #ifdef JUNGFRAUD int checkType(); u_int32_t testFpga(void); diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer.c b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer.c index 4a59e28c1..7b9ba8197 100755 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer.c +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer.c @@ -23,11 +23,20 @@ int main(int argc, char *argv[]){ int portno, b; int retval=OK; int sd, fd; + int debugflag = 0; // if socket crash, ignores SISPIPE, prevents global signal handler // subsequent read/write to socket gives error - must handle locally signal(SIGPIPE, SIG_IGN); + // circumvent the basic tests + if(argc > 1) { + if(!strcasecmp(argv[1],"-debug")){ + debugflag = 1; + argc=1; + } + } + #ifdef STOP_SERVER char cmd[100]; @@ -40,9 +49,10 @@ int main(int argc, char *argv[]){ "********************************************************\n\n" , portno); b=1; - basictests(); + basictests(debugflag); #ifdef STOP_SERVER sprintf(cmd,"%s %d &",argv[0],DEFAULT_PORTNO+1); + //cprintf(BLUE,"cmd:%s\n", cmd); system(cmd); #endif } else { diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c index 6f1445dee..8b3b29649 100755 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c @@ -38,7 +38,7 @@ int (*flist[NUM_DET_FUNCTIONS])(int); char mess[MAX_STR_LENGTH]; int dataBytes = 10; int isControlServer = 0; - +int debugflag = 0; /* initialization functions */ @@ -47,9 +47,10 @@ int printSocketReadError() { return FAIL; } -void basictests() { +void basictests(int flag) { + debugflag = flag; #ifdef SLS_DETECTOR_FUNCTION_LIST - checkFirmwareCompatibility(); + checkFirmwareCompatibility(debugflag); #endif } @@ -4605,7 +4606,7 @@ int program_fpga(int file_des) { printf("Done with program receiving command\n"); #endif if (isControlServer) - basictests(); + basictests(debugflag); init_detector(isControlServer); } #endif @@ -4653,7 +4654,7 @@ int reset_fpga(int file_des) { #ifdef SLS_DETECTOR_FUNCTION_LIST else { if (isControlServer) - basictests(); + basictests(debugflag); init_detector(isControlServer); ret = FORCE_UPDATE; } diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.h b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.h index 68cba7e0c..e98feb57f 100755 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.h +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.h @@ -6,7 +6,7 @@ // initialization functions int printSocketReadError(); -void basictests(); +void basictests(int); void init_detector(int); int decode_function(int); const char* getFunctionName(enum detFuncs func);