This is an automated email from Gerrit.

"Tormod Volden <[email protected]>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9194

-- gerrit

commit 326ccb20e3970cf5706827566cd0eb4d52d3a6bc
Author: Tormod Volden <[email protected]>
Date:   Sat Nov 1 13:27:37 2025 +0100

    RTT: Add simple start retry limit
    
    Change-Id: I83a43fd46df85683cc5f9b87ced00dcd1fbcf59a
    Signed-off-by: Tormod Volden <[email protected]>

diff --git a/src/rtt/rtt.c b/src/rtt/rtt.c
index 774e1343dc..b5c21c8810 100644
--- a/src/rtt/rtt.c
+++ b/src/rtt/rtt.c
@@ -134,6 +134,7 @@ int rtt_start(void)
 {
        int ret;
        target_addr_t addr = rtt.addr;
+       static int retries;
 
        if (rtt.started)
                return ERROR_OK;
@@ -148,8 +149,16 @@ int rtt_start(void)
                        LOG_INFO("rtt: Control block found at 0x%" 
TARGET_PRIxADDR,
                                addr);
                        rtt.ctrl.address = addr;
+                       retries = 0;
                } else {
                        if (rtt.start_retry_interval) {
+                               if (retries == 0) {
+                                       retries = 100;
+                               } else if (--retries == 1) {
+                                       retries = 0;
+                                       LOG_ERROR("rtt: Retry count exceeded");
+                                       return ERROR_FAIL;
+                               }
                                
target_register_timer_callback(&rtt_start_retry_callback,
                                        rtt.start_retry_interval, 
TARGET_TIMER_TYPE_ONESHOT, NULL);
                                return ERROR_OK;

-- 

Reply via email to