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 > Iwram compile error

#133032 - doudou - Mon Jul 02, 2007 8:57 pm

I'm trying to get my GBA project compiling for NDS. This is the latest error I got:

linking GameProject.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: error: no memory region specified for loadable section `.iwram'
collect2: ld returned 1 exit status

Any suggestion?

#133038 - wintermute - Mon Jul 02, 2007 9:31 pm

Don't put code in .iwram?

The DS arm9 linkscripts don't contain a .iwram section, the equivalent is .itcm. You should start by removing any attributes which place functions or data in non default sections, it's probably unlikely that you need to use the fast memory on the DS.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#133790 - doudou - Sun Jul 08, 2007 7:06 pm

Thanks, I didn't really need to put code in the iwram for DS, removing the

__attribute__((section (".iwram"),long_call))

did solve the problem. I think Since I'm trying to compile a complete GBA game project for DS, I think I will encounter some artefacts of that kind before succeeding...

I'm already stuck on another:

c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: region ewram is full (c:/GameProject/MakeNDS/Game.elf section .rodata)

And there are few others about others sections. Maybe I need a to know a bit more about sections and linking in general, does someone have a link or topic that could help?

#133842 - wintermute - Mon Jul 09, 2007 5:59 am

The last one means that you've consumed all of the DS memory unfortunately. The DS has 4meg available for your application as opposed to the GBA's 32meg of ROM space.

If possible you need to load your assets from an external device using the file IO provided by libfat and not attempt to have everything in memory simultaneously.

I have considered providing another set of linkscripts to allow building ARM9 code to run from GBA cart space but I'm not sure this is something that should be encouraged. Cart space is only available on slot2 cards and, even then, not all devices provide the full 32meg. For slot1 cards your only option is the file system.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#134596 - doudou - Sat Jul 14, 2007 2:50 pm

Thanks again! For now I only removed a lot of my resources to be able to compile and it did. Next step will be to use the libfat IO you mentionned.

My rom is not running in DeSmuME. I can see my backgrounds (mode 0) but not my sprites. It's already more than what I thought you work at this point. It's not working on my DS though.