aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2013-09-28 22:28:57 +0200
committerSpencer Oliver <spen@spen-soft.co.uk>2013-10-31 20:45:04 +0000
commit3d064b2e214986e6386dd3eec318bdd4f3d11946 (patch)
treee3549dc4dbd3a63e39297609cc3d8156a9a01576 /src
parentbee7836b6a155b89f454b64f626a497c767f13f6 (diff)
downloadriscv-openocd-3d064b2e214986e6386dd3eec318bdd4f3d11946.zip
riscv-openocd-3d064b2e214986e6386dd3eec318bdd4f3d11946.tar.gz
riscv-openocd-3d064b2e214986e6386dd3eec318bdd4f3d11946.tar.bz2
str7x: Fix byte order bug
Found by grepping for pointer casts. Change-Id: I56d5680590e37d8c61197488067fbb0776e5e0f0 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1774 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/flash/nor/str7x.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/flash/nor/str7x.c b/src/flash/nor/str7x.c
index 3d8ce54..cbd8928 100644
--- a/src/flash/nor/str7x.c
+++ b/src/flash/nor/str7x.c
@@ -489,9 +489,10 @@ static int str7x_write_block(struct flash_bank *bank, uint8_t *buffer,
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
};
- target_write_buffer(target, write_algorithm->address,
- sizeof(str7x_flash_write_code),
- (uint8_t *)str7x_flash_write_code);
+ uint8_t code[sizeof(str7x_flash_write_code)];
+ target_buffer_set_u32_array(target, code, ARRAY_SIZE(str7x_flash_write_code),
+ str7x_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) {