From: Greg Darke Date: Mon, 6 Nov 2017 00:55:26 +0000 (-0800) Subject: Wait longer before giving up on the 2nd tftp block. X-Git-Tag: 24jan2021_ls180~1776^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bbd15ca567f831a6f9bc327698257edb68bdf295;p=litex.git Wait longer before giving up on the 2nd tftp block. Previously we would wait the same number of iterations as it took us to receive the first data block after sending the request. When using the build in tftp server in qemu, the first wait loop succeeds (and thus breaks when 'i' is still 0. Since the counter was never reset between the first and second data block, under qemu the tftp_get call would fail before ever checking if we have received the second block of data. Now that we initialise 'i' to 12M, we ensure that we wait the same amount of time for the second data block as it previously did for the third (and subsequent) blocks. --- diff --git a/litex/soc/software/libnet/tftp.c b/litex/soc/software/libnet/tftp.c index 45796844..8a9ecf21 100644 --- a/litex/soc/software/libnet/tftp.c +++ b/litex/soc/software/libnet/tftp.c @@ -133,6 +133,7 @@ int tftp_get(uint32_t ip, const char *filename, void *buffer) } } + i = 12000000; length_before = total_length; while(!transfer_finished) { if(length_before != total_length) {