From 7788c69225f68f67b95a5f778c7b45adf9cc046f Mon Sep 17 00:00:00 2001 From: Balint Seeber Date: Wed, 20 Nov 2013 20:10:14 -0800 Subject: b200: fix loopback transfer timeout when operating at USB2 --- host/lib/usrp/b200/b200_iface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/b200/b200_iface.cpp') diff --git a/host/lib/usrp/b200/b200_iface.cpp b/host/lib/usrp/b200/b200_iface.cpp index a8e96f4ac..bb46fbfce 100644 --- a/host/lib/usrp/b200/b200_iface.cpp +++ b/host/lib/usrp/b200/b200_iface.cpp @@ -505,7 +505,8 @@ public: unsigned char out_buff[VREQ_MAX_SIZE]; // Request loopback read, which will indicate the firmware's current control request buffer size - int nread = fx3_control_read(B200_VREQ_LOOP, 0, 0, out_buff, sizeof(out_buff), 1000); + // Make sure that if operating as USB2, requested length is within spec + int nread = fx3_control_read(B200_VREQ_LOOP, 0, 0, out_buff, std::min(transfer_size, (int)sizeof(out_buff)), 1000); if (nread <= 0) throw uhd::io_error("load_fpga: unable to complete firmware loopback request."); transfer_size = std::min(transfer_size, nread); // Select the smaller value -- cgit v1.2.3