1

This is my first assembly program. I have a FAT32 formatted SD card with latest bootcode.bin, start.elf, and a flat binary named kernel7.img converted from the following dumped ELF file:

build/kernal.elf:     file format elf32-littlearm


Disassembly of section .init:

00008000 <_start>:
    8000:   e59f0044    ldr r0, [pc, #68]   ; 804c <waitOff+0xc>
    8004:   e5901010    ldr r1, [r0, #16]
    8008:   e3a02001    mov r2, #1
    800c:   e1a02a82    lsl r2, r2, #21
    8010:   e5801010    str r1, [r0, #16]
    8014:   e3a01001    mov r1, #1
    8018:   e1a01781    lsl r1, r1, #15
    801c:   e3a02000    mov r2, #0

00008020 <loop>:
    8020:   e5801020    str r1, [r0, #32]
    8024:   e580202c    str r2, [r0, #44]   ; 0x2c
    8028:   e3a03601    mov r3, #1048576    ; 0x100000

0000802c <waitOn>:
    802c:   e2533001    subs    r3, r3, #1
    8030:   1afffffd    bne 802c <waitOn>
    8034:   e580102c    str r1, [r0, #44]   ; 0x2c
    8038:   e5802020    str r2, [r0, #32]
    803c:   e3a03601    mov r3, #1048576    ; 0x100000

00008040 <waitOff>:
    8040:   e2533001    subs    r3, r3, #1
    8044:   1afffffd    bne 8040 <waitOff>
    8048:   eafffff4    b   8020 <loop>
    804c:   3f200000    .word   0x3f200000

The code uses the following addresses:

  • GPIO controller base: 0x3F200000
  • GPFSEL4: 0x3F200010
  • GPSET1: 0x3F200020
  • GPCLR1: 0x3F20002C

As far as I'm aware, the ACT led on the RPi2 is on GPIO pin 47 (where is the official documentation for this?). I can walk through this listing, and it seems to all make sense - I don't understand why nothing is happening (both ACT and PWR remain on)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.