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)); 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;
} }

View File

@ -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,42 +3784,41 @@ 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';
}*/ }*/
/* /*
// 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);
// erasing flash // erasing flash
if (ret != FAIL) { if (ret != FAIL) {
eraseFlash(); eraseFlash();
} }
if (ret == OK) { if (ret == OK) {
LOG(logINFO, ("Done copying program\n")); LOG(logINFO, ("Done copying program\n"));
// 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)); }
} }
} */
*/
#endif // end of Blackfin programming #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 // 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");