From: Andreas Fritiofson Date: Sat, 28 Sep 2013 19:28:08 +0000 (+0200) Subject: aduc702x: Fix byte order bug X-Git-Tag: v0.8.0-rc1~189 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=97153e4fca0e840b68b90b023c7bd70c5044466f;p=openocd aduc702x: Fix byte order bug Found by grepping for pointer casts. Change-Id: I00e000515cb2573130b73423eb19ba941f524b05 Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/1769 Tested-by: jenkins Reviewed-by: Spencer Oliver --- diff --git a/src/flash/nor/aduc702x.c b/src/flash/nor/aduc702x.c index a0610d43..60ec7d38 100644 --- a/src/flash/nor/aduc702x.c +++ b/src/flash/nor/aduc702x.c @@ -206,8 +206,10 @@ static int aduc702x_write_block(struct flash_bank *bank, return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; } - retval = target_write_buffer(target, write_algorithm->address, - sizeof(aduc702x_flash_write_code), (uint8_t *)aduc702x_flash_write_code); + uint8_t code[sizeof(aduc702x_flash_write_code)]; + target_buffer_set_u32_array(target, code, ARRAY_SIZE(aduc702x_flash_write_code), + aduc702x_flash_write_code); + retval = target_write_buffer(target, write_algorithm->address, sizeof(code), code); if (retval != ERROR_OK) return retval;