mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 21:37:13 +02:00
jungfrau server: programfpga: handling bus error, and printing a message for user to restart servers when done in client command line
This commit is contained in:
Binary file not shown.
@ -7868,6 +7868,9 @@ int slsDetector::programFPGA(string fname){
|
|||||||
disconnectControl();
|
disconnectControl();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ret != FAIL) {
|
||||||
|
printf("You can now restart the detector servers in normal mode.\n");
|
||||||
|
}
|
||||||
|
|
||||||
//free resources
|
//free resources
|
||||||
if(fpgasrc != NULL)
|
if(fpgasrc != NULL)
|
||||||
|
@ -68,6 +68,7 @@ void eraseFlash(){
|
|||||||
printf("\nErasing Flash\n");
|
printf("\nErasing Flash\n");
|
||||||
#endif
|
#endif
|
||||||
char command[255];
|
char command[255];
|
||||||
|
memset(command, 0, 255);
|
||||||
sprintf(command,"flash_eraseall %s",mtdvalue);
|
sprintf(command,"flash_eraseall %s",mtdvalue);
|
||||||
system(command);
|
system(command);
|
||||||
printf("Flash erased\n");
|
printf("Flash erased\n");
|
||||||
@ -88,7 +89,14 @@ int startWritingFPGAprogram(FILE** filefp){
|
|||||||
char output[255];
|
char output[255];
|
||||||
memset(output, 0, 255);
|
memset(output, 0, 255);
|
||||||
FILE* fp = popen("awk \'$4== \"\\\"bitfile(spi)\\\"\" {print $1}\' /proc/mtd", "r");
|
FILE* fp = popen("awk \'$4== \"\\\"bitfile(spi)\\\"\" {print $1}\' /proc/mtd", "r");
|
||||||
fgets(output, sizeof(output), fp);
|
if (fp == NULL) {
|
||||||
|
cprintf(RED,"popen returned NULL. Need that to get mtd drive.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (fgets(output, sizeof(output), fp) == NULL) {
|
||||||
|
cprintf(RED,"fgets returned NULL. Need that to get mtd drive.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
pclose(fp);
|
pclose(fp);
|
||||||
//cprintf(RED,"output: %s\n", output);
|
//cprintf(RED,"output: %s\n", output);
|
||||||
memset(mtdvalue, 0, MTDSIZE);
|
memset(mtdvalue, 0, MTDSIZE);
|
||||||
@ -96,7 +104,7 @@ int startWritingFPGAprogram(FILE** filefp){
|
|||||||
char* pch = strtok(output,":");
|
char* pch = strtok(output,":");
|
||||||
if(pch == NULL){
|
if(pch == NULL){
|
||||||
cprintf(RED,"Could not get mtd value\n");
|
cprintf(RED,"Could not get mtd value\n");
|
||||||
return FAIL;
|
return 1;
|
||||||
}
|
}
|
||||||
strcat(mtdvalue,pch);
|
strcat(mtdvalue,pch);
|
||||||
printf ("\nFlash drive found: %s\n",mtdvalue);
|
printf ("\nFlash drive found: %s\n",mtdvalue);
|
||||||
|
Reference in New Issue
Block a user