GP32 Devkitarm R18


Franxis posted on Apr 11 2006 at 10:12 PM said:
http://www.devkitpro.org/

Now with GCC 4.1.0...

It is for GP32 (also GBA, NDS,...) but not for GP2X.
Nice, I hope there will be a Macintosh version. So far only Windows and Linux.

EDIT: Mac OS X version now available!

BTW: Anyone else develop using OS X?
 
Last edited by a moderator:
Using this new version with my r17 makefiles, I get an error at link time :

exec: /e/gp32dev/devkitadv2/devkitarm_r18/bin/../lib/gcc/arm-elf/4.1.0/../../../../arm-elf/bin/ld.real: not found

"ld.real.exe" is present in the folder.

any idea ?

thanks


Thor
 
rtb7 posted on Apr 25 2006 at 07:41 AM said:
Using this new version with my r17 makefiles, I get an error at link time :

exec: /e/gp32dev/devkitadv2/devkitarm_r18/bin/../lib/gcc/arm-elf/4.1.0/../../../../arm-elf/bin/ld.real: not found

"ld.real.exe" is present in the folder.

any idea ?


That's a weird one, what OS are you using?

devkitARM release 18 contains elf2flt for creating BFLT binaries which involves some script hackery with the linker. You can rename ld in that folder and move ld.real.exe back to ld.exe which should get back to the old behaviour.

What version of make are you running? Are you perhaps not using the msys variant?

look for these lines at the top of the ld script

Code:
# massage path for msys
_ARG0=$(echo $0 | sed -e 's/^([a-zA-Z]):/\/\1/' -e 's/\\/\//g')

change it to this

Code:
# massage path for msys
if [ $OSTYPE = "msys" ]; then
  _ARG0=$(echo $0 | sed -e 's/^([a-zA-Z]):/\/\1/' -e 's/\\/\//g')
else
  _ARG0=$0
fi

does that help any?

The other option would be to determine if the script is running on windows and append a .exe on the following line.

Add a line like this at the top of the ld bash script ( somewhere around the __ARGV0 lines)

Code:
echo "*** SHELL = "`uname -s`" ***"

what output do you get from that?
 
Last edited by a moderator:
Hello!

- I'm a newbie programmer working on a WXP home edition for my GP32, you know the rest :( Can anyone give me some advice? ...

- It is possible to work with devkitARM on cygwin? I don't understand the difference with MSYS... If I recompile in cygwin, will it work?

- Anyway, using the current release of devkitARM and trying to recompile the x_gp32 libraries for SDL and testing the first example i only get a blank screen (by the way i saw that arm-elf-gcc has the -enabled-interwork, do i have to use -mno-thumb-interwork and -msoft-float??), in older versions of the compiler in one way or another this examples worked :blink: ... One stupid question, is there some thread implementation (via SDL, or anything) in the GP32?

- One more thing, can someone explain some tips for basic debugging? I test the fxe first with the geepee and then on the machine... The .map files are of any use with the dump of the fw157 firmware? Trying to generate a mapfile these lines on the makefile doesn't work...

CC= arm-elf-gcc
LD= arm-elf-gcc
...
DOLINK = $(LD) -s -Wl,Map,$(PROGRAM).map $(LDFLAGS) -specs=gp32.specs $(OBJS) $(SYSTEMLIBS) -o $(PROGRAM).elf


Ii have a lot of confusion with all this,... need some illumination :blink:
 
rtb7 posted on Apr 28 2006 at 02:52 PM said:
OS : W2K
I'll try all of that tonight.
thanks a lot

I downloaded/installed MSYS, removed ".real" extension in ld script and renamed ld.real.exe to ld.exe
and now it works.
 
Last edited by a moderator:
kidchaos2k6 posted on May 1 2006 at 11:13 AM said:
- It is possible to work with devkitARM on cygwin? I don't understand the difference with MSYS... If I recompile in cygwin, will it work?

It might, it might not - I tried this a long time ago when I put together the first no cygwin toolchains and things died quite badly in places. It might work now.

Cygwin is a full posix emulation layer designed to allow easy porting of linux software. This makes it slow and bloated.

Msys is a package which provides most of the common linux toolset without the overhead of the posix emulation layer. This makes it fast and lean.

The latter is recommended.

Recompiling devkitARM under cygwin will make it slow, even if the buildscripts actually work in a cygwin environment.

- Anyway, using the current release of devkitARM and trying to recompile the x_gp32 libraries for SDL and testing the first example i only get a blank screen (by the way i saw that arm-elf-gcc has the -enabled-interwork, do i have to use -mno-thumb-interwork and -msoft-float??), in older versions of the compiler in one way or another this examples worked :blink: ... One stupid question, is there some thread implementation (via SDL, or anything) in the GP32?

the default flags are -marm -mno-thumb-interwork, --enable-interwork just means that interworking is enabled and useable. For historical reasons the object files are marked as hard float but do not contain FPU code, -msoft-float is unnecessary and actually undesirable since the application can't be linked when that flag is used.

I don't know anything about GP32 SDL so sorry can't help you there.

- One more thing, can someone explain some tips for basic debugging? I test the fxe first with the geepee and then on the machine... The .map files are of any use with the dump of the fw157 firmware?

Debugging can be as basic as simple print statements throughout your code. Simply print some values on the screen using whatever output commands your library provides. ( gp_drawString for libmirko ) and compare them to the values you expect or simply print the progress of your application and see how far it gets.

I'm in the process of porting the GP32 gdbserver to windows to see if I can get it working with Insight/gdb

http://gp32.misantrop.org/gdbstubinfo.html

it might take a while though I have several other projects demanding my attention atm.


Trying to generate a mapfile these lines on the makefile doesn't work...

CC= arm-elf-gcc
LD= arm-elf-gcc
...
DOLINK = $(LD) -s -Wl,Map,$(PROGRAM).map $(LDFLAGS) -specs=gp32.specs $(OBJS) $(SYSTEMLIBS) -o $(PROGRAM).elf

You missed a - before the Map

Code:
DOLINK = $(LD) -s -Wl,-Map,$(PROGRAM).map $(LDFLAGS) -specs=gp32.specs $(OBJS) $(SYSTEMLIBS) -o $(PROGRAM).elf

rtb7 posted on May 2 2006 at 12:42 PM said:
rtb7 posted on Apr 28 2006 at 02:52 PM said:
OS : W2K
I'll try all of that tonight.
thanks a lot

I downloaded/installed MSYS, removed ".real" extension in ld script and renamed ld.real.exe to ld.exe
and now it works.


Hmm, since you renamed ld.real.exe to ld.exe I don't think it will be running the elf2flt script at all. Were you running a different version of make before? Possibly Cygwin - since it actually ran the script you obviously had bash somewhere.
 
Last edited by a moderator:
Thanks for solving me these questions:

I have been for some time testing the different sdk's and libs from the internet and i think that it is possible to make a custom environment on cygwin with the latest devkitarm and mirko sdk libs/crt's (fogetting about gp32.sdk specs). A few months ago i tested some c++ and STL code and i got it working, but my computer crashed and i lost all that work...

Regarding the stub, i know of it's existence but wouldn't it be great to debug just using the standard USB cable? (at least i like to dream). I wonder how difficult/expensive is to build a JTAG-USB cable for using that GDB stuff...

Thanks anyway, i was getting tired of getting no answers...

Regards,
 
Just one more final question, apart from the interrupts in the mirko sdk, i saw on the official SDK docs that there is some threading implementation,... is there any possibility to use any pthread library with gcc??

Regards ;)
 
WinterMute posted on May 2 2006 at 05:13 PM said:
rtb7 posted on May 2 2006 at 12:42 PM said:
rtb7 posted on Apr 28 2006 at 02:52 PM said:
OS : W2K
I'll try all of that tonight.
thanks a lot

I downloaded/installed MSYS, removed ".real" extension in ld script and renamed ld.real.exe to ld.exe
and now it works.


Hmm, since you renamed ld.real.exe to ld.exe I don't think it will be running the elf2flt script at all. Were you running a different version of make before? Possibly Cygwin - since it actually ran the script you obviously had bash somewhere.

yes, cygwin (on my work machine), and I have so many other gcc or other devenv installed...
It works without renaming the exe at home (on W2K too) with MSYS in the path.
but unfortunatly, the code generated with this r18 is slower than the one generated by r17.

Thanks

Thor
 
Last edited by a moderator:
kidchaos2k6 posted on May 3 2006 at 11:46 PM said:
Just one more final question, apart from the interrupts in the mirko sdk, i saw on the official SDK docs that there is some threading implementation,... is there any possibility to use any pthread library with gcc??

Regards ;)

Yes - pthread's all there. I haven't used dynamic linking, but I've statically linked pthread.a fine.
 
Last edited by a moderator:
kidchaos2k6 posted on May 3 2006 at 11:35 PM said:
Thanks for solving me these questions:

I have been for some time testing the different sdk's and libs from the internet and i think that it is possible to make a custom environment on cygwin with the latest devkitarm and mirko sdk libs/crt's

Why cygwin? devkitARM is designed not to need it.

The only advantage you get from cygwin is the ability to build *nix centric code on windows with little or no modification.

Regarding the stub, i know of it's existence but wouldn't it be great to debug just using the standard USB cable? (at least i like to dream). I wonder how difficult/expensive is to build a JTAG-USB cable for using that GDB stuff...

I'm not sure what you mean. The stub works with the standard USB cable afaik.
 
Last edited by a moderator:
WinterMute posted on May 4 2006 at 10:06 PM said:
I'm not sure what you mean. The stub works with the standard USB cable afaik.

:blink: :blink: :blink: :blink: REALLY???? :blink: :blink: :blink: Then I would surely made some mistake on the setup last time I tried :( ... If I remember correctly, I had to connect the cable after the application crashed (with fw157 installed in the Bios), right? But after setting up the server and connecting via TCP and getting reply I tried some gdb commands which didn't worked...

I will check again .... Thank you for everything...

I'll be back!
 
Last edited by a moderator:
Hello again!

I tested the USB gdb server and everything seems to work ok, commands like "frame" or "backtrace" works ok... but although i loaded the .elf file before starting the debug, gdb always says "no debugging symbols found", i though the -g flag is used to generate the debugging symbols, right? and i am sure i compiled my app NO -On flags... I tested with g++ 4.0.2 and g++ 3.4.4

Am i doing something wrong or I have to work with the assembly code?? :unsure:


This is my crappy makefile:

PRG = DEBUGT

OBJS = obj/test.o obj/gdbstub.o

LIBS = -Llib -lm -lmirkoSDK -lgpstdlib -lgpmem -lgpos -lgpsound
CRT0 = lib/crt0.S
LNKSCRIPT = lib/lnkscript
INCLUDES = -Iinclude
DEFINES = -DGP32 -D_DEBUG

CFLAGS = $(INCLUDES) -g -s -mtune=arm9tdmi -Wall $(DEFINES)
CXXFLAGS = $(CFLAGS)
...
$(PRG).bin: $(PRG).elf
arm-elf-objcopy -O binary obj/$(PRG).elf obj/$(PRG).bin

$(PRG).elf: $(OBJS)
$(CC) -c -g -o obj/crt0.o $(CRT0)
$(LD) -nostartfiles -s -Wall -Wl,-g,-Map,Test.map -T $(LNKSCRIPT) obj/crt0.o -o obj/$(PRG).elf $(OBJS) $(LIBS)



Thanks in advance!!
 
kidchaos2k6 posted on May 18 2006 at 06:30 PM said:
$(LD) -nostartfiles -s -Wall -Wl,-g,-Map,Test.map -T $(LNKSCRIPT) obj/crt0.o -o obj/$(PRG).elf $(OBJS) $(LIBS)

remove the -s and put the -g there instead. -s strips the debug info. The -g may work where it is but the gcc driver will pass it on to the linker without having to specify it as part of the linker command line.

Any particular reason for using the gp32 SDK *and* libmirko?
 
Last edited by a moderator:
Wintermute, many many thanks!!

I wanted to work with the Mirko SDK, but to compile the gdb stub i realized i have to add the gpSDKlibs... I know it is weird but at least it is working :p ... Hope there won't be incompatibilities between the two SDK's...

I still cannot see the program lines just the functions prototypes... and if i engage a "list" command gdb shows me the assembler code of crt0.S but not of any of my functions... For today is enough for me...

Anyway, I appreciatte your help... My intention is to port the clone of the stepmania that is available for the GP2x to my GP32 but i can't get to make things properly working... Anyway i'll keep on it...

Here (in spain) is a bit late... And tomorrow its another hard work day..

Best Regards!!
 
I'm here again!

Is it possible to use c++ templates with devkitarm?

I am using the code for a singleton template (taken from an interesting tutorial from gamedev):
---
template<typename tn> class cSingleton{
static Tiponombre* ms_singleton;

cSingleton(){
int offset = (int)(Tiponombre*)1 - (int)(cSingleton <Tiponombre>*)(Tiponombre*)1;
ms_singleton = (Tiponombre*)((int)this + offset); <---------UPDATE: THIS ASSIGMENT IS PRODUCING THE ERROR
}
}
template <typename tn> tn* cSingleton <tn>::ms_singleton = 0;
---
but when i try to derive a class:

class SMGP : public cSingleton<SMGP>{
...
}

and compile, i got the following linker error

d:\devkitarm\bin\..\lib\gcc\arm-elf\4.1.0\..\..\..\..\arm-elf\bin\ld: error: no
memory region specified for loadable section `.bss._ZN10cSingletonI4SMGPE12ms_si
ngletonE'

I have tried to use a -fimplicit-templates flag but nothing... I realized that it is possible to make a Singleton class ... Maybe the code only was Microsoft compatible and with gcc i have to make another way... I'll check!!

Any addtional ideas?

Regards

@B^)>
 
kidchaos2k6 posted on May 21 2006 at 07:45 PM said:
and compile, i got the following linker error

d:\devkitarm\bin\..\lib\gcc\arm-elf\4.1.0\..\..\..\..\arm-elf\bin\ld: error: no
memory region specified for loadable section `.bss._ZN10cSingletonI4SMGPE12ms_si
ngletonE'

Any addtional ideas?

You're using the gp32_sdk.specs file, right?

in the gp32_sdk.ld file, found in /path/to/devkitARM/arm-elf/lib, add *(.bss*)
to the .bss section after *(COMMON)

Code:
  .bss ALIGN(4) :
  {
   __bss_start = ABSOLUTE(.);
   /* __bss_start__ = ABSOLUTE(.); */
   *(.dynbss)
   *(.gnu.linkonce.b*)
   *(COMMON)
   *(.bss*)
   . = ALIGN(4);	/* REQUIRED. LD is flaky without it. */
  } > ram
  __bss_end = .;
 
Last edited by a moderator:
WinterMute posted on May 22 2006 at 07:13 AM said:
You're using the gp32_sdk.specs file, right?


EEhhemmm, well not at all... For various reasons I'm using a custom environment and i'm mixing files from the mirko SDK and some precompiled libraries (libjpeg,libmad and others...) compiled with software FP . My main concern is to focus on the coding and i'm a bit annoyed with the compiler environment... For example, I have tried some stl classes like std::vector and std::list, which works partially, but the std::iterator doesn't work and the std:algorithm:find() doesn't work either... I'm a bit dissapointed that after following the various tutorials for setting customs environments i always stuck with weirds errors...

Wintermute, I'll try to use the .specs file and I apprecciate your help... Can i find you on the IRC or anywhere to chat for a while some evening??...

Regards!
 
Last edited by a moderator:
Back
Top