OK, so here's a technical description of what happened during this boot. Skip to the end if you're not interested.Montserrat wrote:Here's the heartbeat trace file
It looks like the very first instruction of the menu program gets read back incorrectly:
Code: Select all
$ logread trace.log | grep -E '( 420200 | 420202 )'
16690453 C WB 420200 46FC
16690592 C WB 420202 2700
21345059 C RD 420200 1B25
21345084 C RD 420202 2700
$
Code: Select all
$ printf '\x1B\x25\x27\x00' > boot.bin
$ dis68 boot.bin 0 2
0x000000 move.b -(a5), -(a5)
0x000002 move.l d0, -(a3)
$
Code: Select all
21345059 C RD 420200 1B25
21345084 C RD 420202 2700
21345147 C RD 420204 4AB9
21345181 C WL FFFFFC FFFF
21345198 C RD 420206 00A1
21345307 C WB FFFFFE 0206
21345332 C WB FFFFFA 2700
21345358 C WB FFFFFC 0042
21345383 C WB FFFFF8 2700
21345408 C WB FFFFF6 FFFD
21345433 C WB FFFFF2 2705
21345459 C WB FFFFF4 FFFF
21345476 C RD 00000C 00A1
21345501 C RD 00000E 0364
21349597 HEARTBEAT
21353693 HEARTBEAT
:
Code: Select all
$ logread trace.log | grep -E '( 48000C | 48000E )'
16654560 C WB 48000C 0042
16654699 C WB 48000E 0364
$
The most likely cause of this is an observation I made since adding the heartbeat-tracing: the CPU takes a LONG time to start fetching instructions from the cart, after reset is deasserted: on my MD it's about 120ms, but on yours it's closer 350ms. Both of these are several orders of magnitude longer than it would be on a "vanilla" 68000 system, so I'm guessing the MegaDrive has some of its own initialisation to do before starting the CPU.
Unfortunately, because of the way UMDK interleaves SDRAM refresh cycles with regular reads and writes, this means the SDRAM will not be getting any refresh cycles for several hundred milliseconds after reset, which means the SDRAM will be rather unreliable during the boot process, hence this crash.
I have an idea for how to fix it, by doing continuous-refresh (which I normally do only during reset) right up to the point where the CPU starts doing fetches, but it will take some time to think about how to do that safely.