Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Including other .s files

Status
Not open for further replies.

vcrewchief

Programmer
Sep 8, 2013
1
US
Hello all,

I'm having trouble getting my hand-typed arm assembly to actually work. my code compiles, but the .global functions don't actually work.
Here's the .s that I included:

/*gpio.s*/

.globl GetGpioAddress
GetGpioAddress:
ldr r0,=0x20200000
mov pc,lr

-------------------------------------------

The main file that is supposed to call gpio.s:

.section .init
.globl _start
_start:
.INCLUDE "gpio.s"

b main

.section .text

main:

mov sp,#0x8000

bl GetGpioAddress

/*the function never gets the address
----------------------------------------
I'm using yagarto inside the windows cmd to assemble, and here are the commands I used:

C:\yagarto-20121222\bin\arm-none-eabi-as -I source\ source\main.s -o build\main.o
C:\yagarto-20121222\bin\arm-none-eabi-ld --no-undefined build/main.o -Map kernel.map -o build/output.elf -T kernel.ld
C:\yagarto-20121222\bin\arm-none-eabi-objcopy build/output.elf -O binary kernel.img
C:\yagarto-20121222\bin\arm-none-eabi-objdump -d build/output.elf > kernel.list

let me know if you need anything else, and thank you ahead of time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top