Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rainbow screen on rpi3 with optee #2783

Closed
dkarnikis opened this issue Jan 31, 2019 · 21 comments
Closed

Rainbow screen on rpi3 with optee #2783

dkarnikis opened this issue Jan 31, 2019 · 21 comments

Comments

@dkarnikis
Copy link

Hello,
I have built successfully optee os for qemu and write some custom TA's without any problems.
My next step was to boot optee into rpi3.
I followed the guide https://github.com/OP-TEE/build/blob/master/docs/rpi3.md, flashed the image to the sd card, booted the rpi but a rainbow screen pop's up.
(usb devices are not getting any power. I have managed to boot other OS).
I am using hdmi ouput (following this guide #1367)
Am i doing something wrong?
Thanks a lot,
Dimitris

@jbech-linaro
Copy link
Contributor

Hi,

Feels like I'm repeating in each and every ticket about RPi3 but anyways ...

  1. We're updating the documentation. A snapshot of the work in progress can be found here for RPi3: https://optee.readthedocs.io/building/devices/rpi3.html. Even though not fully ready, please use those for general RPi3 information as well as for standard setup with SD-card (NFS, JTAG has not been verified yet on the new updated instructions). There are many clarifications on that page about what is supposed to work and what's not, what version of RPi hardware and what not etc. ETA for updated instructions are ~April 2019.

  2. Today 2019-01-31 I've created a video clip while I was verifying the instructions. I.e., a full setup from scratch, you will find that here (I'm going add narrative audio later on to describe more what's going on):
    OP TEE on Raspberry Pi 3 with SD card

Since I did "2" today and it is from scratch, it should be fairly easy to follow along if you use the upcoming documentation + look at (and pause) the video.

// Joakim

@dkarnikis
Copy link
Author

Hello again,
thanks for the video and for the guide.
I have found that my rpi3 flashes the red light 4 times which means that start.elf is corrupted.
I replaced it with an other start.elf (just to check the flash sequence) and the flash sequence was different(still no output on UART).
Do you know what would be the case? Could you provide me with your stalf.elf or your whole /boot directory?

@msa2
Copy link

msa2 commented Feb 1, 2019

1. We're updating the documentation. A snapshot of the work in progress can be found here for RPi3: https://optee.readthedocs.io/building/devices/rpi3.html.

Few minor comments on u-boot environment

  • the document says "serverip", but it might be goot if the default environment also used it (last version I checked, used "nfsserverip=192.168.1.5"). Verify that name and default address match document?

  • default "nsfpath=/opt/linaro/nfs" should match document "nsfpath=/srv/nfs/rpi"

  • set_bootargs_nfs has ".. ip=dchp" at end. To match document, it should probably be "ip=192.168.1.200"

  • if you leave dhcp, you may get address and network that cannot reach the NFS server on 192.168.1.0/24 (and NFS boot fails).

@jbech-linaro
Copy link
Contributor

  1. We're updating the documentation. A snapshot of the work in progress can be found here for RPi3: https://optee.readthedocs.io/building/devices/rpi3.html.

Few minor comments on u-boot environment

That has not been changed/updated/covered yet and that's what I tried to indicate with the comment "( NFS, JTAG has not been verified yet on the new updated instructions)"in my comment. My intention is to spend some time with that today. Anyhow, thanks for the additional feedback, I'll have that in mind/use this when doing the updates. Thanks!

@jbech-linaro
Copy link
Contributor

@msa2 , I've looked into this as mentioned earlier today and I think I'm with you on the two first bullets, but the ones about dhcp I'm a bit more skeptical to. To replace dhcp with the IP of the PI, then you need to figure out that on your own. It's not really hard and will stay the same for the lease time of your router. But, it's a bit inconvenient I think if dchp can do it for you. Your last bullet about "get address and network that cannot reach the NFS server". Is that likely to happen? To me it feels like for that to happen you have misconfigured you router, /etc/exports etc. I.e., I'm in favor of keeping ip=dhcp. What do you say?

@msa2
Copy link

msa2 commented Feb 1, 2019

@msa2 , I've looked into this as mentioned earlier today and I think I'm with you on the two first bullets, but the ones about dhcp I'm a bit more skeptical to.

It was just my experience on our internal network, say

  • you configure your nfs server as 192.168.1.100

  • and boot rpi3 with dchp and your corporate network DHCP gives rpi3 address 10.2.2.123/24, and some default router 10.2.2.1

  • when rpi3 tries to connect to your nfs server on 192.168.1.100, there is no route and it's forwarded by default route to 10.2.2.1. That router most likely will have no clue where your 192.168.1.100 is located... (this is basicly what happens to me if I leave dchp on), and rejects the packet

  • dhcp is perfectly ok and preferrable, if you don't use nfs boot.

@jbech-linaro
Copy link
Contributor

  • you configure your nfs server as 192.168.1.100
    ...
  • when rpi3 tries to connect to your nfs server on 192.168.1.100,

That's not really a surprise, shouldn't the NFS server have a 10.2.2... IP and also said in its exports file tell that the share is located at its own IP, i.e., also a 10.2.2.x in that case? Maybe I'm a bit into deep water here, I'm no network guru.

@jforissier
Copy link
Contributor

jforissier commented Feb 1, 2019

@msa2 why would the NFS server not have an address in the 10.2.2.0/24 network?

Anyway, not sure it can help, but I found PyPXE to be a very useful tool when you have to deal with a local test environment including DHCP/TFTP/NFS and you are already on a network with a DHCP server. It can act as a DHCP proxy.

https://github.com/psychomario/PyPXE

@msa2
Copy link

msa2 commented Feb 1, 2019

@msa2 why would the NFS server not have an address in the 10.2.2.0/24 network?

Because in my case the NFS server is my laptop sitting on same desk and rpi3. If "NFS" server gets address from 10.2.2.0/24 dia DHCP, it can get different addresses on different boots, and then I would again need to edit the uboot.env...

My setup is simply

192.168.1.200 rpi3 ----|
                       |bridge ----- internal net --- internet
192.168.1.1.100 laptop-|
+ internal DHCP address

e.g. laptop has two addresses (if do ifconfig eth0:1 192.168.1.100). This way boot.env is stable, regardless of my internal address on corporate net.

However, no big deal. I guess anyone setting up NFS server, is capable of figuring out best option for himself.

@dkarnikis
Copy link
Author

well,
I have solved my issue, the start* files were the problem(was working on rpi3b+) and the dtb.
I am having hdmi support aswell. TEE is working as expected. Might upload my solution and a guide for rpi3b+ with hdmi support(no uart needed) as soon as I find some time.
Cheers

@jforissier
Copy link
Contributor

@dkarnikis glad it's working for you.

Might upload my solution and a guide for rpi3b+ with hdmi support(no uart needed)

Would be awesome.

@Hacklog24
Copy link

@dkarnikis

Hello,
I also have a problem when I turn on the raspberry pi 3b + with OP-TEE. The red LED flashes but nothing happens on the terminal. I'm using a UART cable. Could you help me? Maybe your solution could be useful also for me.

Thank you so much.

@dkarnikis
Copy link
Author

@Hacklog24
Hello, i will try to upload my guide in the upcoming days. Still have to clean it up and verify the steps.
Cheers

@Hacklog24
Copy link

@dkarnikis
Thanks a lot for the answer. When it's ready, can you notify me?

Thank you so much,
Cheers

@dkarnikis
Copy link
Author

i will ping you first, don't worry(have a couple stuff do to)

@Hacklog24
Copy link

@dkarnikis
Of course!
Thank you again, I'll wait.

@jbech-linaro
Copy link
Contributor

@dkarnikis Hello, i will try to upload my guide in the upcoming days. Still have to clean it up and verify the steps.

That would be great so we ones and for all can sort you RPi3 Model B+ questions/issues. Thanks!

@dkarnikis
Copy link
Author

@Hacklog24
hello,
I have uploaded a rushed 'guide' that you can find here https://github.com/dkarnikis/rpi3bplus-optee
It is still quite ugly, I am not very good with this part.
Feel free to contact me :)

@Hacklog24
Copy link

@dkarnikis
Hi and thank you very much for the timely help!

The guide is fantastic, clearly explained and if the previous steps are correct, it will work great. Congratulations and well done! Tested with both UART and HDMI cables.

Cheers

@jbech-linaro
Copy link
Contributor

I have uploaded a rushed 'guide' that you can find here https://github.com/dkarnikis/rpi3bplus-optee

@dkarnikis , thanks! I'll update our official docs in the future in one or another way to reflect this (I should probably buy a 3b+ myself at some point).

@johnphilby
Copy link

I have uploaded a rushed 'guide' that you can find here https://github.com/dkarnikis/rpi3bplus-optee

@dkarnikis Your boot files for RPi3 b+ works, thanks. But it isn't clear from your instructions the files that you replaced to get it to boot. Your instructions say "so I swapped some files from the latest ubuntu core ..." -- could you provide the details of the exact files you swapped and the original location from where it was copied from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants