How to build firmware (UMDK Menu + Monitor)?

Hosted forum for UMDK related questions

Moderators: BigEvilCorporation, prophet36

Post Reply
amushrow
Interested
Posts: 44
Joined: Mon Jan 02, 2017 12:56 pm

How to build firmware (UMDK Menu + Monitor)?

Post by amushrow » Sun Jan 14, 2018 11:15 pm

I've made changes to the umdk menu program to support SDHC cards (so you can use cards up to 32GB). It works when I send it over using loader, but I only ever get a blank screen when I combine it with the monitor program (cat monitor.bin menu.bin > firmware.bin) and load it on to the umdk's flash.

The total size of firmware.bin is 61KB, which is slightly bigger than the previous firmware (SGDK seems to add more than it used to) but that shouldn't be an issue should it?

Is there something else that I need to do to get it to work, or are there things I can check?
The only thing different for the flash version is that it has the extra argument -Ttext=0x420000 when building, which I've made sure was set.

amushrow
Interested
Posts: 44
Joined: Mon Jan 02, 2017 12:56 pm

Re: How to build firmware (UMDK Menu + Monitor)?

Post by amushrow » Mon Jan 15, 2018 11:29 pm

Compiling against the same version of SGDK that was originally used gets everything working, although the makefile needs to be updated (on windows at least) otherwise you don't get the link time optimisation and the firmware will be too big.

I'm not sure what changed in SGDK that breaks it. I know there where a couple of changes to the sega.s file but I merged those in and it worked through loader so ¯\_(ツ)_/¯

EDIT: *sigh* The menu loads from flash, but it's not launching any roms :cry:

amushrow
Interested
Posts: 44
Joined: Mon Jan 02, 2017 12:56 pm

Re: How to build firmware (UMDK Menu + Monitor)?

Post by amushrow » Tue Jan 16, 2018 11:16 pm

Oh for goodness sake:

main.c

Code: Select all

void doSelect(struct FileSystem *fs, s16 choice) {
	...
	const u16 clustersPerStar = (u16) (length / (32 * clusterLen));
	...
	for (i = 0; i < clustersPerStar; i++) {
		//read from sd card
	}
	VDP_drawText("*", x, 26); //Draw loading bar
	...
}
The cluster size on the high capacity card means that there < 1 clusters per star for the loading screen (there should instead many stars per cluster)

amushrow
Interested
Posts: 44
Joined: Mon Jan 02, 2017 12:56 pm

Re: How to build firmware (UMDK Menu + Monitor)?

Post by amushrow » Sat Jan 20, 2018 1:47 pm

I feel like this is working against me.
Still having trouble loading roms (most of the time), and can't connect the debugger.

It seems that there is some memory mapping issue, or something. The monitor is loaded at 0x400000, the menu program stores filenames and whatnot starting at 0x440000, the problem is that 0x400000 == 0x440000.
When writing to 0x440000 you overwrite the monitor code, I also checked 0x420000 and 0x460000 and they are also end up at the same physical location.

I mostly checked like this:

Code: Select all

u32 read = 0;
u32* write = (u32*) 0x460000;
...
*write = 0xfafafafa;
read = *((u32*) 0x420000);
if (read != 0xfafafafa)
	VDP_drawText();
	
*write = 0x0;
read = *((u32*) 0x420000);
if (read != 0xfafafafa)
	VDP_drawText();
EDIT: When loading roms it also crashes after loading up 256KB (0x40000 bytes). I have no idea what is going on, the original menu firmware works. But when I compile it myself this happens.

EDIT2: Seems like there was just a poor connection, and it was just an unfortunate coincidence that the original firmware worked when I checked it

prophet36
Very interested
Posts: 234
Joined: Sat Dec 13, 2008 6:58 pm
Location: London, UK
Contact:

Re: How to build firmware (UMDK Menu + Monitor)?

Post by prophet36 » Tue Feb 27, 2018 7:13 pm

Sorry I've not been around lately. Was it just a bad connection that was causing problems? Are you all sorted now? I intended for the basic signal test to catch things like bad connections on the cart.

BTW, feel free to send me a pull-request on GitHub to implement SDHC.

amushrow
Interested
Posts: 44
Joined: Mon Jan 02, 2017 12:56 pm

Re: How to build firmware (UMDK Menu + Monitor)?

Post by amushrow » Wed Feb 28, 2018 11:09 am

Yeah bad connection (between the MD and the cart)
And then I started getting some other weird errors, the result being I've bought a bunch of bad cypress usb chips and it seems I was lucky that this one worked at all (for a while anyway).

Everything I go to look at recently isn't working right (not just the UMDK), I feel like I'm cursed.

Post Reply