Hello,
I'm trying to adapt my baremetal progs to RPI3.
- I build a SD card with Jessie of 26/02. The card boot Jessie correctly.
- I replace kernel.img and kernel7.img with a small prog to flash red and green leds.
- I try that SD on a RPI2 and it is working well.
- When I try that SD on RPI3, I have only a green flash then nothing more
Any idea ?
Has someone a small prog runing on RPI 3 ?
Thanks for your answers
Philippe
Re: RPI3 baremetal
On the Pi3B the red & green LEDs are no longer connected to bcm GPIOs; instead they are driven from an i2c GPIO expander: U20 located near the DSI connector.
I suggest you toggle GPIOs on the 40-pin header instead as a hello world example for your bare metal code.
That initial flash is likely from start.elf showing that it is loading your custom kernel7.img.
I suggest you toggle GPIOs on the 40-pin header instead as a hello world example for your bare metal code.
That initial flash is likely from start.elf showing that it is loading your custom kernel7.img.
Re: RPI3 baremetal
Many thanks for that information.
Do you know where I can found the differences between RPI 3 and RPI 2 ?
Philippe
Do you know where I can found the differences between RPI 3 and RPI 2 ?
Philippe
Re: RPI3 baremetal
Example of driving the Act LED can found here https://github.com/vanvught/rpidmx512/b ... pio_virt.cgregeric wrote:On the Pi3B the red & green LEDs are no longer connected to bcm GPIOs; instead they are driven from an i2c GPIO expander: U20 located near the DSI connector..
Change with respect to PL011 and RPi 3 -> viewtopic.php?p=927917#p927917
Arjan
http://www.raspberrypi-dmx.com/
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
Re: RPI3 baremetal
Thanks for your links, I want to
analyse them ...
Philippe
analyse them ...
Philippe
Re: RPI3 baremetal
are you saying that we cannot get to the i2c expander from gpio pins? only thruogh the gpu?
Re: RPI3 baremetal
my bootloader07 example works fine on the pi3 (just got mine today), in the default 32 bit mode (you asked about simple bare metal programs). Going to mess with 64 bit here soon. Once info on the expander (part number if available. are there schematics?) can provide an led blinker...
David
David
Re: RPI3 baremetal
https://github.com/dwelch67/raspberrypi ... er/aarch64
I have some 64 bit examples working, a simple bootloader and an example that uses the uart. If you dont use a config.txt then it boots into 32 bit mode (as of this writing)(32 bit compatibility mode basically) and you treat it basically like a raspberry pi 2 for bare metal except for the LED(s).
David
I have some 64 bit examples working, a simple bootloader and an example that uses the uart. If you dont use a config.txt then it boots into 32 bit mode (as of this writing)(32 bit compatibility mode basically) and you treat it basically like a raspberry pi 2 for bare metal except for the LED(s).
David
Re: RPI3 baremetal
i2c addresss is reported as 0x43 (0x86/7 inc R/W bit) here: viewtopic.php?f=44&t=138897&p=923243#p922961.dwelch67 wrote:Once info on the expander (part number if available. are there schematics?) can provide an led blinker...
David
Haven't been able to pin it down to a part number matching that address, but the XQFN16 package limits it to an 8-bit GPIO expander, something like PCA6408 or PCA9534.
Re: RPI3 baremetal
I am saying that I have a working example controlling the ACT Led using the mailbox.dwelch67 wrote:are you saying that we cannot get to the i2c expander from gpio pins? only thruogh the gpu?
I have no idea if we can address the I/O expander directly. I assume not, otherwise we should not have this mailbox property.
- Arjan
http://www.raspberrypi-dmx.com/
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
Re: RPI3 baremetal
the pi 3 at least 64 bit comes up with gpio 0/1 28/29 44/45 all set as inputs, not set to i2c so they are in theory not orred together.
I didnt find anything on gpio 0/1 28/29 everything acks so that is no good. 44/45 also everything hits so nothing there either. Will have to examine the code again and/or put it on a scope.
I didnt find anything on gpio 0/1 28/29 everything acks so that is no good. 44/45 also everything hits so nothing there either. Will have to examine the code again and/or put it on a scope.
Re: RPI3 baremetal
Hello,
I have simplified and adapted software of Vanvught to blink ACT led of PI3
Thanks to Arjan for the reference
Philippe
I have simplified and adapted software of Vanvught to blink ACT led of PI3
Thanks to Arjan for the reference
Philippe
Code: Select all
org $8000
main:
mov sp, #0x8000
bl LedInit
Boucle:
bl LedOn
mov r0, #500
bl Delay
bl LedOff
mov r0, #500
bl Delay
b Boucle
align 16
Request:
dw 0x1c
dw 0
dw 0x00040010
dw 4
dw 0
dw 0
dw 0
pLed: dw 0
pBal: dw 0x3f00b880
pHtr: dw 0x3f003004
LedInit:
push {r0, r1, lr}
ldr r1, [pBal]
LedInit1:
ldr r0, [r1, #0x18]
ands r0, #0x80000000
bne LedInit1
adr r0, Request + 8
str r0, [r1, #0x20]
LedInit2:
ldr r0, [r1, #0x18]
ands r0, #0x40000000
bne LedInit2
ldr r0, [Request + 0x14]
bic r0, #0xc0000000
str r0, [pLed]
pop {r0, r1, pc}
LedOn:
push {r0, r1, lr}
ldr r1, [pLed]
ldr r0, [r1]
add r0, #0x00010000
str r0, [r1]
pop {r0, r1, pc}
LedOff:
push {r0, r1, lr}
ldr r1, [pLed]
ldr r0, [r1]
add r0, #0x00000001
str r0, [r1]
pop {r0, r1, pc}
Delay:
; r0 = mS
push {r0, r1, r2, lr}
mov r1, #1000
mul r0, r1
ldr r1, [pHtr]
ldr r2, [r1]
Delay1:
ldr r3, [r1]
sub r3, r2
cmp r3, r0
blo Delay1
pop {r0, r1, r2, pc}
Re: RPI3 baremetal
Scratching my head with Pi3 B.
I have a number of baremetal samples that work on a Pi2, PiZero (and even recompiled on a Pi 1) but won't come up on a Pi3 B.
I put Jessie on my SD card and it worked. I just deleted all the folders and put my kernel.img file on but the Pi3 just puts up the faithful multicoloured screen and sits there.
I tried directly hitting the mailboxes and screen straight after boot with a tight code sequence and even that doesn't seem to get called. So it would appear for whatever reason it doesn't see kernel.img as valid and refuses to load it.
I thought code for a PI2 should run on a Pi3 but looks like I was wrong. Anyone have a clue whats going on with it?
I have a number of baremetal samples that work on a Pi2, PiZero (and even recompiled on a Pi 1) but won't come up on a Pi3 B.
I put Jessie on my SD card and it worked. I just deleted all the folders and put my kernel.img file on but the Pi3 just puts up the faithful multicoloured screen and sits there.
I tried directly hitting the mailboxes and screen straight after boot with a tight code sequence and even that doesn't seem to get called. So it would appear for whatever reason it doesn't see kernel.img as valid and refuses to load it.
I thought code for a PI2 should run on a Pi3 but looks like I was wrong. Anyone have a clue whats going on with it?
- DougieLawson
- Posts: 42177
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: RPI3 baremetal
You'll need to lift a copy of the latest /boot stuff from https://github.com/Hexxeh/rpi-firmware to get the RPi3B videocore running.LdB wrote: I thought code for a PI2 should run on a Pi3 but looks like I was wrong. Anyone have a clue whats going on with it?
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.