Page 1 of 1

Section Type Conflict IWRAM data + code

Posted: Sat Mar 07, 2015 8:28 pm
by g012
Hello,

How should I go to put data and code in IWRAM ? I've done the following:

Code: Select all

IWRAM_DATA static u32 s_frameCount;
IWRAM_CODE static void VBlank(void)
{
    ++s_frameCount;
}
And I get:

Code: Select all

main.c:87:24: error: VBlank causes a section type conflict with s_frameCount
 IWRAM_CODE static void VBlank(void)
                        ^
main.c:12:23: note: 's_frameCount' was declared here
 IWRAM_DATA static u32 s_frameCount;
Am I doing it wrong ?
Thank you.

Re: Section Type Conflict IWRAM data + code

Posted: Wed Mar 11, 2015 1:42 pm
by WinterMute
The GBA linkscripts place data and bss in iwram by default so you don't need to explicitly mark writable data as being in the iwram section.

Being honest it's been so long since I touched GBA code that I really can't remember what the purpose of the IWRAM_DATA macro actually was. The compiler will complain if you try to place objects of different types into the same section within the same compilation unit.