- moved flash erase_check target code to target.c
[openocd.git] / src / target / target.c
index d5e4ea56ef2812635b3c983e4c0488277e287766..0a44e7b37370891ec41773a9601278e302ad06f0 100644 (file)
@@ -394,18 +394,19 @@ int target_process_reset(struct command_context_s *cmd_ctx)
                target = target->next;
        }
        
+       if ((retval = jtag_execute_queue()) != ERROR_OK)
+       {
+               LOG_WARNING("JTAG communication failed while deasserting reset.");
+               retval = ERROR_OK;
+       }
+
        if (jtag_reset_config & RESET_SRST_PULLS_TRST)
        {
                /* If TRST was asserted we need to set up registers again */
                if ((retval = target_examine(cmd_ctx)) != ERROR_OK)
                        return retval;
-       }
+       }               
        
-       if ((retval = jtag_execute_queue()) != ERROR_OK)
-       {
-               LOG_WARNING("JTAG communication failed while deasserting reset.");
-               retval = ERROR_OK;
-       }
        
        LOG_DEBUG("Waiting for halted stated as approperiate");
        
@@ -748,21 +749,24 @@ static int target_call_timer_callbacks_check_time(int checktime)
                                (((now.tv_sec >= callback->when.tv_sec) && (now.tv_usec >= callback->when.tv_usec))
                                                || (now.tv_sec > callback->when.tv_sec)))
                {
-                       callback->callback(callback->priv);
-                       if (callback->periodic)
+                       if(callback->callback != NULL)
                        {
-                               int time_ms = callback->time_ms;
-                               callback->when.tv_usec = now.tv_usec + (time_ms % 1000) * 1000;
-                               time_ms -= (time_ms % 1000);
-                               callback->when.tv_sec = now.tv_sec + time_ms / 1000;
-                               if (callback->when.tv_usec > 1000000)
+                               callback->callback(callback->priv);
+                               if (callback->periodic)
                                {
-                                       callback->when.tv_usec = callback->when.tv_usec - 1000000;
-                                       callback->when.tv_sec += 1;
+                                       int time_ms = callback->time_ms;
+                                       callback->when.tv_usec = now.tv_usec + (time_ms % 1000) * 1000;
+                                       time_ms -= (time_ms % 1000);
+                                       callback->when.tv_sec = now.tv_sec + time_ms / 1000;
+                                       if (callback->when.tv_usec > 1000000)
+                                       {
+                                               callback->when.tv_usec = callback->when.tv_usec - 1000000;
+                                               callback->when.tv_sec += 1;
+                                       }
                                }
+                               else
+                                       target_unregister_timer_callback(callback->callback, callback->priv);
                        }
-                       else
-                               target_unregister_timer_callback(callback->callback, callback->priv);
                }
                        
                callback = next_callback;
@@ -1132,6 +1136,23 @@ int target_checksum_memory(struct target_s *target, u32 address, u32 size, u32*
        return retval;
 }
 
+int target_blank_check_memory(struct target_s *target, u32 address, u32 size, u32* blank)
+{
+       int retval;
+       if (!target->type->examined)
+       {
+               LOG_ERROR("Target not examined yet");
+               return ERROR_FAIL;
+       }
+       
+       if (target->type->blank_check_memory == 0)
+               return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+       
+       retval = target->type->blank_check_memory(target, address, size, blank);
+                       
+       return retval;
+}
+
 int target_read_u32(struct target_s *target, u32 address, u32 *value)
 {
        u8 value_buf[4];
@@ -2400,7 +2421,7 @@ int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char **args,
 
                while (watchpoint)
                {
-                       command_print(cmd_ctx, "address: 0x%8.8x, mask: 0x%8.8x, r/w/a: %i, value: 0x%8.8x, mask: 0x%8.8x", watchpoint->address, watchpoint->length, watchpoint->rw, watchpoint->value, watchpoint->mask);
+                       command_print(cmd_ctx, "address: 0x%8.8x, len: 0x%8.8x, r/w/a: %i, value: 0x%8.8x, mask: 0x%8.8x", watchpoint->address, watchpoint->length, watchpoint->rw, watchpoint->value, watchpoint->mask);
                        watchpoint = watchpoint->next;
                }
        } 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)