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 > WRAM & IWRAM

#162297 - jimis - Sat Aug 30, 2008 5:56 pm

I am trying to use ds wram (shared memory) to move data from one processor to the other. Unfortunatelly devkitarm maps it by default to arm7 to form a continuous 96KB block. Is it possible to move arm7 code in iwram only (0x03800000) by eg. modifying a file?

#162312 - eKid - Sun Aug 31, 2008 6:38 am

You have to setup your project to use a custom arm7 linker script. Then you can modify a copy of the devkitARM script to put the data/code in the different spot (3800000-64kb).

#162313 - jimis - Sun Aug 31, 2008 8:36 am

Thanks a lot for the fast reply!
Just because I am a newbie an I have little programming experience can anybody give me more specific instructions?
The only file that I have seen containing arm7 iwram info was ds_arm7.ld. Is this what i have to edit?
After putting this (iwram : ORIGIN = 0x03800000, LENGTH = 64K) in ds_arm7.ld I noticed changes in my .map file. The addresses in it where above 0x03800000 (only in iwram memory). But all emulators and the ds apparently crashed...
Note:Only arm7 crashed, arm9 was functioning properly.

#162316 - jimis - Sun Aug 31, 2008 9:22 am

I have just seen the -T flag of the compiler which enables you to use a custom scriptfile.
Is this the way to use a custom arm7 linker script?

#162367 - eKid - Mon Sep 01, 2008 10:31 am

It's probably crashing because ndstool is still building the final NDS rom with the 37F8000 address. Try adding "-r7 0x3800000 -e7 0x3800000" to your ndstool line in your makefile to tell it the new arm7 load/entry points.

#162383 - jimis - Mon Sep 01, 2008 6:00 pm

Thank you it worked!