blackfin fpga programming: if client socket killed or failure while writing to flash, only file pointer closed but fpga not asked to pick up from flash and client exception thrown. If all good and picking up from flash takes more than 10s, it will also throw exception in client. Client exception will prevent a reboot and hence allowing user to try to flash again.

This commit is contained in:
2020-10-16 15:02:45 +02:00
parent acf29b6db8
commit 5cd89487b6
4 changed files with 76 additions and 40 deletions

View File

@ -3166,6 +3166,15 @@ void Module::programFPGAviaBlackfin(std::vector<char> buffer) {
std::cout << std::flush;
}
std::cout << '\n';
// fpga has picked up from flash successfully
if (client.Receive<int>() == FAIL) {
std::ostringstream os;
os << "Detector " << moduleId << " (" << shm()->hostname << ")"
<< " returned error: " << client.readErrorMessage();
throw RuntimeError(os.str());
}
LOG(logINFO) << "FPGA programmed successfully";
rebootController();
}