summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo L. Rosa <rodrigorosa.lg@gmail.com>2011-06-10 12:20:59 -0700
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-06-12 11:18:27 +0200
commitd539fc856f4c09e3a3b683c2b1b5766652ab9d7a (patch)
tree294e7117f629d0ee88b8f5736ec9c72728d9dd4c
parentf42353d82137d0a3f5e2433bae931c82b8407c74 (diff)
downloadopenocd_libswd-d539fc856f4c09e3a3b683c2b1b5766652ab9d7a.tar.gz
openocd_libswd-d539fc856f4c09e3a3b683c2b1b5766652ab9d7a.tar.bz2
openocd_libswd-d539fc856f4c09e3a3b683c2b1b5766652ab9d7a.tar.xz
openocd_libswd-d539fc856f4c09e3a3b683c2b1b5766652ab9d7a.zip
fix read for verify_image
-rw-r--r--src/target/dsp5680xx.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c
index f503e081..da9ba46a 100644
--- a/src/target/dsp5680xx.c
+++ b/src/target/dsp5680xx.c
@@ -942,35 +942,13 @@ static int dsp5680xx_read_buffer(struct target * target, uint32_t address, uint3
LOG_USER("Target must be halted.");
return ERROR_OK;
}
- // byte addressing!
- int retval = ERROR_OK;
- int pmem = 1;
- uint16_t tmp_wrd= 0;
-
- retval = dsp5680xx_convert_address(&address, &pmem);
- err_check_propagate(retval);
-
- for (unsigned i=0; i<size; i++)
- if(!(i%2)){
- retval = dsp5680xx_read_16_single(target, address + i/2, &tmp_wrd, pmem);
- err_check_propagate(retval);
- //TODO find a better solution. endiannes differs from normal read, otherwise the openocd crc would do weird stuff.
- buffer[i+1] = (uint8_t) (tmp_wrd>>8);
- buffer[i] = (uint8_t) (tmp_wrd&0xff);
- }
- return retval;
+ // read_buffer is called when the verify_image command is executed.
+ // The "/2" solves the byte/word addressing issue.
+ return dsp5680xx_read(target,address,2,size/2,buffer);
}
static int dsp5680xx_checksum_memory(struct target * target, uint32_t address, uint32_t size, uint32_t * checksum){
- //TODO implement.
- //This will make openocd do the work, but it will fail because of the word/byte addressing issues.
- int retval;
- struct working_area * crc_algorithm;
- retval = target_alloc_working_area(target, 20, &crc_algorithm);
- if(retval != ERROR_OK)
- return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
- retval = target_free_working_area(target, crc_algorithm);
- return ERROR_FAIL;
+ return ERROR_FAIL;// This will make OpenOCD do the read out the data and verify it.
}
// Data signature algorithm used by the core FM (flash module)