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 > Troubles I have by upgrading from devkitpro v18 to v19b.

#110625 - Dark Knight ez - Thu Nov 30, 2006 12:04 am

Hey everybody.


I had to upgrade from devkitpro v18 to v19b, and a couple of troubles have arisen so far. Probably mistakes on my part.
I hope you guys can help out.


The first trouble is the error when building my latest version of AmplituDS.
When it's "linking amplituds.arm7.elf" it gives me the following error(s):
Code:
address 0x3810604 of [..]/amplituds.arm7.elf section .bss is not within region iwram
collect2: ld returned 1 exit status


No idea what's wrong. The compiled objects for ARM7 are just under 50 kb in size (and the .map file is 184 kb). I can't believe this would be too large, so it must be something other than size that is wrong, right?
Also, in the ARM7 code I never specificly specified something to be put in .bss or iwram or whatever, so it's not like I made a mistake there.


Second "trouble" is not that big.
It seems that by using this new version, I get one BIG mention of what object is compiled, with the entire (6/7-line) arm-eabi-g++ command displayed. This makes it hard to see 1) what is compiled and 2) what the errors/warnings are.
I'm used to only see a mention like "main.cpp", letting me know it is compiled to an object... no displaying of what is used to do so.
I'm guessing one can do this by fiddling with the Makefile?


And third... does anyone know why some registers are defined multiple times in libnds? Some are defined in both registers_alt.h and interrupts.h. It's giving me warnings (nothing to worry about of course, but definitely looks less clean). This was also the case with (the libnds that came with) v18 though.


Thanks in advance.
_________________
AmplituDS website

#110626 - GPFerror - Thu Nov 30, 2006 12:10 am

are you using c++ on the arm7? if not rename to main.c and save some space. If you notice for the new templates for the arm7 is now called template.c

Troy(GPF)
http://gpf.dcemu.co.uk

#110628 - Lick - Thu Nov 30, 2006 12:15 am

Perhaps you should remove the whole installation and download to a fresh directory.
_________________
http://licklick.wordpress.com

#110632 - Dark Knight ez - Thu Nov 30, 2006 12:24 am

Quote:
are you using c++ on the arm7?

Yes. I might rewrite it to pure C, _but_ I was also thinking of trying to put libmikmod entirely on ARM7. When it comes to CPU usage, it should actually be able to handle it (just). That'd be another 500 kb for ARM7 though and I also haven't tried yet if ARM7 can malloc. (It probably can, right?)
Still... currently its under 50 kb... that's nothing. :(


Quote:
Perhaps you should remove the whole installation and download to a fresh directory.

You really think that'd do any good? My codenamed project rts4ds built without a hitch. Of course, the ARM7 code is next to nothing there, but still...
I'm willing to give it a try though.
_________________
AmplituDS website

#110660 - Ted - Thu Nov 30, 2006 4:24 am

I don't think you should include registers_alt.h at all actually.
As far as i've understood, it's old stuff that shouldn't be used anymore.

And you actually should worry about warnings since they usually indicate that something's not quite right and should be fixed. =)

#110675 - gladius - Thu Nov 30, 2006 9:46 am

The arm7 has 96k of space now, with the 32 shared iwram and 64k arm7 ram. Your bss section is located past that, so another section must be too big. Try arm-eabi-readelf -a outputarm7.elf, that will dump a list of the symbols and the space they are taking up.

c++ on the arm7 is evil and should be avoided, that's probably your problem wrt size. Second, the arm7 cannot malloc, you need to malloc on the arm9, then send the pointer over.

An alternative to sending the pointer over is to steal the end 512k of ram or something, and hardcode your buffer location in memory. snesds uses this method and it works well as a minimal overhead way of managing things.

#110681 - Dark Knight ez - Thu Nov 30, 2006 11:27 am

Quote:
I don't think you should include registers_alt.h at all actually.

And I think I should. It's the only header file with a define of REG_DISPCNT for instance. I need that register.
The warnings are just redefines of registers like REG_KEYCNT. Nothing to worry about, but lame, yes. I could comment out those double defines or something in libnds header files.

This warnings seems way more important to me:
'__packed__' attribute ignored for field of type 'u8'
These are all over the place in my EZ-Flash 4's gba_nds_fat source files. It seems to still work though.


Quote:
Try arm-eabi-readelf -a outputarm7.elf

Unfortunately, no arm7.elf file is outputted when "make"-ing. When linking arm7.elf, it errors out and fails to create the .elf file.
I guess I'll try to convert everything to C.
edit:
Rewrote ARM7 to be C only and created a proper 70 kB arm7.elf file. Of course, now I also need to rewrite (almost) everything on ARM9 to be in C as well, as they're closely related and share header files... so I can't test if I converted it properly. To be continued. :)


By the way, can code be put on the ARM9 side and then executed by ARM7? Without (a substantial) loss of performance? If not, then libmikmod executed by the ARM7 has zero amount of chance of happening, I guess.
_________________
AmplituDS website

#110702 - Lick - Thu Nov 30, 2006 7:25 pm

Check out 'system.h' 'memory.h' 'video.h', one of those should contain your registers.
_________________
http://licklick.wordpress.com

#110705 - OOPMan - Thu Nov 30, 2006 8:32 pm

I got "__xyz__ attribute ignored" warnings when porting and compiling MTCLib for the DS.

According to masscat (I think...) they're nothing to critical to worry about, as the indicate the code in question is built for an older C compiler that does not automatically assume the attribute to be in use...

Or something. I'm probably misquoting somewhat...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#110720 - Ted - Thu Nov 30, 2006 11:12 pm

The DISPLAY_CR define in video.h points to the same place that REG_DISPCNT does.
And i use the videoSetMode() function for setting it, but i suppose you'd have to use the register define if you want to read from it for some reason.

#110735 - gladius - Fri Dec 01, 2006 2:01 am

arm-eabi-dumpobj -t blah.o will give you a symbol list from a .o file as well. Or you can see how big the sections are with another flag to dumpobj that I forget at the moment. Just run it with no parameters and it will give you the list.

Anyhow, glad to hear it's working for you now.