gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > ndslib: Problems building arm7.bin from source.

#43018 - Abcd1234 - Wed May 18, 2005 7:36 am

Are there any particular issues I should be aware when trying to build arm7.bin by hand? First, note I've converted the file to plain C (I didn't bother to build a C++ cross-compiler), but that shouldn't be a big deal. Anyway, for some reason, the provided arm7.bin in the tools directory seems to work just fine, but when I try to build it myself, it seems the ARM7's interrupt handler isn't being triggered. Thoughts?

Worst case, I can just disassemble the two and see what's different, but I wanted to make sure there wasn't something simple I was missing. :)

#43021 - Darkain - Wed May 18, 2005 8:31 am

compile for ARM instead of THUMB. should solve the IRQ issue.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#43035 - Abcd1234 - Wed May 18, 2005 3:25 pm

I don't believe I am compiling for THUMB. The following flags are passed to gcc:

-mcpu=arm7tdmi -mtune=arm7tdmi -mthumb-interwork

So, it should be ARM code with THUMB interworking enabled (which only makes it possible for ARM code to call out to THUMB subroutines... the code itself should compile to the standard ARM ISA). AFAIK, I would have had to use the -mthumb flag to make gcc generate THUMB instructions. Unless, that is, I'm mistaken.

#43069 - Darkain - Wed May 18, 2005 8:21 pm

no asumptions, add "-marm" to that list as well just to make sure.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#43112 - Abcd1234 - Thu May 19, 2005 6:20 am

Still no love... compiled with -mcpu=arm7tdmi -mtune=arm7tdmi -marm -mthumb-interwork. That should be producing pure ARM code... and I'm pretty sure my libgcc and my crt object files are compiled as ARM code.

Incidentally, if you were worried that the interrupt handler was being compiled as THUMB code, I'm pretty sure that's not the case...

#43121 - Darkain - Thu May 19, 2005 9:02 am

now, are you SURE its just the IRQs that arent working, or is the entire ARM7 locking?
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#43152 - Abcd1234 - Thu May 19, 2005 3:18 pm

Well, that's down the road of trying to actually debug and solve the problem, which I'll quite happily do on my own. I just wanted to make sure there wasn't something plainly obvious wrong... it appears there isn't. :(

#43172 - dovoto - Thu May 19, 2005 8:00 pm

If you are using your own compiler tool chain I recomend you verify linker script and crt issues. Specificaly note where you are compileing arm7 code to run from and that you are loading that code to this location (normaly done by the loader in dsbuild and the header added by ndstool). Ndslib has only been tested with devkitarm.
_________________
www.drunkencoders.com