usb: dfu: make nand upload working
Nowhere pass a value to len, which always 0, make no transfer which
cause uploading failed.
This patch make nand upload working. However it needs enough malloc
buffer to store read data, that means the buffer at least equal to
the upload partition size, or else it doesn't work.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index edbf5a9..2d07097 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -121,6 +121,7 @@
switch (dfu->layout) {
case DFU_RAW_ADDR:
+ *len = dfu->data.nand.size;
ret = nand_block_read(dfu, offset, buf, len);
break;
default: