libnds-1.3.1 and freeze in fifoInit

Post Reply
z.g
Posts: 22
Joined: Thu Dec 18, 2008 8:33 pm

libnds-1.3.1 and freeze in fifoInit

Post by z.g » Fri Dec 19, 2008 1:23 pm

for some reason i need that arm7 binary targeted not into wram but into main ram in my project.
but then i changed target place for arm7 to main ram, there is frezze happens inside fifoInit while loop on arm7 side.
freeze happens on real hardware (i try on r4 and ak rpg). on no$gba all works fine.
small example.
where is problem?

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: libnds-1.3.1 and freeze in fifoInit

Post by eKid » Fri Dec 19, 2008 1:38 pm

Putting the ARM7 program in main ram can cause some pain... :)

I know fifoInit syncs both processors somehow. If both arm7 and arm9 are running from main ram, then the arm9 will be frozen until the arm7 goes to sleep (I think it may be selectable which processor has priority). The arm7 will never go to sleep because it is busy trying to sync with the arm9 (which is stuck).

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

Re: libnds-1.3.1 and freeze in fifoInit

Post by WinterMute » Fri Dec 19, 2008 3:27 pm

z.g wrote:for some reason i need that arm7 binary targeted not into wram but into main ram in my project.
This setup is not supported. Running your arm7 binary in main RAM is ill advised given that both processors cannot access main RAM simultaneously.
Help keep devkitPro toolchains free, Donate today

Personal Blog

z.g
Posts: 22
Joined: Thu Dec 18, 2008 8:33 pm

Re: libnds-1.3.1 and freeze in fifoInit

Post by z.g » Fri Dec 19, 2008 3:27 pm

eKid wrote:I know fifoInit syncs both processors somehow. If both arm7 and arm9 are running from main ram, then the arm9 will be frozen until the arm7 goes to sleep (I think it may be selectable which processor has priority). The arm7 will never go to sleep because it is busy trying to sync with the arm9 (which is stuck).
you are right. replacing

Code: Select all

for(delaycount=0;delaycount<delay;delaycount++) {}
to

Code: Select all

swiDelay(delay);
solve my problem. executing on arm7 goes away from main ram and arm9 can execute own code.
so why did blank cycle used instead swiDelay in libnds?

GrizzlyAdams
Posts: 3
Joined: Tue Jan 06, 2009 4:37 am

Re: libnds-1.3.1 and freeze in fifoInit

Post by GrizzlyAdams » Tue Jan 06, 2009 5:10 am

As an alternate to running your arm7 from main ram consider dedicating one or two banks of vram (C & D) to the arm7. This avoids the bus arbitration (AFAIK) and allows you to use an unmodified libnds.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests