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 > Help with EABI versions and other building errors

#163814 - zzo38computer - Sun Oct 12, 2008 10:15 pm

I made a software Xyds but it didn't work on real hardware the first time, it work on emulator only. I downloaded the new version of devkitARM, in case that was a mistake in the old version of devkitARM, but now I get error message:
Code:
F:\devkitPro\proj\xyds>make
make -C arm7
make[1]: Entering directory `/f/devkitPro/proj/xyds/arm7'
linking xyds.arm7.elf
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0\libgcc.a(_divsi3.o): In fun
ction `__aeabi_idiv':
(.text+0x0): multiple definition of `__divsi3'
f:/devkitpro/libnds/lib\libnds7.a(division.o):e:/projects/devkitPro/libnds/sourc
e/common/division.s:(.text+0x0): first defined here
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: ERROR: Source object f:/devkitpro/libnds/lib\libnds7.a(clock.o) has EABI v
ersion 0, but target f:/devkitPro/proj/xyds/arm7/xyds.arm7.elf has EABI version
4
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: failed to merge target specific data of file f:/devkitpro/libnds/lib\libnd
s7.a(clock.o)
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: ERROR: Source object f:/devkitpro/libnds/lib\libnds7.a(touch.o) has EABI v
ersion 0, but target f:/devkitPro/proj/xyds/arm7/xyds.arm7.elf has EABI version
4
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: failed to merge target specific data of file f:/devkitpro/libnds/lib\libnd
s7.a(touch.o)
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: ERROR: Source object f:/devkitpro/libnds/lib\libnds7.a(interrupts.o) has E
ABI version 0, but target f:/devkitPro/proj/xyds/arm7/xyds.arm7.elf has EABI ver
sion 4
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: failed to merge target specific data of file f:/devkitpro/libnds/lib\libnd
s7.a(interrupts.o)
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: ERROR: Source object f:/devkitpro/libnds/lib\libnds7.a(biosCalls.o) has EA
BI version 0, but target f:/devkitPro/proj/xyds/arm7/xyds.arm7.elf has EABI vers
ion 4
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: failed to merge target specific data of file f:/devkitpro/libnds/lib\libnd
s7.a(biosCalls.o)
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: ERROR: Source object f:/devkitpro/libnds/lib\libnds7.a(division.o) has EAB
I version 0, but target f:/devkitPro/proj/xyds/arm7/xyds.arm7.elf has EABI versi
on 4
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: failed to merge target specific data of file f:/devkitpro/libnds/lib\libnd
s7.a(division.o)
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: ERROR: Source object f:/devkitpro/libnds/lib\libnds7.a(interruptDispatcher
.o) has EABI version 0, but target f:/devkitPro/proj/xyds/arm7/xyds.arm7.elf has
 EABI version 4
f:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/bin/ld
.exe: failed to merge target specific data of file f:/devkitpro/libnds/lib\libnd
s7.a(interruptDispatcher.o)
collect2: ld returned 1 exit status
make[2]: *** [/f/devkitPro/proj/xyds/arm7/xyds.arm7.elf] Error 1
make[1]: *** [build] Error 2
make[1]: Leaving directory `/f/devkitPro/proj/xyds/arm7'
make: *** [arm7/xyds.elf] Error 2
Can you tell me how to fix it, please? What is a EABI version, anyways?
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.

#163817 - tepples - Sun Oct 12, 2008 11:18 pm

The EABI version is essentially the format of .o files.

Did you update libnds at the same time?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#163819 - silent_code - Sun Oct 12, 2008 11:24 pm

Double post? :^|
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#163832 - zzo38computer - Mon Oct 13, 2008 4:30 am

tepples wrote:
The EABI version is essentially the format of .o files.

Did you update libnds at the same time?

I updated libnds. The EABI version is fixed now, but there is error with ARM7 codes now. Does the ARM7 codes need to be updated for new libnds? Does the makefile have to be changed? If so, can you post the new ARM7 codes here? I just used the default ARM7 codes in my project.

Code:
f:/devkitPro/proj/xyds/arm7/source/main7.c: In function 'VblankHandler':
f:/devkitPro/proj/xyds/arm7/source/main7.c:35: error: 'TransferRegion' has no member named 'curtime'
f:/devkitPro/proj/xyds/arm7/source/main7.c:70: error: 'TransferRegion' has no member named 'heartbeat'
f:/devkitPro/proj/xyds/arm7/source/main7.c:82: error: 'TransferRegion' has no member named 'curtime'
f:/devkitPro/proj/xyds/arm7/source/main7.c:35: warning: unused variable 'ct'


Can you please also look to see if there is any other mistakes in my codes? (I posted the link at the top message of this thread)
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.

#163835 - mml - Mon Oct 13, 2008 8:53 am

Quote:
I just used the default ARM7 codes in my project.


Then replace it with the new ARM7 code from the updated templates

#163841 - zzo38computer - Mon Oct 13, 2008 4:05 pm

mml wrote:
Quote:
I just used the default ARM7 codes in my project.


Then replace it with the new ARM7 code from the updated templates


I fixed that, and then I fixed the names for the register but I have the same problem as I did before I replaced the devkitPro and libnds.

These two codes work correctly on DeSmuME emulator, but on real hardware, updatetile won't change the palettes used by the tiles (but it will flip them over like it is supposed to), and update1char won't change anything at all.

Code:
void updatetile(u16 m) {
   m=m&~1;
   int x=((m-0xE000)>>1)%xymram[0xFFF3];
   int y=((m-0xE000)>>1)/xymram[0xFFF3];
   u16* p=(u16*)(SCREEN_BASE_BLOCK(0)+y*64+x*2);
   u16 d=xymram[m];
   if(xymram[m+1]&0x01) d|=0x1000;
   if(xymram[m+1]&0x40) d|=0x0800;
   if(xymram[m+1]&0x80) d|=0x0400;
   *p=d;
}


Code:
void update1char(u8 d) {
   u8* p;
   u16 m=0xC000+8*d;
   u8 z,d1;
   int x,y;
   for(y=0;y<8;y++) {
      z=xymram[y+m];
      for(x=0;x<8;x+=2) {
         p=(u8*)(CHAR_BASE_BLOCK(1)+32*d+4*y+x/2);
         d1=0x22;
         if(z&(0x80>>x)) d1|=0x01;
         if(z&(0x80>>(x+1))) d1|=0x10;
         *p=d1;
      }
   }
}


Here's the initialization codes, in case the initialization codes have something to do with it:
Code:
void gfx_init() {   
   REG_POWERCNT=POWER_SWAP_LCDS | POWER_ALL_2D;
   vramSetMainBanks(VRAM_A_MAIN_BG,VRAM_B_MAIN_BG,VRAM_C_SUB_BG,VRAM_D_LCD);
   SUB_DISPLAY_CR=MODE_0_2D|DISPLAY_BG0_ACTIVE;
   DISPLAY_CR=MODE_0_2D|DISPLAY_BG0_ACTIVE;
   SUB_BG0_CR=BG_TILE_BASE(1);
   SUB_BG0_X0=0;
   SUB_BG0_Y0=0;
   BG0_CR=BG_TILE_BASE(1);
   BG0_X0=0;
   BG0_Y0=0;
   swiFastCopy(&font_bin,(u16*)(CHAR_BASE_BLOCK_SUB(1)),font_bin_size/4);
}


The sub display works fine, only the main display has the problems I described above.
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.

#163842 - elhobbs - Mon Oct 13, 2008 4:46 pm

update1char is doing 8 bit writes to video memory - this does not work. you need to do 16 bit writes to video memory.

#163843 - josath - Mon Oct 13, 2008 5:24 pm

zzo38computer wrote:
Code:
void updatetile(u16 m) {
   m=m&~1;
   int x=((m-0xE000)>>1)%xymram[0xFFF3];
   int y=((m-0xE000)>>1)/xymram[0xFFF3];
   u16* p=(u16*)(SCREEN_BASE_BLOCK(0)+y*64+x*2);
   u16 d=xymram[m];
   if(xymram[m+1]&0x01) d|=0x1000;
   if(xymram[m+1]&0x40) d|=0x0800;
   if(xymram[m+1]&0x80) d|=0x0400;
   *p=d;
}


Code:
void update1char(u8 d) {
   u8* p;
   u16 m=0xC000+8*d;
   u8 z,d1;
   int x,y;
   for(y=0;y<8;y++) {
      z=xymram[y+m];
      for(x=0;x<8;x+=2) {
         p=(u8*)(CHAR_BASE_BLOCK(1)+32*d+4*y+x/2);
         d1=0x22;
         if(z&(0x80>>x)) d1|=0x01;
         if(z&(0x80>>(x+1))) d1|=0x10;
         *p=d1;
      }
   }
}


Holy magic numbers, Batman!

#163845 - zzo38computer - Mon Oct 13, 2008 6:41 pm

elhobbs wrote:
update1char is doing 8 bit writes to video memory - this does not work. you need to do 16 bit writes to video memory.
Thanks. That fixed it. I used this code:
Code:
void write8bitvram(u8* p8,u8 v8) {
   u16* p16=(u16*)(((u32)p8)&~1);
   if(((u32)p8)&1) {
      *p16=(0x00FF&*p16)|(v8*0x100);
   } else {
      *p16=(0xFF00&*p16)|(v8);
   }
}
Is this the best way to do it? Is there a better way? And why does the NDS require 16 bit writes to video memory anyways?
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.

#163851 - elhobbs - Mon Oct 13, 2008 7:34 pm

zzo38computer wrote:
Is this the best way to do it? Is there a better way? And why does the NDS require 16 bit writes to video memory anyways?
maybe.probably.because it does.

it depend on what you are using it for. If you are trying draw the entire screen with this then it will be very slow. if it is used to load or update something everyonce in a while then it is probably fine.