works for nios (without checksum in flash)

This commit is contained in:
maliakal_d 2021-09-14 16:24:49 +02:00
parent fdd8b52ce1
commit ff6f960ba9
9 changed files with 5 additions and 5 deletions

View File

@ -276,7 +276,7 @@ int verifyChecksumFromFlash(char *mess, char *clientChecksum, char *fname,
// read only until a particular size (drive)
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;
}
bytes = fread(buf, 1, readUnitSize, fp);

View File

@ -57,12 +57,12 @@ int eraseAndWriteToFlash(char *mess, char *checksum, char *fpgasrc,
if (writeToFlash(fsize, flashfd, fpgasrc, mess) == FAIL) {
return FAIL;
}
/* ignoring this until a consistent way to read from nios flash
if (verifyChecksumFromFlash(mess, checksum, flashDriveName, fsize) ==
FAIL) {
return FAIL;
}
*/
return OK;
}
@ -127,7 +127,7 @@ int eraseFlash(char *mess) {
#endif
char cmd[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)) {
strcpy(mess, "Could not program fpga. (could not erase flash: ");
strncat(mess, retvals, sizeof(mess) - strlen(mess) - 1);

View File

@ -3609,6 +3609,6 @@ void Module::programFPGAviaNios(std::vector<char> buffer) {
throw RuntimeError(os.str());
}
LOG(logINFO) << "FPGA programmed successfully";
//rebootController();
rebootController();
}
} // namespace sls