aboutsummaryrefslogtreecommitdiff
path: root/src/target/arm_adi_v5.c
diff options
context:
space:
mode:
authorJason Moehlman <jmoehlma@linux-software.com>2012-11-19 18:33:34 -0500
committerØyvind Harboe <oyvindharboe@gmail.com>2012-11-30 11:02:05 +0000
commit3e81c4b6df68fb11e97bdf25d0412a74698281d0 (patch)
tree09959b4acfd15593d2082f676f87e4422685c98a /src/target/arm_adi_v5.c
parent7155349bd008d4b52433ba87f4620d9216cbce2b (diff)
arm: Mis-aligned data issue fix.
Fixes issue with big endian hosts and mis-aligned data on some hosts. Fixes unaligned access exception on hosts that do not support unaligned access when debugging some arm targets. Signed-off-by: Jason Moehlman <jmoehlma@linux-software.com> Change-Id: I6bc6fb1b3c3565b256674b9ef43ed2afd14f5178 Reviewed-on: http://openocd.zylin.com/996 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Diffstat (limited to 'src/target/arm_adi_v5.c')
-rw-r--r--src/target/arm_adi_v5.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 65d29f0c..a0fd4cb4 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -307,8 +307,9 @@ int mem_ap_write_buf_u32(struct adiv5_dap *dap, const uint8_t *buffer, int count
return retval;
for (writecount = 0; writecount < blocksize; writecount++) {
- retval = dap_queue_ap_write(dap, AP_REG_DRW,
- *(uint32_t *) ((void *) (buffer + 4 * writecount)));
+ uint32_t tmp;
+ tmp = buf_get_u32(buffer + 4 * writecount, 0, 32);
+ retval = dap_queue_ap_write(dap, AP_REG_DRW, tmp);
if (retval != ERROR_OK)
break;
}