From 657f7e463ce867b6b357eee861260bfd71bc6b2f Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Tue, 5 Nov 2002 11:44:58 +0000 Subject: [PATCH] Added verbose status register (sr) output after flash error is detected. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@256 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/flash.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/jtag/src/flash.c b/jtag/src/flash.c index 85a6fc80..02be40bf 100644 --- a/jtag/src/flash.c +++ b/jtag/src/flash.c @@ -344,9 +344,10 @@ flash_erase_block32( parts *ps, uint32_t adr ) while (((sr = bus_read( ps, 0 ) & 0x00FE00FE) & ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) ; /* TODO: add timeout */ - if (sr != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) + if (sr != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) { + printf( "\nsr = 0x%08X\n", sr ); return CFI_INTEL_ERROR_UNKNOWN; - else + } else return 0; } @@ -361,9 +362,10 @@ flash_unlock_block32( parts *ps, uint32_t adr ) while (((sr = bus_read( ps, 0 ) & 0x00FE00FE) & ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) ; /* TODO: add timeout */ - if (sr != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) + if (sr != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) { + printf( "\nsr = 0x%08X\n", sr ); return CFI_INTEL_ERROR_UNKNOWN; - else + } else return 0; } @@ -378,8 +380,9 @@ flash_program32( parts *ps, uint32_t adr, uint32_t data ) while (((sr = bus_read( ps, 0 ) & 0x00FE00FE) & ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) ; /* TODO: add timeout */ - if (sr != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) + if (sr != ((CFI_INTEL_SR_READY << 16) | CFI_INTEL_SR_READY)) { + printf( "\nsr = 0x%08X\n", sr ); return CFI_INTEL_ERROR_UNKNOWN; - else + } else return 0; }