|
From: openocd-gerrit <ope...@us...> - 2025-08-02 13:00:00
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via c8e6746e9fb2e35ae94ffe0318015001b0539f64 (commit)
from 0d42f6a1b4598e335d03718f94b26166d3c52a43 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c8e6746e9fb2e35ae94ffe0318015001b0539f64
Author: Marc Schink <de...@za...>
Date: Tue Jul 8 07:17:19 2025 +0000
rtt: Consider target endianness
Consider target endianness when reading control block and channel
information. Current implementation fails on big-endian devices.
Tested on TMS570 (big-endian) and on nRF52 (little-endian).
Note that in its current implementation RTT does not work properly on
TMS570 due to its missing support for background memory access.
Change-Id: Iab58804c42c85a932a750201a69ded35cebedd5d
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8993
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/target/rtt.c b/src/target/rtt.c
index 5ce049ae1..a8ab24a60 100644
--- a/src/target/rtt.c
+++ b/src/target/rtt.c
@@ -37,12 +37,12 @@ static int read_rtt_channel(struct target *target,
return ret;
channel->address = address;
- channel->name_addr = buf_get_u32(buf + 0, 0, 32);
- channel->buffer_addr = buf_get_u32(buf + 4, 0, 32);
- channel->size = buf_get_u32(buf + 8, 0, 32);
- channel->write_pos = buf_get_u32(buf + 12, 0, 32);
- channel->read_pos = buf_get_u32(buf + 16, 0, 32);
- channel->flags = buf_get_u32(buf + 20, 0, 32);
+ channel->name_addr = target_buffer_get_u32(target, buf + 0);
+ channel->buffer_addr = target_buffer_get_u32(target, buf + 4);
+ channel->size = target_buffer_get_u32(target, buf + 8);
+ channel->write_pos = target_buffer_get_u32(target, buf + 12);
+ channel->read_pos = target_buffer_get_u32(target, buf + 16);
+ channel->flags = target_buffer_get_u32(target, buf + 20);
return ERROR_OK;
}
@@ -230,10 +230,8 @@ int target_rtt_read_control_block(struct target *target,
memcpy(ctrl->id, buf, RTT_CB_MAX_ID_LENGTH);
ctrl->id[RTT_CB_MAX_ID_LENGTH - 1] = '\0';
- ctrl->num_up_channels = buf_get_u32(buf + RTT_CB_MAX_ID_LENGTH + 0,
- 0, 32);
- ctrl->num_down_channels = buf_get_u32(buf + RTT_CB_MAX_ID_LENGTH + 4,
- 0, 32);
+ ctrl->num_up_channels = target_buffer_get_u32(target, buf + RTT_CB_MAX_ID_LENGTH + 0);
+ ctrl->num_down_channels = target_buffer_get_u32(target, buf + RTT_CB_MAX_ID_LENGTH + 4);
return ERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/target/rtt.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|