News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Can someone help me get DevkitPRO/ARM to compile a GBA sample?  (Read 720 times)

SleepyFist

  • Hero Member
  • *****
  • Posts: 835
    • View Profile
I'm trying to run the GBA programming tut over at patater.
  • Installed DevkitPro
  • Updated DevkitPro(Initial install missed some files)
  • dropped patater's sample code into an test_1.S file
Code: [Select]
.arm
.text
.global main
main:
mov r0, #0x4000000
mov r1, #0x400
add r1, r1, #3
str r1, [r0]
mov r0, #0x6000000
mov r1, #0xFF
mov r2, #0x9600
loop1:
strh r1, [r0], #2
subs r2, r2, #1
bne loop1
infin:
b infin
  • Command Prompt, Desktop, make test_1.S
  • It tells me no action is required, but doesn't produce anything apparently?

I know 'm doing something wrong but I don't know what, don't really have much experience compiling outside of Visual Studio.
[/list]
Sleepy's tune of the week|| Lost Lullabies (Unreleased Samurai Champloo tracks)|| https://youtu.be/BK6PR8DPNOw

Valendian

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Can someone help me get DevkitPRO/ARM to compile a GBA sample?
« Reply #1 on: April 24, 2019, 02:16:32 pm »
This is what make prints when everything has already been built?


What's your makefile look like? I'm not a make guru, but I know the basics. I can take a look for you.

SleepyFist

  • Hero Member
  • *****
  • Posts: 835
    • View Profile
Re: Can someone help me get DevkitPRO/ARM to compile a GBA sample?
« Reply #2 on: April 24, 2019, 05:17:40 pm »
So uhhh, I don't have a makefile? and I also don't know how to generate one.
Aside from the code above the instructions read

Quote
Make sure your current directory is where your test_1.S file is and type the following:

arm-elf-gcc -mthumb-interwork -specs=gba.specs f.S and hit enter.
arm-elf-objcopy -O binary a.out a.gba and hit enter (not gonna say that again).

If no errors are generated, a "a.gba" file will be, run it. It should make a fairly red(ish) screen. Don't worry about understanding the code right now, this is just to make sure you can compile some code.

The problem is that those particular instructions don't actually do anything, it just reads it as a bad command, possibly because it was written for an older version of DevkitARM, I saw a post somewhere that said I should just use the make command.
Sleepy's tune of the week|| Lost Lullabies (Unreleased Samurai Champloo tracks)|| https://youtu.be/BK6PR8DPNOw

Valendian

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Can someone help me get DevkitPRO/ARM to compile a GBA sample?
« Reply #3 on: April 24, 2019, 05:29:05 pm »
These commands are for a cross compiler. You need to get you development environment set up first.

If you are on Windows you first need to get a Linux machine setup. Best to get virtalbox and install Ubuntu

Once Ubuntu is set up do the following

Code: [Select]
sudo apt update
sudo apt install build-essential
sudo apt install make
sudo apt-get install gcc-arm-linux-gnueabi
sudo apt-get install arm-gcc-none-eabi
Once those are installed you can build for ARM. But you will need to study the reference manual to do anything of interest.

SleepyFist

  • Hero Member
  • *****
  • Posts: 835
    • View Profile
Re: Can someone help me get DevkitPRO/ARM to compile a GBA sample?
« Reply #4 on: April 25, 2019, 08:24:55 am »
Thanks,I'll go do that then, a little annoyed that I couldn't get the current installation working but I'll go with whatever works.
Sleepy's tune of the week|| Lost Lullabies (Unreleased Samurai Champloo tracks)|| https://youtu.be/BK6PR8DPNOw