Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTT not updating when single stepping #1930

Open
ddowling opened this issue Sep 11, 2024 · 0 comments
Open

RTT not updating when single stepping #1930

ddowling opened this issue Sep 11, 2024 · 0 comments

Comments

@ddowling
Copy link

ddowling commented Sep 11, 2024

I have been experimenting with the RTT support in BMP as it looks perfect for fast logging output. However there seems to be an issue with how the polling for rtt IO is performed when stepping through code with gdb.

Currently poll_rtt() is only called in main.c:60 when the while loop has gdb_target_running true. It breaks out of this loop when gdb_target_running goes false before calling the poll_rtt() function. Then the application is blocked waiting for new packets in the gdb_getpacket() and there is no RTT polling performed.

blackmagic/src/main.c

Lines 44 to 64 in 309a17c

static void bmp_poll_loop(void)
{
SET_IDLE_STATE(false);
while (gdb_target_running && cur_target) {
gdb_poll_target();
// Check again, as `gdb_poll_target()` may
// alter these variables.
if (!gdb_target_running || !cur_target)
break;
char c = gdb_if_getchar_to(0);
if (c == '\x03' || c == '\x04')
target_halt_request(cur_target);
platform_pace_poll();
#ifdef ENABLE_RTT
if (rtt_enabled)
poll_rtt(cur_target);
#endif
}
SET_IDLE_STATE(true);

I think this can be fixed by ensuring poll_rtt() is called on exit from this loop. I can work a up patch and pull request if this will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant