mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 01:00:02 +02:00
blackfin server is not in memory
This commit is contained in:
parent
ec1ee635d5
commit
85d350b48b
@ -37,3 +37,4 @@ int writeToFlash(char *mess, ssize_t fsize, FILE *flashfd, FILE *srcfd);
|
||||
/** Notify fpga to pick up firmware from flash and wait for status confirmation
|
||||
*/
|
||||
int waitForFPGAtoTouchFlash(char *mess);
|
||||
int moveBinaryFile(char *mess, char *serverName);
|
||||
|
@ -574,3 +574,23 @@ int waitForFPGAtoTouchFlash(char *mess) {
|
||||
LOG(logINFO, ("\tFPGA has picked up the program from flash\n"));
|
||||
return OK;
|
||||
}
|
||||
|
||||
int moveBinaryFile(char *mess, char *serverName) {
|
||||
char *format = "mv %s %s";
|
||||
if (snprintf(cmd, MAX_STR_LENGTH, format, TEMP_PROG_FILE_NAME,
|
||||
serverName) >= MAX_STR_LENGTH) {
|
||||
strcpy(mess, "Could not copy detector server. Command "
|
||||
"to move server binary is too long\n");
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
if (executeCommand(cmd, retvals, logDEBUG1) == FAIL) {
|
||||
snprintf(mess, MAX_STR_LENGTH,
|
||||
"Could not copy detector server (moving). %s\n", retvals);
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("\tmoved from temp folder to main with proper name (%s)\n",
|
||||
serverName));
|
||||
return OK;
|
||||
}
|
||||
|
@ -9381,11 +9381,7 @@ void receive_program_via_blackfin(int file_des, enum PROGRAM_INDEX index,
|
||||
totalsize);
|
||||
break;
|
||||
case PROGRAM_SERVER:
|
||||
ret = writeBinaryFile(mess, serverName, src, totalsize);
|
||||
if (ret == OK) {
|
||||
ret = verifyChecksumFromFile(mess, functionType, checksum,
|
||||
serverName);
|
||||
}
|
||||
ret = moveBinaryFile(mess, serverName);
|
||||
if (ret == OK) {
|
||||
ret = setupDetectorServer(mess, serverName);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user