mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
wip
This commit is contained in:
parent
37acc9ec33
commit
8cc0804f99
@ -175,7 +175,7 @@ int startCopyingFPGAProgram(FILE **fd, uint64_t fsize, char *mess) {
|
|||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
LOG(logINFO, ("ready to copy program to %s\n", TEMP_PROG_FILE_NAME));
|
LOG(logINFO, ("Copying program to %s\n", TEMP_PROG_FILE_NAME));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3722,8 +3722,8 @@ int program_fpga(int file_des) {
|
|||||||
uint64_t filesize = 0;
|
uint64_t filesize = 0;
|
||||||
if (receiveData(file_des, &filesize, sizeof(filesize), INT64) < 0)
|
if (receiveData(file_des, &filesize, sizeof(filesize), INT64) < 0)
|
||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
LOG(logINFOBLUE, ("Program size is: %lld\n",
|
LOG(logDEBUG1,
|
||||||
(long long unsigned int)filesize));
|
("Program size is: %lld\n", (long long unsigned int)filesize));
|
||||||
|
|
||||||
// open file and allocate memory for part program
|
// open file and allocate memory for part program
|
||||||
FILE *fd = NULL;
|
FILE *fd = NULL;
|
||||||
@ -3784,6 +3784,7 @@ int program_fpga(int file_des) {
|
|||||||
}
|
}
|
||||||
free(src);
|
free(src);
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
|
LOG(logINFO, ("\tCopying done\n"));
|
||||||
|
|
||||||
/* if (ret != FAIL) {
|
/* if (ret != FAIL) {
|
||||||
fpgasrc[totalsize] = '\0';
|
fpgasrc[totalsize] = '\0';
|
||||||
@ -3791,11 +3792,10 @@ int program_fpga(int file_des) {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
// opening file pointer to flash and telling FPGA to not touch flash
|
// opening file pointer to flash and telling FPGA to not touch
|
||||||
if (startWritingFPGAprogram(&fp) != OK) {
|
flash if (startWritingFPGAprogram(&fp) != OK) { ret = FAIL;
|
||||||
ret = FAIL;
|
sprintf(mess, "Could not write to flash. Error at
|
||||||
sprintf(mess, "Could not write to flash. Error at startup.\n");
|
startup.\n"); LOG(logERROR, (mess));
|
||||||
LOG(logERROR, (mess));
|
|
||||||
}
|
}
|
||||||
Server_SendResult(file_des, INT32, NULL, 0);
|
Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
|
|
||||||
@ -3813,10 +3813,9 @@ int program_fpga(int file_des) {
|
|||||||
// closing file pointer to flash and informing FPGA
|
// closing file pointer to flash and informing FPGA
|
||||||
ret = stopWritingFPGAprogram(fp);
|
ret = stopWritingFPGAprogram(fp);
|
||||||
if (ret == FAIL) {
|
if (ret == FAIL) {
|
||||||
strcpy(mess, "Failed to program fpga. FPGA is taking too long "
|
strcpy(mess, "Failed to program fpga. FPGA is taking too
|
||||||
"to pick up program from flash! Try to flash "
|
long " "to pick up program from flash! Try to flash " "again without
|
||||||
"again without rebooting!\n");
|
rebooting!\n"); LOG(logERROR, (mess));
|
||||||
LOG(logERROR, (mess));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
@ -1293,7 +1293,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert src to dst rawbin
|
// convert src to dst rawbin
|
||||||
LOG(logDEBUG1) << "Converting " << fname << " to " << destfname;
|
LOG(logINFOBLUE) << "Converting " << fname << " to " << destfname;
|
||||||
{
|
{
|
||||||
constexpr int pofNumHeaderBytes = 0x11C;
|
constexpr int pofNumHeaderBytes = 0x11C;
|
||||||
constexpr int pofFooterOfst = 0x1000000;
|
constexpr int pofFooterOfst = 0x1000000;
|
||||||
@ -1342,7 +1342,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
|||||||
if (close(dst) != 0) {
|
if (close(dst) != 0) {
|
||||||
throw RuntimeError("Program FPGA: Could not close destination file");
|
throw RuntimeError("Program FPGA: Could not close destination file");
|
||||||
}
|
}
|
||||||
LOG(logDEBUG1) << "File has been converted to " << destfname;
|
LOG(logINFOBLUE) << "File has been converted to " << destfname;
|
||||||
|
|
||||||
// loading dst file to memory
|
// loading dst file to memory
|
||||||
FILE *fp = fopen(destfname, "r");
|
FILE *fp = fopen(destfname, "r");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user