#117444 - Funky Gibbon - Sun Feb 04, 2007 10:05 pm
Hi All,
I want to create an external hardware app for GBA without the need for a flash cart, it means carrying the firmware on the external device and using multiboot to get it into the GBA, something along the lines of the Majesco wireless messenger, the hardwares not a problem but i dont have a clue as to the multiboot protacol, is there someone who can point me in the right direction, or maybe atempted this project already
I have connected gps to GBA and talked to it serially, that had the software on a flash cart, i just think it would be cool to have a self contained device that doesn't need a cart
Thanks
#117449 - tepples - Sun Feb 04, 2007 10:23 pm
GBATEK should tell everything you need to know about the GBA MultiBoot protocol.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#117451 - Funky Gibbon - Sun Feb 04, 2007 10:37 pm
So it does, and the amount of times i've looked at that document, guess i should have gone to spec savers, lol
#117638 - ZeroX - Tue Feb 06, 2007 6:59 am
The GBA only has 256 + 32 KB of internal memory. You need to make sure your app is small enough.
My program XBOO XP is a multiboot rom transfer program. Its open source. So you can take a look at the code and see if it helps. Its not that hard, really. Ive put in comments i think. But i kinda forgot what i wrote, ever since i migrated to Linux.
You can find it in floating around somewhere. I submitted it to GBADev but they didnt take it in.
#117649 - Diddl - Tue Feb 06, 2007 10:36 am
I'm also interested in this multiboot. Where can I find sources of your XBOO XP?
I use multiboot with an old F2A cable, but I always have to change between F2A and GBA UART cable, so I'm searching for a better solution ...
#117654 - Funky Gibbon - Tue Feb 06, 2007 10:55 am
Hello ZeroX,
Im not too worried about memory as my app wont be graphic intensive, i've had a look at GBATEK, the document is so big i've never taken the time to read right though it, just skipped to the releant pages, it's not reall a multiboot cable im bulding, at the moment i dont have any hardware apps n mind just want to get the multiboot transfer working from say a pic18f452 which has i2c, 8x adc's parallel port (full size gameboy printer maybe?), and 33 i/o pins, which could be PWM'd to drive servo's.
All without the need of a flash cart because the .gba will be stored on th pc and transfered to the GBA
i hope i done sound like Dr Frankenstein, i do have a day job too. lol
Are you familiar with the Majesco Wireless messenger?
#117662 - Diddl - Tue Feb 06, 2007 1:36 pm
should not be a problem for the pic. it is very fast 16 bit protokoll while booting. after booting you can go over normal UART function of GBA.
but GBA has 3V and PIC should use 5V, so a MAX3232 will be nessecary.
#117670 - Funky Gibbon - Tue Feb 06, 2007 2:38 pm
most of the new pic's will run down to 2.7v i think the 18f452 might even go down to 2.1v, but the exact figure escapes me at the moment, in my last post i said the program would be transfered from the pc, this was a typo, one of many now that i look back at the post, but it should have said transfered from the pic, but i think you understood that anyway.
#117851 - ZeroX - Thu Feb 08, 2007 2:26 am
Im an engineer too.
You want to do a multiboot transfer from a PIC to the GBA. You wont really need MAX232, 5V output going into a 3.3V GBA will work just fine. But dont blame me if anything explodes though. I think PIC comes in many models these days. Pick a lower voltage one.
Sounds like you need a cable to connect the PIC serial output to the GBA regardless of what you are doing, as well as learn the multiboot protocol.
All you need to do is read and understand these 2 functions in my source : Initialize() and SendMainData()
The function SendData(A,B,C,D) is sending 4 bytes (ABCD) in one transfer.
The CRC check is a pain. Just copy my code and you're good to go.
Heres my source
http://cedega.firepipe.net/arundel/src/XBOOXP%20source.zip
And the program
http://cedega.firepipe.net/arundel/src/XBOO%20XP.zip
#117885 - Diddl - Thu Feb 08, 2007 8:32 am
@ZeroX
Thank you for the source code! I'm impressed of the small size of XBOO.com.
I will do the same for a Atmel Atmega for learning reasons. A GBA would be a nice graphic terminal for an atmel controller! But I will use a Max3232, cause Atmega will only work at 20MHz with 5V. Below the maximal frequency will decrease.
#117889 - Funky Gibbon - Thu Feb 08, 2007 10:26 am
Thanks ZeroX,
I'll have a look at your source now, i can communicate fine in UART mode i just dont understand the multiboot method yet, hopefully your source will help there, the 18f452 has a selectable brownout voltage and i'm sure it goes down to 2.1v, like you say the voltage difference wont require a max232.
Thanks to all for replies, i'll post comments on my progress incase anyone else is interested in this or their own project
#117922 - ZeroX - Thu Feb 08, 2007 7:04 pm
By the way, UART is wont work. GBA serial communication is different. During multiboot, GBA uses Normal mode serial communication.
See the GBATek documentation on 16/32 bit Normal mode serial communication. There is a pin the master (in your case, this is the microcontroller) uses to pulse a clock signal. UART doesnt have this. But dont worry, its easy.
My code will only help you understand the protocol. The transfer part in my code uses the parallel port, so its a bit hard to understand.
#117968 - Funky Gibbon - Thu Feb 08, 2007 11:06 pm
Hello ZeroX,
The plan will be to switch to UART made after to booting is complete,
thanks for the source btw.
the one crucial thing i needed to know was wether the GBA uses SD / SC or SI, SO, i've since found that bytes are sent recieved on SI & SO and Clocked on SD, so i was wrong in all cases.
Im very happy tonight as the GBA Returned a value of 7202 to the pic, yes i know, only 2 steps of many into the boot sequence, it's cheered me up though as it's an expected value, send 0x6200 until 720x recieved, send 0x6202, recieced 0x7202, i beleve this to be correct as if i send anything other than 0x6202 i get no responce, but then someones gonna correct me now
#118890 - Funky Gibbon - Sat Feb 17, 2007 9:47 pm
Seems my excitement was somewhat premature, my progress is at a halt at the moment with work and family commitments.
Im a bit confused after looking at ZeroX's Source as it seems to be sending data in 32 bit's at a time, i've tried this and cant get it to work, although i am using a different platform, here is a snippet of the debug data i get back from the Pic,
Send Expected Actual.
6200 --- 0000 --- 0000
6200 --- 720x --- 7202
6102 --- 720x --- 6002 <<< Fails Here
2E00 --- nn0x --- 5F02
00EA --- nn0x --- 5E02
24FF --- nn0x --- 5D02
AE51 --- nn0x --- 5C02
...... Sending Header .....
0000 --- nn0x --- 0402
0000 --- nn0x --- 0302
0000 --- nn0x --- 0202
0070 --- nn0x --- 0102
0000 --- nn0x --- 0002
6200 --- 000x --- 7202
6200 --- 720x --- 7202
631C --- 73xx --- 73AE
6414 --- 73xx --- 73EC
1000 --- 73xx --- 00C0
0000 --- nnnn --- 00C4
EA00 --- nnnn --- 00C8
0000 --- nnnn --- 00CC
0000 --- nnnn --- 00D0
0000 --- nnnn --- 00D4
0000 --- nnnn --- 00D8
.... Sending Main Block ....
it still comes back with an unexpected result just 3 steps in to the process, but does seem to still work ok. if the data does'nt make much sense im following the GBATEK Document, it should make some sense then
#119087 - ZeroX - Mon Feb 19, 2007 3:16 pm
Hi there.
Your problem is simple. Im gonna snip just the important part of GBATek for you to see (its kinda misaligned, so refer to the real one after this) :-
Times Send Receive Expl.
-----------------------Required Transfer Initiation in master program
... 6200 FFFF Slave not in multiplay/normal mode yet
1 6200 0000 Slave entered correct mode now
15 6200 720x Repeat 15 times, if failed: delay 1/16s and restart
1 610y 720x Recognition okay, exchange master/slave info
60h xxxx NN0x Transfer C0h bytes header data in units of 16bits
1 6200 000x Transfer of header data completed
1 620y 720x Exchange master/slave info again
... 63pp 720x Wait until all slaves reply 73cc instead 720x
1 63pp 73cc Send palette_data and receive client_data[1-3]
1 64hh 73uu Send handshake_data for final transfer completion
-----------------------Below is SWI 25h MultiBoot handler in BIOS
DELAY - - Wait 1/16 seconds at master side
1 llll 73rr Send length information and receive random data[1-3]
LEN yyyy nnnn Transfer main data block in units of 16 or 32 bits
1 0065 nnnn Transfer of main data block completed, request CRC
... 0065 0074 Wait until all slaves reply 0075 instead 0074
1 0065 0075 All slaves ready for CRC transfer
1 0066 0075 Signalize that transfer of CRC follows
1 zzzz zzzz Exchange CRC must be same for master and slaves
Ok, I've bolded the part where you've made your mistake. Kinda self explanatory.
You should repeat 0x6200 at least 15 times. In your table, it seems you only did it once. Notice the number 15 in the "times" column.
You should always refer to the GBATek Multiboot table, specifically the one I've snipped.
Cheers. Hopefully that should get you going again.
#119124 - Funky Gibbon - Mon Feb 19, 2007 11:15 pm
Thanks ZeroX
I understand the principal im just not so good at putting it into practice
it's gets very frustrating for me after a while.
Thanks for your input
Shaun