diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index 527ec2f2e..eb279cf92 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer index 6db2860c4..a727a3af6 100755 Binary files a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer and b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 4a8ab9d36..7a9f06995 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index 151ffd6c6..56a1dc956 100755 Binary files a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer differ diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index abc4500bb..de269257d 100755 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer index b81ad51e7..10f8bf8a8 100755 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 69c718819..4feff6d8a 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/slsDetectorServer/include/programViaBlackfin.h b/slsDetectorServers/slsDetectorServer/include/programViaBlackfin.h index 5c8cbec53..0dabbfbec 100644 --- a/slsDetectorServers/slsDetectorServer/include/programViaBlackfin.h +++ b/slsDetectorServers/slsDetectorServer/include/programViaBlackfin.h @@ -11,8 +11,8 @@ #define BLACKFIN_DEFINED int defineGPIOpins(char *mess); -int FPGAdontTouchFlash(char *mess); -int FPGATouchFlash(char *mess); +int FPGAdontTouchFlash(char *mess, int programming); +int FPGATouchFlash(char *mess, int programming); int resetFPGA(char *mess); int emptyTempFolder(char *mess); diff --git a/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c b/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c index 0d5d6d840..2329f07cb 100644 --- a/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c +++ b/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c @@ -19,8 +19,11 @@ #define CMD_GPIO9_DEFINE "echo 9 > /sys/class/gpio/export" #define CMD_GPIO3_DEFINE "echo 3 > /sys/class/gpio/export" +// N config done #define CMD_GPIO7_EXIST "/sys/class/gpio/gpio7" +// N Config #define CMD_GPIO9_EXIST "/sys/class/gpio/gpio9" +// N CE (access to AS interface) #define CMD_GPIO3_EXIST "/sys/class/gpio/gpio3" #define CMD_GPIO9_DEFINE_OUT "echo out > /sys/class/gpio/gpio9/direction" @@ -29,8 +32,11 @@ #define CMD_GPIO9_DEFINE_IN "echo in > /sys/class/gpio/gpio9/direction" #define CMD_GPIO3_DEFINE_IN "echo in > /sys/class/gpio/gpio3/direction" +// nConfig #define CMD_GPIO9_DONT_TOUCH_FLASH "echo 0 > /sys/class/gpio/gpio9/value" -#define CMD_GPIO3_DONT_TOUCH_FLASH "echo 0 > /sys/class/gpio/gpio3/value" +// nCE +#define CMD_GPIO3_DONT_TOUCH_FLASH "echo 1 > /sys/class/gpio/gpio3/value" +// CD #define CMD_FPGA_PICKED_STATUS "cat /sys/class/gpio/gpio7/value" #define CMD_GET_FPGA_FLASH_DRIVE "awk \'$4== \"\\\"bitfile(spi)\\\"\" {print $1}\' /proc/mtd" @@ -69,7 +75,7 @@ int defineGPIOpins(char *mess) { if (FAIL == validateKernelVersion(KERNEL_DATE_VRSN_3GPIO)) { latestKernelVerified = 0; LOG(logWARNING, - ("Kernel too old to use gpio 3 pins. Update kernel to " + ("Kernel too old to use gpio3 (nCE). Update kernel to " "guarantee error-free fpga programming. \n\tNot the end " "of the world. Continuing with current kernel...\n")); } else { @@ -82,35 +88,35 @@ int defineGPIOpins(char *mess) { if (access(CMD_GPIO7_EXIST, F_OK) != 0) { if (executeCommand(CMD_GPIO7_DEFINE, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not define gpio7 pins for fpga (%s)\n", retvals); + "Could not define gpio7 (CD) for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio7: defined\n")); + LOG(logINFO, ("\tgpio7 (CD): defined\n")); } else { - LOG(logINFO, ("\tgpio7: already defined\n")); + LOG(logINFO, ("\tgpio7 (CD): already defined\n")); } // define gpio7 direction if (executeCommand(CMD_GPIO7_DEFINE_IN, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not set gpio7 as input for fpga (%s)\n", retvals); + "Could not set gpio7 (CD) as input for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio7: setting intput\n")); + LOG(logINFO, ("\tgpio7 (CD): setting intput\n")); // define gpio9 if (access(CMD_GPIO9_EXIST, F_OK) != 0) { if (executeCommand(CMD_GPIO9_DEFINE, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not define gpio9 pins for fpga (%s)\n", retvals); + "Could not define gpio9 (nConfig) for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio9: defined\n")); + LOG(logINFO, ("\tgpio9 (nConfig): defined\n")); } else { - LOG(logINFO, ("\tgpio9: already defined\n")); + LOG(logINFO, ("\tgpio9 (nConfig): already defined\n")); } // define gpio3 (not chip enable) @@ -118,21 +124,21 @@ int defineGPIOpins(char *mess) { if (access(CMD_GPIO3_EXIST, F_OK) != 0) { if (executeCommand(CMD_GPIO3_DEFINE, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not define gpio3 pins for fpga (%s)\n", + "Could not define gpio3 (nCE) for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio3: defined\n")); + LOG(logINFO, ("\tgpio3 (nCE): defined\n")); } else { - LOG(logINFO, ("\tgpio3: already defined\n")); + LOG(logINFO, ("\tgpio3 (nCE): already defined\n")); } } return OK; } -int FPGAdontTouchFlash(char *mess) { +int FPGAdontTouchFlash(char *mess, int programming) { #ifdef VIRTUAL return OK; #endif @@ -140,51 +146,51 @@ int FPGAdontTouchFlash(char *mess) { // define gpio9 as output if (executeCommand(CMD_GPIO9_DEFINE_OUT, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not set gpio9 as output for fpga (%s)\n", retvals); + "Could not set gpio9 (nConfig) as output for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio9: setting output\n")); + LOG(logINFO, ("\tgpio9 (nConfig): setting output\n")); // define gpio3 as output - if (latestKernelVerified == 1) { + if (programming && latestKernelVerified == 1) { if (executeCommand(CMD_GPIO3_DEFINE_OUT, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not set gpio3 as output for fpga (%s)\n", retvals); + "Could not set gpio3 (nCE) as output for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio3: setting output\n")); + LOG(logINFO, ("\tgpio3 (nCE): setting output\n")); } // tell FPGA to not: gpio9 if (executeCommand(CMD_GPIO9_DONT_TOUCH_FLASH, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not set gpio9 to not touch flash for fpga (%s)\n", + "Could not set gpio9 (nConfig) to not touch flash for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio9: fpga dont touch flash\n")); + LOG(logINFO, ("\tgpio9 (nConfig): fpga dont touch flash (Low)\n")); // tell FPGA to not: gpio3 - if (latestKernelVerified == 1) { + if (programming && latestKernelVerified == 1) { if (executeCommand(CMD_GPIO3_DONT_TOUCH_FLASH, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not set gpio3 to not touch flash for fpga (%s)\n", + "Could not set gpio3 (nCE) to not touch flash for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio3: fpga dont touch flash\n")); + LOG(logINFO, ("\tgpio3 (nCE): fpga dont touch flash (High)\n")); } // usleep(100*1000); return OK; } -int FPGATouchFlash(char *mess) { +int FPGATouchFlash(char *mess, int programming) { #ifdef VIRTUAL return OK; #endif @@ -192,20 +198,20 @@ int FPGATouchFlash(char *mess) { // tell FPGA to touch flash to program itself if (executeCommand(CMD_GPIO9_DEFINE_IN, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not set gpio9 as input for fpga (%s)\n", retvals); + "Could not set gpio9 (nConfig) as input for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio9: setting input\n")); + LOG(logINFO, ("\tgpio9 (nConfig): setting input\n")); - if (latestKernelVerified == 1) { + if (programming && latestKernelVerified == 1) { if (executeCommand(CMD_GPIO3_DEFINE_IN, retvals, logDEBUG1) == FAIL) { snprintf(mess, MAX_STR_LENGTH, - "Could not set gpio3 as input for fpga (%s)\n", retvals); + "Could not set gpio3 (nCE) as input for fpga (%s)\n", retvals); LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tgpio3: setting input\n")); + LOG(logINFO, ("\tgpio3 (nCE): setting input\n")); } return OK; } @@ -215,10 +221,10 @@ int resetFPGA(char *mess) { #ifdef VIRTUAL return OK; #endif - if (FPGAdontTouchFlash(mess) == FAIL) { + if (FPGAdontTouchFlash(mess, 0) == FAIL) { return FAIL; } - if (FPGATouchFlash(mess) == FAIL) { + if (FPGATouchFlash(mess, 0) == FAIL) { return FAIL; } usleep(CTRL_SRVR_INIT_TIME_US); @@ -341,7 +347,7 @@ int eraseAndWriteToFlash(char *mess, enum PROGRAM_INDEX index, } if (index == PROGRAM_FPGA) { - if (FPGAdontTouchFlash(mess) == FAIL) { + if (FPGAdontTouchFlash(mess, 1) == FAIL) { return FAIL; } } @@ -665,14 +671,14 @@ int writeToFlash(char *mess, ssize_t fsize, FILE *flashfd, FILE *srcfd) { int waitForFPGAtoTouchFlash(char *mess) { // touch and program - if (FPGATouchFlash(mess) == FAIL) { + if (FPGATouchFlash(mess, 1) == FAIL) { return FAIL; } #ifdef VIRTUAL return OK; #endif - LOG(logINFO, ("\tWaiting for FPGA to program from flash\n")); + LOG(logINFO, ("\tWaiting for FPGA to program from flash... \n\t[gpio7 (CD) should be High when done]\n")); int timeSpent = 0; int result = 0; @@ -710,8 +716,8 @@ int waitForFPGAtoTouchFlash(char *mess) { LOG(logERROR, (mess)); return FAIL; } - LOG(logDEBUG1, ("gpi07 returned %d\n", result)); + LOG(logDEBUG1, ("gpi07 (CD)returned %d\n", result)); } - LOG(logINFO, ("\tFPGA has picked up the program from flash\n")); + LOG(logINFO, ("\tFPGA has picked up the program from flash. gpio7 (CD) is High\n")); return OK; } diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index e1ad54420..ac817b386 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -5,10 +5,10 @@ #define APILIB 0x220408 #define APIRECEIVER 0x220408 #define APIGUI 0x220328 -#define APICTB 0x220516 -#define APIGOTTHARD 0x220516 -#define APIGOTTHARD2 0x220516 -#define APIJUNGFRAU 0x220516 -#define APIMYTHEN3 0x220516 -#define APIMOENCH 0x220503 -#define APIEIGER 0x220516 +#define APICTB 0x220518 +#define APIGOTTHARD 0x220518 +#define APIGOTTHARD2 0x220518 +#define APIJUNGFRAU 0x220518 +#define APIMYTHEN3 0x220518 +#define APIMOENCH 0x220517 +#define APIEIGER 0x220518