This is an automated email from Gerrit.

Anonymous Coward ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/3233

-- gerrit

commit 8c6e2ee42e23c8d24f02be9b44d6dd8287cc9b26
Author: Alexander Kurz <[email protected]>
Date:   Sat Feb 13 15:11:59 2016 +0100

    cfi intel: fixing faulty flash write error message
    
    Writing to Intel CFI flash with unaligned tail bytes raised a false
    error message although all data was programmed successfully. e.g.:
    > flash write_image image 0x602e0000 bin
    > Programming at 0x602e0000, count 0x00000002 bytes remaining
    > couldn't write word at base 0x60000000, address 0x602e0000
    > error writing to flash at address 0x60000000 at offset 0x002e0000
    Root cause for this false error was a mixup of two result variables
    introduced with ecc8041c.
    
    Change-Id: Ib6b85293dbed946a36a307e5b198c47b901145bf
    Signed-off-by: Alexander Kurz <[email protected]>

diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c
index efa0aee..fef4745 100644
--- a/src/flash/nor/cfi.c
+++ b/src/flash/nor/cfi.c
@@ -1989,7 +1989,9 @@ static int cfi_intel_write_word(struct flash_bank *bank, 
uint8_t *word, uint32_t
 
        uint8_t status;
        retval = cfi_intel_wait_status_busy(bank, cfi_info->word_write_timeout, 
&status);
-       if (retval != 0x80) {
+       if (retval != ERROR_OK)
+               return retval;
+       if (status != 0x80) {
                retval = cfi_send_command(bank, 0xff, flash_address(bank, 0, 
0x0));
                if (retval != ERROR_OK)
                        return retval;

-- 

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to