From d539fc856f4c09e3a3b683c2b1b5766652ab9d7a Mon Sep 17 00:00:00 2001 From: "Rodrigo L. Rosa" Date: Fri, 10 Jun 2011 12:20:59 -0700 Subject: fix read for verify_image --- src/target/dsp5680xx.c | 30 ++++-------------------------- 1 file 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>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) -- cgit v1.2.3