flash: fix bug in error propagation of flash write_image
when a write/unlock/erase failed during write_image, then an error was not propagated back up so e.g. flash write image from tcl scripts would not throw an exception. Also flash filling speed was printed even when the operation failed. Output is now less confusing. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
@@ -576,7 +576,7 @@ COMMAND_HANDLER(handle_flash_fill_command)
|
||||
}
|
||||
}
|
||||
|
||||
if (duration_measure(&bench) == ERROR_OK)
|
||||
if ((retval == ERROR_OK) && (duration_measure(&bench) == ERROR_OK))
|
||||
{
|
||||
command_print(CMD_CTX, "wrote %" PRIu32 " bytes to 0x%8.8" PRIx32
|
||||
" in %fs (%0.3f KiB/s)", wrote, address,
|
||||
|
||||
Reference in New Issue
Block a user