Thanks for all the info. I'm not to sure if my .elf is linked correctly as I've been piecing things together for many different sources on the internet as I haven't been able to find much information. Are you able to point me to where you found all the information above?
In case it helps, here is the source and linker file I am using
- source file
.section .init
.globl _start
_start:
// Write to HW_PINCTRL_CTRL for standard GPIO pin operation
ldr r0,=0x80018000 // HW_PINCTRL_CTRL addr
mov r1,#0 // 0x00000000 standard GPIO operation
str r1,[r0] // store the value of r1 into the addr in r0
// Write to HW_PINCTRL_DOUT2, to set Pin1 to high (0x00000002)
ldr r0,=0x80018520 // HW_PINCTRL_DOUT2 add
mov r1,#2 // 0x00000002 Pin1 High (Pin0 first pin)
str r1,[r0] // store the value of r1 into the addr in r0
// Write to HW_PINCTRL_DOE2, to finally enable output on Pin1 (0x00000002)
// Correct value already in r1, no need to reassign into
ldr r0,=0x80018720 // HW_PINCTRL_DOE1 addr
str r1,[r0] // store the value of r1 into the addr in r0
// DO NOTHING (LOOP)
loop$: // convention: $ for label if code not relevant to other sections
b loop$ // branch to label loop$
- linker script
SECTIONS {
.init 0x0000 : {
*(.init)
}
.text 0x8000 : {
*(.text)
}
.data : {
*(.data)
}
/DISCARD/ : {
*(*)
}
}
I have a feeling the linker script is wrong, but I have no way of knowing.
Cheers.