Hello Alex!
Good catch, the AW_FEL_VERSION request caused by progress_chunk_size()
might in fact arrive in an untimely manner there.
Basically we'd have to make sure we retrieve the aw_fel_get_sram_info()
beforehand. I'm not sure there would be a more useful place for that
even earlier, before aw_write_buffer() - so I'd say you made a sensible
choice to place it there. I'd just suggest to move it before the "start"
gettime() call. Will have a closer look at it later.
I'm also considering to move the 'recommended' chunk size information
over to to soc_sram_info struct, let's say as a "speed" field. That way
we could get rid of the switch statement in progress_chunk_size(), and
use the .speed member field instead. If it's unset (value == 0), fall
back to the slow/default transfer chunk.
Btw: Can you give a ballpark figure for the FEL write speed of the R8,
or maybe edit https://linux-sunxi.org/FEL/USBBoot#SoC_support_status
accordingly?
Regards, B. Nortmann
Am 16.11.2015 um 09:17 schrieb Alex Kaplan:
Hi Bernhard,
great work! I like especially the --xgauge in combination with
multiwrite.
However, I have been testing with an Allwinner R8, and there is a
problem with the lazy initialization of the progress chunk size:
In aw_write_buffer() a AW_FEL_1_WRITE request is sent before the
AW_FEL_VERSION request, which leads to libusb usb_bulk_send error -8.
For testing the rest of the patches, I sneaked in call of
progress_chunk_size() before sending the AW_FEL_1_WRITE request:
diff --git a/fel.c b/fel.c
index b06d438..6fdd313 100644
--- a/fel.c
+++ b/fel.c
@@ -303,6 +303,7 @@ double aw_write_buffer(libusb_device_handle *usb,
void *buf, uint32_t offset,
exit(1);
}
double start = gettime();
+ progress_chunk_size(usb);
aw_send_fel_request(usb, AW_FEL_1_WRITE, offset, len);
aw_usb_write(usb, buf, len, progress);
aw_read_fel_status(usb);
However, I currently don't have an idea how to do this more elegantly.
Cheers
Alex
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.