Like a lot of people out there, I have a brand new Raspberry Pi 3b on which I would like to try bare metal assembler.
I used the tutorials here:
On Ubuntu, I compiled all 3 examples and transfered the "kernel.img" to the root directory and that are worked as expected.
So I decided to keep the led01 example, keep the frame and replace the code with:
The Makefile remains the same, I changed nothing else.
Code: Select all
.global _start .section .text _start: ldr r0, =0x3f200000 @; GPIO base address for RPi3 mov r1,#001 @; Ouput mode lsl r1,#24 @; 3*8=#24, so we work with the x8th pin str r1,[r0,#0] @; 0*4=#0, so we work on GPIO 0 to 9 (so on GPIO #8) mov r1,#1 lsl r1,#8 @; still on the GPIO #8 str r1,[r0,#0x28] @; and we clear it hang: b hang @; Give the CPU something to do ad infinitum
If I'm right, when you look at the RPi3 from the pins 0 up left to the 40 down right, the 8th GPIO is the second to the left column, so if I connect a voltmeter between the first in the left column (+3.3V) and this one, I should have 3.3V, but it remains 0V!
I tried changing the "str r1,[r0,#0x28]" with "str r1,[r0,#0x1c]" to SET the pin and not CLEAR it, but the result is the same.
Any help would be appreciated
Thanks to all the helpers.