aboutsummaryrefslogtreecommitdiff
path: root/src/target/dsp5680xx.c
diff options
context:
space:
mode:
authorRodrigo L. Rosa <rodrigorosa.LG@gmail.com>2011-08-30 14:26:05 -0700
committerRodrigo L. Rosa <rodrigorosa.LG@gmail.com>2011-08-30 15:09:44 -0700
commit1d4f294c3c61ef8ad7a5cc89f3cfbd61ecaaf846 (patch)
tree7b659e82a318051e7e1b86fd134283d7c2777911 /src/target/dsp5680xx.c
parente1a2d7255eb8c282fc91e951c7453932c1e9a55f (diff)
downloadriscv-openocd-1d4f294c3c61ef8ad7a5cc89f3cfbd61ecaaf846.zip
riscv-openocd-1d4f294c3c61ef8ad7a5cc89f3cfbd61ecaaf846.tar.gz
riscv-openocd-1d4f294c3c61ef8ad7a5cc89f3cfbd61ecaaf846.tar.bz2
fix error handling during halt
the user can execute halt, but no enter_debug_mode. modified the error handling to suite this. the new implementation of unlocking will use enter_debug_mode, and should not get the same errors as the user would, because not being able to enter debug mode is actually success when checking for locked flash.
Diffstat (limited to 'src/target/dsp5680xx.c')
-rw-r--r--src/target/dsp5680xx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c
index 4cd3ff5..cc00f40 100644
--- a/src/target/dsp5680xx.c
+++ b/src/target/dsp5680xx.c
@@ -475,14 +475,14 @@ static int eonce_enter_debug_mode(struct target * target, uint16_t * eonce_statu
if((data_read_from_dr&0x30) == 0x30){
LOG_DEBUG("EOnCE successfully entered debug mode.");
target->state = TARGET_HALTED;
- return ERROR_OK;
+ retval = ERROR_OK;
}else{
+ LOG_DEBUG("Failed to set EOnCE module to debug mode.");
retval = ERROR_TARGET_FAILURE;
- err_check(retval,"Failed to set EOnCE module to debug mode.");
}
if(eonce_status!=NULL)
*eonce_status = data_read_from_dr;
- return ERROR_OK;
+ return retval;
}
/**
@@ -551,7 +551,7 @@ static int dsp5680xx_halt(struct target *target){
return ERROR_OK;
}
retval = eonce_enter_debug_mode(target,&eonce_status);
- err_check_propagate(retval);
+ err_check(retval,"Failed to halt target.");
retval = eonce_pc_store(target);
err_check_propagate(retval);
//TODO is it useful to store the pc?