IO: fix px4io uploader to work reliably on F7 platform.

- Missing get_sync() in verify function
- Allow some time to reboot before closing the serial port
  (closing the serial port drives TX low)
This commit is contained in:
Simon Laube
2018-01-16 08:36:51 +01:00
committed by Lorenz Meier
parent 53249c53b5
commit b184b61457
+16 -1
View File
@@ -645,6 +645,13 @@ PX4IO_Uploader::verify_rev3(size_t fw_size_local)
return ret;
}
ret = get_sync();
if (ret != OK) {
log("did not receive CRC checksum");
return ret;
}
/* compare the CRC sum from the IO with the one calculated */
if (sum != crc) {
log("CRC wrong: received: %d, expected: %d", crc, sum);
@@ -657,11 +664,19 @@ PX4IO_Uploader::verify_rev3(size_t fw_size_local)
int
PX4IO_Uploader::reboot()
{
int ret;
send(PROTO_REBOOT);
up_udelay(100 * 1000); // Ensure the farend is in wait for char.
send(PROTO_EOC);
return OK;
ret = get_sync();
if (ret == OK) {
up_udelay(10 * 1000); // Ensure that we do not close UART too soon
}
return ret;
}
void