diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index 70081d64b..353327a0f 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 c11a96063..d24b2c858 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 b4f24f7b5..4817c7524 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 7854c6e2f..4e9ea3a57 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 439c96e8d..6389469d7 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 ca5d7373b..16bcfed83 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c b/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c index 3aa6e4f8e..3d6f347b1 100644 --- a/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c +++ b/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c @@ -78,6 +78,7 @@ int deleteOldFile(char *mess) { LOG(logERROR, (mess)); return FAIL; } + LOG(logINFO, ("\tDeleted old programming file (%s)\n", TEMP_PROG_FILE_NAME)); return OK; } @@ -139,11 +140,12 @@ int copyToFlash(ssize_t fsize, char *clientChecksum, char *mess) { return FAIL; } +/* ignoring this until a consistent way to read from bfin flash if (verifyChecksumFromFlash(mess, clientChecksum, flashDriveName, fsize) == FAIL) { return FAIL; } - +*/ if (waitForFPGAtoTouchFlash(mess) == FAIL) { return FAIL; } @@ -312,7 +314,7 @@ int waitForFPGAtoTouchFlash(char* mess) { #ifdef VIRTUAL return OK; #endif - LOG(logINFO, ("Waiting for FPGA to program from flash\n")); + LOG(logINFO, ("\tWaiting for FPGA to program from flash\n")); int timeSpent = 0; int result = 0; @@ -339,9 +341,11 @@ int waitForFPGAtoTouchFlash(char* mess) { } // convert to int - if (sscanf(retvals, "%d", &result) != 1) { - sprintf(mess, "Could not program fpga. (could not scan int for gpio status: %s)\n", - retvals); + result = 1; + int retval = sscanf(retvals, "%d\n", &result); + if (retval != 1) { + sprintf(mess, "Could not program fpga. (could not scan int for gpio status: [%s] retval:%d, result:%d)\n", + retvals, retval, result); LOG(logERROR, (mess)); return FAIL; } diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 9719416fd..54fcbcf0a 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -445,11 +445,13 @@ int executeCommand(char *command, char *result, enum TLogLevel level) { memset(temp, 0, tempsize); memset(result, 0, MAX_STR_LENGTH); - LOG(level, ("Executing command:\n[%s]\n", command)); - strcat(command, " 2>&1"); + // copy command + char cmd[MAX_STR_LENGTH]= {0}; + sprintf(cmd, "%s 2>&1", command); + LOG(level, ("Executing command:\n[%s]\n", cmd)); fflush(stdout); - FILE *sysFile = popen(command, "r"); + FILE *sysFile = popen(cmd, "r"); while (fgets(temp, tempsize, sysFile) != NULL) { // size left excludes terminating character size_t sizeleft = MAX_STR_LENGTH - strlen(result) - 1; diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index db63991ce..a255469b4 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -3479,7 +3479,7 @@ void Module::programFPGAviaBlackfin(std::vector buffer) { // simulating erasing flash { - LOG(logINFO) << "Erasing Flash for module " << moduleIndex << " (" + LOG(logINFO) << "(Simulating) Erasing Flash for module " << moduleIndex << " (" << shm()->hostname << ")"; printf("%d%%\r", 0); std::cout << std::flush; @@ -3499,9 +3499,27 @@ void Module::programFPGAviaBlackfin(std::vector buffer) { printf("\n"); } - // copied to flash - LOG(logINFO) << "Writing to Flash to module " << moduleIndex << " (" - << shm()->hostname << ")"; + // simulating writing to flash + { + LOG(logINFO) << "(Simulating) Writing to Flash for module " << moduleIndex << " (" << shm()->hostname << ")"; + printf("%d%%\r", 0); + std::cout << std::flush; + // writing takes 30 seconds, printing here (otherwise need threads + // in server-unnecessary) + const int ERASE_TIME = 30; + int count = ERASE_TIME + 1; + while (count > 0) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + --count; + printf( + "%d%%\r", + static_cast( + (static_cast(ERASE_TIME - count) / ERASE_TIME) * 100)); + std::cout << std::flush; + } + printf("\n"); + } + if (client.Receive() == FAIL) { std::ostringstream os; os << "Detector " << moduleIndex << " (" << shm()->hostname << ")" diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index dd88cb7ba..9138b1a37 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -10,4 +10,4 @@ #define APIGOTTHARD2 0x210914 #define APIJUNGFRAU 0x210914 #define APIMYTHEN3 0x210914 -#define APIMOENCH 0x210909 +#define APIMOENCH 0x210914