This is an automated email from Gerrit.

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

-- gerrit

commit 1d06e5809e0246588df7316f7d9d7834d82bd0b4
Author: Andreas Fritiofson <[email protected]>
Date:   Sat Sep 28 22:30:05 2013 +0200

    str9x: Fix byte order bug
    
    Found by grepping for pointer casts.
    
    Change-Id: Ie2d698310b077c3849266e81df8e6a808cbc6896
    Signed-off-by: Andreas Fritiofson <[email protected]>

diff --git a/src/flash/nor/str9x.c b/src/flash/nor/str9x.c
index 7d93b18..2158622 100644
--- a/src/flash/nor/str9x.c
+++ b/src/flash/nor/str9x.c
@@ -392,9 +392,10 @@ static int str9x_write_block(struct flash_bank *bank,
                return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
        };
 
-       target_write_buffer(target, write_algorithm->address,
-                       sizeof(str9x_flash_write_code),
-                       (uint8_t *)str9x_flash_write_code);
+       uint8_t code[sizeof(str9x_flash_write_code)];
+       target_buffer_set_u32_array(target, code, 
ARRAY_SIZE(str9x_flash_write_code),
+                       str9x_flash_write_code);
+       target_write_buffer(target, write_algorithm->address, sizeof(code), 
code);
 
        /* memory buffer */
        while (target_alloc_working_area_try(target, buffer_size, &source) != 
ERROR_OK) {

-- 

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to