public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] test: dfu: script: wrong md5sum on nand partitions
@ 2014-09-12  6:27 Heiko Schocher
  2014-09-12 14:53 ` Stephen Warren
  0 siblings, 1 reply; 7+ messages in thread
From: Heiko Schocher @ 2014-09-12  6:27 UTC (permalink / raw)
  To: u-boot

when uplaoding a file, at least from a nand partition, the complete
mtd nand partition size is transferred. This leads in a wrong md5sum
as the filesize is different between the downloaded file and the
uploaded file. Limit the uploaded filesize to the downloaded
fixes this.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Roger Meier <r.meier@siemens.com>

---

Tested this on the siemens boards, with current ml I get:

Init script for generating data necessary for DFU test script OK
=========================================================================================
DFU EP0 transmission test program
Trouble shoot -> disable DBG (even the KERN_DEBUG) in the UDC driver
@ -> TRATS2 # dfu 0 mmc 0
 =========================================================================================
File: dat_960.img
TX: md5sum:2947e8f573bc34ba3791f991bd2da869
RX: md5sum:cde0b2024d8ddb55eee9d4b51264ad67
    -------> FAILED

with this patch:

Init script for generating data necessary for DFU test script OK
=========================================================================================
DFU EP0 transmission test program
Trouble shoot -> disable DBG (even the KERN_DEBUG) in the UDC driver
@ -> TRATS2 # dfu 0 mmc 0
 =========================================================================================
File: dat_960.img
TX: md5sum:2947e8f573bc34ba3791f991bd2da869
RX: md5sum:2947e8f573bc34ba3791f991bd2da869
    -------> OK
---
 test/dfu/dfu_gadget_test.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/dfu/dfu_gadget_test.sh b/test/dfu/dfu_gadget_test.sh
index 2f5b7db..5084a29 100755
--- a/test/dfu/dfu_gadget_test.sh
+++ b/test/dfu/dfu_gadget_test.sh
@@ -45,6 +45,7 @@ dfu_test_file () {
     printf "$COLOUR_GREEN ========================================================================================= $COLOUR_DEFAULT\n"
     printf "File:$COLOUR_GREEN %s $COLOUR_DEFAULT\n" $1
 
+    filesize=$(stat -c '%s' $1)
     dfu-util -D $1 -a $TARGET_ALT_SETTING >> $LOG_FILE 2>&1 || die $?
 
     echo -n "TX: "
@@ -54,9 +55,11 @@ dfu_test_file () {
 
     dfu-util -D ${DIR}/dfudummy.bin -a $TARGET_ALT_SETTING_B >> $LOG_FILE 2>&1 || die $?
 
+    N_FILE_FULL=$DIR$RCV_DIR${1:2}"_rcv_full"
     N_FILE=$DIR$RCV_DIR${1:2}"_rcv"
 
-    dfu-util -U $N_FILE -a $TARGET_ALT_SETTING >> $LOG_FILE 2>&1 || die $?
+    dfu-util -U $N_FILE_FULL -a $TARGET_ALT_SETTING >> $LOG_FILE 2>&1 || die $?
+    dd if=$N_FILE_FULL of=$N_FILE bs=$filesize count=1 >> $LOG_FILE 2>&1 || die $?
 
     echo -n "RX: "
     calculate_md5sum $N_FILE
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-17 20:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12  6:27 [U-Boot] [PATCH] test: dfu: script: wrong md5sum on nand partitions Heiko Schocher
2014-09-12 14:53 ` Stephen Warren
2014-09-15  5:32   ` Heiko Schocher
2014-09-15  9:45     ` Lukasz Majewski
2014-09-15 10:48       ` Heiko Schocher
2014-09-15 11:55         ` Lukasz Majewski
2014-09-17 20:48           ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox