From 65765f378938ffda4958ad10505b1ec009740585 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Thu, 1 Aug 2002 12:24:51 +0000 Subject: [PATCH] Added flash support from file. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@90 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/detect.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/jtag/src/detect.c b/jtag/src/detect.c index 3f2f7108..ebd0f2e8 100644 --- a/jtag/src/detect.c +++ b/jtag/src/detect.c @@ -460,7 +460,6 @@ printf( "%s\n", register_get_string( p->prev_bsr ) ); ebri = access_rom( p, AB_READ, 0x2D, 0 ); printf( "ebri: %08X\n", ebri ); -#if 0 unlock( p, 0 ); erase( p, 0 ); @@ -471,11 +470,37 @@ printf( "%s\n", register_get_string( p->prev_bsr ) ); while (fread( &d, sizeof d, 1, f ) == 1) { + printf( "adr: %08X\n", a ); program_flash( p, a, d ); a += 4; } + fclose( f ); } -#endif + + access_bus( p, AB_SETUP, 0, 0x00FF00FF ); + access_bus( p, AB_WRITE, 0, 0x00FF00FF ); + access_bus( p, AB_HOLD, 0, 0x00FF00FF ); + + { + FILE *f = fopen( "brux.b", "r" ); + unsigned int d; + unsigned int a = 0; + + + while (fread( &d, sizeof d, 1, f ) == 1) { + unsigned int x; + printf( "adr: %08X\n", a ); + access_bus( p, AB_READ, a, 0 ); + x = access_bus( p, AB_READ, a, 0 ); + if (x != d) { + printf( "error read = %08X, expect = %08X\n", x, d ); + exit( 0 ); + } + a += 4; + } + fclose( f ); + } + exit( 0 ); unlock( p, 0 );