mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 01:50:40 +02:00
works for nios (without checksum in flash)
This commit is contained in:
parent
fdd8b52ce1
commit
ff6f960ba9
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -276,7 +276,7 @@ int verifyChecksumFromFlash(char *mess, char *clientChecksum, char *fname,
|
|||||||
|
|
||||||
// read only until a particular size (drive)
|
// read only until a particular size (drive)
|
||||||
if (fsize != 0 && totalBytesRead >= fsize) {
|
if (fsize != 0 && totalBytesRead >= fsize) {
|
||||||
LOG(logINFOBLUE, ("\tReached %lu bytes. Not reading more\n", totalBytesRead));
|
LOG(logINFO, ("\tReached %lu bytes. Not reading more\n", totalBytesRead));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
bytes = fread(buf, 1, readUnitSize, fp);
|
bytes = fread(buf, 1, readUnitSize, fp);
|
||||||
|
@ -57,12 +57,12 @@ int eraseAndWriteToFlash(char *mess, char *checksum, char *fpgasrc,
|
|||||||
if (writeToFlash(fsize, flashfd, fpgasrc, mess) == FAIL) {
|
if (writeToFlash(fsize, flashfd, fpgasrc, mess) == FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
/* ignoring this until a consistent way to read from nios flash
|
||||||
if (verifyChecksumFromFlash(mess, checksum, flashDriveName, fsize) ==
|
if (verifyChecksumFromFlash(mess, checksum, flashDriveName, fsize) ==
|
||||||
FAIL) {
|
FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ int eraseFlash(char *mess) {
|
|||||||
#endif
|
#endif
|
||||||
char cmd[MAX_STR_LENGTH] = {0};
|
char cmd[MAX_STR_LENGTH] = {0};
|
||||||
char retvals[MAX_STR_LENGTH] = {0};
|
char retvals[MAX_STR_LENGTH] = {0};
|
||||||
sprintf(cmd, "flash_erase %s", flashDriveName);
|
sprintf(cmd, "flash_erase %s 0 0", flashDriveName);
|
||||||
if (FAIL == executeCommand(cmd, retvals, logDEBUG1)) {
|
if (FAIL == executeCommand(cmd, retvals, logDEBUG1)) {
|
||||||
strcpy(mess, "Could not program fpga. (could not erase flash: ");
|
strcpy(mess, "Could not program fpga. (could not erase flash: ");
|
||||||
strncat(mess, retvals, sizeof(mess) - strlen(mess) - 1);
|
strncat(mess, retvals, sizeof(mess) - strlen(mess) - 1);
|
||||||
|
@ -3609,6 +3609,6 @@ void Module::programFPGAviaNios(std::vector<char> buffer) {
|
|||||||
throw RuntimeError(os.str());
|
throw RuntimeError(os.str());
|
||||||
}
|
}
|
||||||
LOG(logINFO) << "FPGA programmed successfully";
|
LOG(logINFO) << "FPGA programmed successfully";
|
||||||
//rebootController();
|
rebootController();
|
||||||
}
|
}
|
||||||
} // namespace sls
|
} // namespace sls
|
||||||
|
Loading…
x
Reference in New Issue
Block a user