Section Type Conflict IWRAM data + code

Post Reply
g012
Posts: 3
Joined: Sat Mar 07, 2015 8:23 pm

Section Type Conflict IWRAM data + code

Post by g012 » Sat Mar 07, 2015 8:28 pm

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.

WinterMute
Site Admin
Posts: 1369
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Section Type Conflict IWRAM data + code

Post by WinterMute » Wed Mar 11, 2015 1:42 pm

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.
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest