Hallo,
bei dem folgenden Assembler Code (Ansteuerung von GPIO21) erhalte ich bei der Ausführung "./LED_GPIO21" die Meldung "Speicherzgriffsfehler".
Code
@ LED_GPIO.s
.global main
main:
@ Base adress for gpio controller Raspi Pi 2 Model B
ldr r0,=0x3F200000
@ Store a "0x01" to enable the output
mov r1,#1
@ Shift the "0x01" 3 places to acces gpio 21 (Bit 3)
lsl r1,#3
@ Copy the value to the register r0 + 8 (GPFSEL2)
str r1,[r0,#8]
@ Store a "0x01" to turn the led on
mov r1,#1
lsl r1,#21
str r1,[r0,#28]
loop$:
b loop$
Alles anzeigen
Kompiliert habe ich den Code:
Kann mir da jemand etwas zu sagen ?
MfG
Juergen B.