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 > Error: section .sbss is not within region dtcm

#53440 - headspin - Thu Sep 08, 2005 1:18 pm

I have just updated to the latest DevKitARM and what previously compiled ok was...

Code:
short EWRAM_BSS MemWav[MAXSMP];


Which is a large array to store WAV data. It used to compile and allocate at runtime. But now the new DevKitARM gives the following error:

Quote:
c:\devkitpro\devkitarm\bin\..\lib\gcc\arm-elf\4.0.1\..\..\..\..\arm-elf\bin\ld.exe: address 0x8d7550 of build.elf section .sbss is not within region dtcm


If I change it to..

Code:
short VAR_IN_EXRAM MemWav[MAXSMP];


It works but adds around 500k to the ROM. I don't wan't that, I want it to be allocated at runtime like it used to.

BTW I've tried the following...

Code:
short *MemWav;
MemWav = new short[MAXSMP]; // dosn't work
MemWav = (short *) malloc(MAXSMP*sizeof(short)); // also dosn't work


Both the above don't work either!
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#53462 - tepples - Thu Sep 08, 2005 4:25 pm

headspin wrote:
I have just updated to the latest DevKitARM and what previously compiled ok was...

Code:
short EWRAM_BSS MemWav[MAXSMP];


Which is a large array to store WAV data. It used to compile and allocate at runtime. But now the new DevKitARM gives the following error:

Quote:
c:\devkitpro\devkitarm\bin\..\lib\gcc\arm-elf\4.0.1\..\..\..\..\arm-elf\bin\ld.exe: address 0x8d7550 of build.elf section .sbss is not within region dtcm

In devkitARM R12 the locations of .bss and .sbss were swapped. Try taking out the declaration entirely.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#53466 - MrAdults - Thu Sep 08, 2005 4:44 pm

In R15, looking at the ld, sbss should go to dtcm but bss should go to ewram. I think sbss going to dtcm is new(ish). So if you're using an old version of ndslib (for the EWRAM_BSS define) and a new(ish) version of DKA, that would explain the issue.

If you want to make sure that goes into ewram's bss you can use __attribute__((section(".bss"))).

-Rich

#53477 - headspin - Thu Sep 08, 2005 5:29 pm

Worked a charm, thanks very much MrAdults & Tepples
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game