]> git.sur5r.net Git - openocd/commitdiff
Minor bug fixes in Mips32 code
authorSalvador <sarroyofdez@yahoo.es>
Mon, 2 Apr 2012 14:48:52 +0000 (16:48 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Tue, 10 Apr 2012 12:09:55 +0000 (12:09 +0000)
Now the the "Fast" version for memory blank check in pic32mx.c can be called:
default_flash_blank_check()  instead of the "fallback"  default_flash_mem_blank_check().

The command "verify_image", without working area, now don't show:
 checksum mismatch - attempting binary compare
when there are no real errors in flash.

Change-Id: I256e8ae949289634e1de5c1c2861e4c4c4b7fdce
Signed-off-by: Salvador <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/549
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/target/mips32.c

index 5682e3f6c69541ae0818143105b2d0ad37285fe4..ab39e6e7f3da8b914ee423f7a8c00205139daf66 100644 (file)
@@ -631,7 +631,7 @@ int mips32_checksum_memory(struct target *target, uint32_t address,
                destroy_reg_param(&reg_params[0]);
                destroy_reg_param(&reg_params[1]);
                target_free_working_area(target, crc_algorithm);
-               return 0;
+               return retval;
        }
 
        *checksum = buf_get_u32(reg_params[0].value, 0, 32);
@@ -688,14 +688,14 @@ int mips32_blank_check_memory(struct target *target,
 
        retval = target_run_algorithm(target, 0, NULL, 3, reg_params,
                        erase_check_algorithm->address,
-                       erase_check_algorithm->address + (sizeof(erase_check_code)-2),
+                       erase_check_algorithm->address + (sizeof(erase_check_code)-4),
                        10000, &mips32_info);
        if (retval != ERROR_OK) {
                destroy_reg_param(&reg_params[0]);
                destroy_reg_param(&reg_params[1]);
                destroy_reg_param(&reg_params[2]);
                target_free_working_area(target, erase_check_algorithm);
-               return 0;
+               return retval;
        }
 
        *blank = buf_get_u32(reg_params[2].value, 0, 32);