STLINK: swd transport renamed and jtag+swim transport added
[openocd.git] / src / target / dsp563xx.c
index b7f23c70f96649602dd8b8aee965dbf37ac608ed..28f8bac02caf9cd3a4f9ec68fa8b9008bfcc0c07 100644 (file)
@@ -336,7 +336,7 @@ static int dsp563xx_get_gdb_reg_list(struct target *target, struct reg **reg_lis
        *reg_list = malloc(sizeof(struct reg *) * (*reg_list_size));
 
        if (!*reg_list)
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
 
        for (i = 0; i < DSP563XX_NUMCOREREGS; i++)
        {
@@ -353,7 +353,7 @@ static int dsp563xx_read_core_reg(struct target *target, int num)
        struct dsp563xx_common *dsp563xx = target_to_dsp563xx(target);
 
        if ((num < 0) || (num >= DSP563XX_NUMCOREREGS))
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
 
        reg_value = dsp563xx->core_regs[num];
        buf_set_u32(dsp563xx->core_cache->reg_list[num].value, 0, 32, reg_value);
@@ -369,7 +369,7 @@ static int dsp563xx_write_core_reg(struct target *target, int num)
        struct dsp563xx_common *dsp563xx = target_to_dsp563xx(target);
 
        if ((num < 0) || (num >= DSP563XX_NUMCOREREGS))
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
 
        reg_value = buf_get_u32(dsp563xx->core_cache->reg_list[num].value, 0, 32);
        dsp563xx->core_regs[num] = reg_value;
@@ -859,7 +859,7 @@ static int dsp563xx_target_create(struct target *target, Jim_Interp * interp)
        struct dsp563xx_common *dsp563xx = calloc(1, sizeof(struct dsp563xx_common));
 
        if (!dsp563xx)
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
 
        dsp563xx->jtag_info.tap = target->tap;
        target->arch_info = dsp563xx;
@@ -886,7 +886,7 @@ static int dsp563xx_examine(struct target *target)
        {
                LOG_ERROR("no IDCODE present on device");
 
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        if (!target_was_examined(target))
@@ -1323,7 +1323,7 @@ static int dsp563xx_run_algorithm(struct target *target,
                int timeout_ms, void *arch_info)
 {
        int i;
-       int retvaltemp,retval = 0;
+       int retval = ERROR_OK;
        struct dsp563xx_common *dsp563xx = target_to_dsp563xx(target);
 
        if (target->state != TARGET_HALTED)
@@ -1376,10 +1376,12 @@ static int dsp563xx_run_algorithm(struct target *target,
        for (i = 0; i < num_mem_params; i++)
        {
                if (mem_params[i].direction != PARAM_OUT)
-                       if ((retvaltemp = target_read_buffer(target, mem_params[i].address, mem_params[i].size, mem_params[i].value)) != ERROR_OK)
-                       {
-                                       retval = retvaltemp;
-                       }
+                       retval = target_read_buffer(target,
+                                       mem_params[i].address,
+                                       mem_params[i].size,
+                                       mem_params[i].value);
+                       if (retval != ERROR_OK)
+                               return retval;
        }
 
        for (i = 0; i < num_reg_params; i++)
@@ -1478,7 +1480,7 @@ static int dsp563xx_read_memory_core(struct target *target, int mem_type, uint32
                        move_cmd = 0x07d891;
                        break;
                default:
-                       return ERROR_INVALID_ARGUMENTS;
+                       return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        /* we use r0 to store temporary data */
@@ -1554,7 +1556,7 @@ static int dsp563xx_read_memory(struct target *target, int mem_type, uint32_t ad
        /* we only support 4 byte aligned data */
        if ( (size != 4) || (!count) )
        {
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        if ( mem_type != MEM_L )
@@ -1564,13 +1566,13 @@ static int dsp563xx_read_memory(struct target *target, int mem_type, uint32_t ad
 
        if ( !(buffer_y = malloc(size*count)) )
        {
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        if ( !(buffer_x = malloc(size*count)) )
        {
                free(buffer_y);
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        err = dsp563xx_read_memory_core(target,MEM_Y,address,size,count/2,buffer_y);
@@ -1645,7 +1647,7 @@ static int dsp563xx_write_memory_core(struct target *target, int mem_type, uint3
                        move_cmd = 0x075891;
                        break;
                default:
-                       return ERROR_INVALID_ARGUMENTS;
+                       return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        /* we use r0 to store temporary data */
@@ -1714,7 +1716,7 @@ static int dsp563xx_write_memory(struct target *target, int mem_type, uint32_t a
        /* we only support 4 byte aligned data */
        if ( (size != 4) || (!count) )
        {
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        if ( mem_type != MEM_L )
@@ -1724,13 +1726,13 @@ static int dsp563xx_write_memory(struct target *target, int mem_type, uint32_t a
 
        if ( !(buffer_y = malloc(size*count)) )
        {
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        if ( !(buffer_x = malloc(size*count)) )
        {
                free(buffer_y);
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        for(i=0,i1=0;i<count;i+=2,i1++)

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)