mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 02:53:33 +08:00
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:
committed by
Lorenz Meier
parent
53249c53b5
commit
b184b61457
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user