This is an automated email from Gerrit.

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

-- gerrit

commit 2b1e174bc707c749c3366c927eaf4134a66a0244
Author: Tomas Vanek <[email protected]>
Date:   Fri Oct 2 14:31:30 2015 +0200

    Kinetis: properly pad flash section writes
    
    kinetis_write() with byte count not divisible by prog_section_chunk_bytes
    computed wrong wc and therefore paded section chunk by some
    random data instead of 0xff
    
    Change-Id: Ic7c66d8a3ceacda9e611e98b9fbf943b8001774b
    Signed-off-by: Tomas Vanek <[email protected]>

diff --git a/src/flash/nor/kinetis.c b/src/flash/nor/kinetis.c
index 5f8fee1..7f5e2fc 100644
--- a/src/flash/nor/kinetis.c
+++ b/src/flash/nor/kinetis.c
@@ -975,7 +975,7 @@ static int kinetis_write(struct flash_bank *bank, const 
uint8_t *buffer,
                                unsigned residual_bc = (count-i) % 
prog_section_chunk_bytes;
 
                                /* number of complete words to copy directly 
from buffer */
-                               wc = (count - i) / 4;
+                               wc = (count - i - residual_bc) / 4;
 
                                /* number of total sections to write, including 
residual */
                                section_count = DIV_ROUND_UP((count-i), 
prog_section_chunk_bytes);

-- 

------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to