This commit is contained in:
maliakal_d 2021-09-03 14:43:31 +02:00
parent 37acc9ec33
commit 8cc0804f99
3 changed files with 31 additions and 32 deletions

View File

@ -175,7 +175,7 @@ int startCopyingFPGAProgram(FILE **fd, uint64_t fsize, char *mess) {
LOG(logERROR, (mess));
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;
}

View File

@ -3722,8 +3722,8 @@ int program_fpga(int file_des) {
uint64_t filesize = 0;
if (receiveData(file_des, &filesize, sizeof(filesize), INT64) < 0)
return printSocketReadError();
LOG(logINFOBLUE, ("Program size is: %lld\n",
(long long unsigned int)filesize));
LOG(logDEBUG1,
("Program size is: %lld\n", (long long unsigned int)filesize));
// open file and allocate memory for part program
FILE *fd = NULL;
@ -3784,42 +3784,41 @@ int program_fpga(int file_des) {
}
free(src);
fclose(fd);
LOG(logINFO, ("\tCopying done\n"));
/* if (ret != FAIL) {
fpgasrc[totalsize] = '\0';
}*/
/* if (ret != FAIL) {
fpgasrc[totalsize] = '\0';
}*/
/*
/*
// opening file pointer to flash and telling FPGA to not touch flash
if (startWritingFPGAprogram(&fp) != OK) {
ret = FAIL;
sprintf(mess, "Could not write to flash. Error at startup.\n");
LOG(logERROR, (mess));
}
Server_SendResult(file_des, INT32, NULL, 0);
// opening file pointer to flash and telling FPGA to not touch
flash if (startWritingFPGAprogram(&fp) != OK) { ret = FAIL;
sprintf(mess, "Could not write to flash. Error at
startup.\n"); LOG(logERROR, (mess));
}
Server_SendResult(file_des, INT32, NULL, 0);
// erasing flash
if (ret != FAIL) {
eraseFlash();
}
// erasing flash
if (ret != FAIL) {
eraseFlash();
}
if (ret == OK) {
LOG(logINFO, ("Done copying program\n"));
// closing file pointer to flash and informing FPGA
ret = stopWritingFPGAprogram(fp);
if (ret == FAIL) {
strcpy(mess, "Failed to program fpga. FPGA is taking too long "
"to pick up program from flash! Try to flash "
"again without rebooting!\n");
LOG(logERROR, (mess));
}
}
*/
if (ret == OK) {
LOG(logINFO, ("Done copying program\n"));
// closing file pointer to flash and informing FPGA
ret = stopWritingFPGAprogram(fp);
if (ret == FAIL) {
strcpy(mess, "Failed to program fpga. FPGA is taking too
long " "to pick up program from flash! Try to flash " "again without
rebooting!\n"); LOG(logERROR, (mess));
}
}
*/
#endif // end of Blackfin programming

View File

@ -1293,7 +1293,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
}
// convert src to dst rawbin
LOG(logDEBUG1) << "Converting " << fname << " to " << destfname;
LOG(logINFOBLUE) << "Converting " << fname << " to " << destfname;
{
constexpr int pofNumHeaderBytes = 0x11C;
constexpr int pofFooterOfst = 0x1000000;
@ -1342,7 +1342,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
if (close(dst) != 0) {
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
FILE *fp = fopen(destfname, "r");