From: Dan White Date: Thu, 25 Apr 2013 21:02:03 +0000 (-0500) Subject: two bugfixes directly to dis-assembled, annotated ROM X-Git-Tag: bootrom-initial-submission~22^2~3 X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=cfcc9db5e26703b42147a1596b5e327eff50023a;p=430.git two bugfixes directly to dis-assembled, annotated ROM --- diff --git a/rom-bugfix.asm b/rom-bugfix.asm index e23e554..e87c68b 100644 --- a/rom-bugfix.asm +++ b/rom-bugfix.asm @@ -357,7 +357,7 @@ gotoMain: 3158: b0 40 08 20 mov #8200, 0xf2a4 ;#SPI1_CR, PC rel. 0x02402 315c: a4 f2 ;set SCG1 = 1 - 315e: 32 d0 80 00 bis #128,sr ;#0x0080 +; 315e: 32 d0 80 00 bis #128,sr ;#0x0080 ; FIXME: ^^^ BUG ^^^ BUG ^^^ BUG ^^^ BUG ^^^ BUG ^^^ BUG ^^^ ; *** IN FABBED CHIP: *** ; this makes SCG[1:0] = 10b @@ -374,6 +374,11 @@ gotoMain: ; b) Couple the LFXTAL to the PI pin weakly to drive enough to switch. ; May not be fast enough for UART0 baud rate-setting code operation. ; c) ??? +; +; BUGFIX SOLUTION: +; leave sr unchanged, and not touch SCG[1:0] bits +; bis instruction is logical OR, just OR with zero and move on + 315e: 32 d0 00 00 bis #128,sr ;#0x0000 Assembly_Code: 3162: b2 40 8e 34 mov #UART_ISR, &0xffea ;#0x348e @@ -448,12 +453,16 @@ main: ; PA(5) - RXD0 31da: b2 40 3e 00 mov #62, &PAPER ;#0x003e 31de: 0c 1a - 31e0: b0 12 76 31 call #0x3176 +; 31e0: b0 12 76 31 call #0x3176 ; FIXME: ^^^ BUG ^^^ BUG ^^^ BUG ^^^ BUG ^^^ BUG ^^^ BUG ^^^ ; *** IN FABBED CHIP: *** ; The call to #0x3176 should be init() or #0x3172. ; As-is, this jumps into the middle of a 3-word instruction within init(). ; -> Death by foot-shooting. +; +; BUGFIX SOLUTION: +; properly call main() by using the correct address, 0x3172 + 31e0: b0 12 72 31 call #0x3172 ;setup SPI0 ; SPI_En = 1