Skip to content

Commit

Permalink
[rom_ext] Use the xmodem long timeout
Browse files Browse the repository at this point in the history
I have observed serveral test flakes at Xmodem packet boundaries (e.g.
kErrorXModemTimeoutStart).  Always use the long timeout at packet boundaries.

Signed-off-by: Chris Frantz <cfrantz@google.com>
(cherry picked from commit 4964248)
(cherry picked from commit 8c8efe8)
  • Loading branch information
cfrantz authored and github-actions[bot] committed Jan 23, 2025
1 parent fb97441 commit 633038a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sw/device/silicon_creator/lib/xmodem.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ void xmodem_ack(void *iohandle, bool ack) {
rom_error_t xmodem_recv_frame(void *iohandle, uint32_t frame, uint8_t *data,
size_t *rxlen, uint8_t *unknown_rx) {
uint8_t ch;
size_t n = xmodem_read(iohandle, &ch, sizeof(ch),
frame == 1 ? kXModemLongTimeout : kXModemShortTimeout);
size_t n = xmodem_read(iohandle, &ch, sizeof(ch), kXModemLongTimeout);
if (n == 0) {
return kErrorXModemTimeoutStart;
} else if (ch == kXModemStx || ch == kXModemSoh) {
Expand Down Expand Up @@ -117,6 +116,7 @@ rom_error_t xmodem_recv_frame(void *iohandle, uint32_t frame, uint8_t *data,
return kErrorXModemTimeoutCrc;
}
if (cancel) {
xmodem_cancel(iohandle);
return kErrorXModemCancel;
}

Expand Down

0 comments on commit 633038a

Please sign in to comment.