diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index b89065bd7..c3376a566 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index d2d6a0807..b6d88758b 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 e95f999bc..d9eb9567c 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 90f7c19ad..614697738 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 594e08f41..689983ff1 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 4c7c91a3a..06de46a65 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 c71265ea7..5c8cbec53 100644 --- a/slsDetectorServers/slsDetectorServer/include/programViaBlackfin.h +++ b/slsDetectorServers/slsDetectorServer/include/programViaBlackfin.h @@ -29,9 +29,9 @@ int eraseAndWriteToFlash(char *mess, enum PROGRAM_INDEX index, ssize_t fsize, int forceDeleteNormalFile); int getDrive(char *mess, enum PROGRAM_INDEX index); /** Notify fpga not to touch flash, open src and flash drive to write */ -int openFileForFlash(char *mess, FILE **flashfd, FILE **srcfd, +int openFileForFlash(char *mess, enum PROGRAM_INDEX index, FILE **flashfd, FILE **srcfd, int forceDeleteNormalFile); -int checkNormalFile(char *mess, int forceDeleteNormalFile); +int checkNormalFile(char *mess, enum PROGRAM_INDEX index, int forceDeleteNormalFile); int eraseFlash(char *mess); /* write from tmp file to flash */ int writeToFlash(char *mess, ssize_t fsize, FILE *flashfd, FILE *srcfd); diff --git a/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c b/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c index 925f4d0de..4cdd9ee14 100644 --- a/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c +++ b/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c @@ -335,7 +335,7 @@ int eraseAndWriteToFlash(char *mess, enum PROGRAM_INDEX index, FILE *flashfd = NULL; FILE *srcfd = NULL; - if (openFileForFlash(mess, &flashfd, &srcfd, forceDeleteNormalFile) == + if (openFileForFlash(mess, index, &flashfd, &srcfd, forceDeleteNormalFile) == FAIL) { return FAIL; } @@ -440,7 +440,7 @@ int getDrive(char *mess, enum PROGRAM_INDEX index) { return OK; } -int openFileForFlash(char *mess, FILE **flashfd, FILE **srcfd, +int openFileForFlash(char *mess, enum PROGRAM_INDEX index, FILE **flashfd, FILE **srcfd, int forceDeleteNormalFile) { // open src file *srcfd = fopen(TEMP_PROG_FILE_NAME, "r"); @@ -454,8 +454,10 @@ int openFileForFlash(char *mess, FILE **flashfd, FILE **srcfd, } LOG(logDEBUG1, ("Temp file ready for reading\n")); - if (checkNormalFile(mess, forceDeleteNormalFile) == FAIL) + if (checkNormalFile(mess, index, forceDeleteNormalFile) == FAIL) { + fclose(*srcfd); return FAIL; + } // open flash drive for writing *flashfd = fopen(flashDriveName, "w"); @@ -472,7 +474,7 @@ int openFileForFlash(char *mess, FILE **flashfd, FILE **srcfd, return OK; } -int checkNormalFile(char *mess, int forceDeleteNormalFile) { +int checkNormalFile(char *mess, enum PROGRAM_INDEX index, int forceDeleteNormalFile) { #ifndef VIRTUAL // check if its a normal file or special file struct stat buf; @@ -484,7 +486,7 @@ int checkNormalFile(char *mess, int forceDeleteNormalFile) { LOG(logERROR, (mess)); return FAIL; } - // non zero = block special file + // zero = normal file (not block special file) if (S_ISBLK(buf.st_mode)) { // kernel memory is not permanent if (index != PROGRAM_FPGA) { @@ -496,18 +498,21 @@ int checkNormalFile(char *mess, int forceDeleteNormalFile) { LOG(logERROR, (mess)); return FAIL; } - // fpga memory stays after a reboot, so fix it if user allows - sprintf(mess, - "Could not %s. The flash drive found is a normal file. To " - "delete this file, create the flash drive and proceed with " - "programming, re-run the programming command with parameter " + + // user does not allow to fix it (default) + if (forceDeleteNormalFile == 0) { + sprintf(mess, + "Could not %s. The flash drive %s found for fpga programming is a normal file. To " + "fix this (by deleting this file, creating the flash drive and proceeding with " + "programming), re-run the programming command 'programfpga' with parameter " "'--force-delete-normal-file'\n", - messageType); - LOG(logERROR, (mess)); - // user does not allow (default) - if (!forceDeleteNormalFile) { + messageType, flashDriveName); + LOG(logERROR, (mess)); return FAIL; } + + // fpga memory stays after a reboot, user allowed to fix it + LOG(logWARNING, ("Flash drive invalidated (normal file). Fixing it...\n")); // user allows to fix it, so force delete normal file char cmd[MAX_STR_LENGTH] = {0}; @@ -530,7 +535,7 @@ int checkNormalFile(char *mess, int forceDeleteNormalFile) { LOG(logERROR, (mess)); return FAIL; } - LOG(logINFO, ("\tDeleted Normal File(%s)\n", flashDriveName)); + LOG(logINFO, ("\tDeleted Normal File (%s)\n", flashDriveName)); // create special drive if (snprintf(cmd, MAX_STR_LENGTH, "%s %s %s", @@ -552,6 +557,8 @@ int checkNormalFile(char *mess, int forceDeleteNormalFile) { return FAIL; } LOG(logINFO, ("\tSpecial File created (%s)\n", flashDriveName)); + } else { + LOG(logINFO, ("\tValidated flash drive (not a normal file)\n")); } #endif return OK; diff --git a/slsDetectorServers/slsDetectorServer/src/programViaNios.c b/slsDetectorServers/slsDetectorServer/src/programViaNios.c index 696f3c6cc..a1408338c 100644 --- a/slsDetectorServers/slsDetectorServer/src/programViaNios.c +++ b/slsDetectorServers/slsDetectorServer/src/programViaNios.c @@ -158,7 +158,7 @@ int openFileForFlash(char *mess, FILE **flashfd) { LOG(logERROR, (mess)); return FAIL; } - // non zero = block special file + // zero = normal file (not block special file) if (S_ISBLK(buf.st_mode)) { // memory is not permanent sprintf(mess, @@ -169,6 +169,7 @@ int openFileForFlash(char *mess, FILE **flashfd) { LOG(logERROR, (mess)); return FAIL; } + LOG(logINFO, ("\tValidated flash drive (not a normal file)\n")); #endif *flashfd = fopen(flashDriveName, "w"); diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index a732e143f..fc32272ea 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -9450,7 +9450,7 @@ int receive_program(int file_des, enum PROGRAM_INDEX index) { sizeof(forceDeleteNormalFile), INT32) < 0) return printSocketReadError(); LOG(logINFO, - ("\tForce Delete Normal File: %d\n", forceDeleteNormalFile)); + ("\tForce Delete Normal File flag? %s\n", (forceDeleteNormalFile ? "Y" : "N"))); #endif // in same folder as current process (will also work for virtual then diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index f50265084..278993a66 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -6,10 +6,10 @@ #define APIRECEIVER 0x211124 #define APIGUI 0x211124 +#define APIEIGER 0x220324 #define APICTB 0x220324 #define APIGOTTHARD 0x220324 #define APIGOTTHARD2 0x220324 #define APIJUNGFRAU 0x220324 #define APIMYTHEN3 0x220324 #define APIMOENCH 0x220324 -#define APIEIGER 0x220324