Giter VIP home page Giter VIP logo

Comments (13)

vikash876 avatar vikash876 commented on May 12, 2024 5

Pheww... Working now!! :) So here are all the modifications you would need for this:

PBASE has to be modified to 0xFE000000 : #define PBASE 0xFE000000
config.txt needs to have just one line: arm_64bit=1

Thanks to s-matyukevich and following thread https://www.raspberrypi.org/forums/viewtopic.php?t=244479&p=1491494

PS: I just bought RPI4 to follow this entire tutorial and overcome the hurdles faced on the way. Earlier I have explored the linux kernel books which emphasize more on the X86 architecture and was looking for some books on the Arm Linux since in coming days Arm is going to be a next Desktop platform and also since I work in embedded field where Linux on Arm rules :). Kudos to s-matyukevich to make this nice tutorial and this is the one stop Linux on Arm material I need. My hunt for a book has stoped :))

from raspberry-pi-os.

jyotimahapatra avatar jyotimahapatra commented on May 12, 2024 2

vikash876@b430423 was pretty much everything i needed to make it work. Thanks a lot!

from raspberry-pi-os.

vikash876 avatar vikash876 commented on May 12, 2024 1

Hi rockytriton,

Here is my forked version which works with rapsberry pi-4 : [email protected]:vikash876/raspberry-pi-os.git

Steps to build:

  1. git clone [email protected]:vikash876/raspberry-pi-os.git
  2. build the lesson01
  3. copy config.txt from lesson01/src/ and overwrite on your sd card
  4. delete kernel7.img from your sd and copy kernel8.img to your sd card.

Also I have your answers here:
rockytriton: so you were able to get the UART working?
ans: Yes, I am using USB to TTL cable made by adafriut(https://www.adafruit.com/product/954).Any similar cable should work. I can see the print "Hello, world!"
rockytriton: Can you post the contents of your config.txt?
ans: please check https://github.com/vikash876/raspberry-pi-os/blob/master/src/lesson01/src/config.txt
rockytriton: Also did you have to download the 2711 dtb file and fixup4.dat and start4.elf?
ans: I did following:

  1. Flash the sd card with raspbian (either lite or full)
  2. delete the kernel7.img
  3. copy and replace the config.txt from my forked version lesson1/src/config.txt (as above link)
  4. copy the kernel8.img
  5. Boot the raspberry pi-4 with modified sd card and and set serial baud rate to 115200 in console.
  6. Observe "Hello, world!" on screen :))

Changes from s-matyukevich version

  1. Changed config.txt
  2. Changed Base address (to: 0xFE000000)
  3. Set the new baudrate (to: 541. since new GPU clock rate is 500MHZ, replaced this value in the formula)

hope this helps.

from raspberry-pi-os.

danieltomch17 avatar danieltomch17 commented on May 12, 2024 1

Changes from s-matyukevich version

  1. Changed config.txt
  2. Changed Base address (to: 0xFE000000)
  3. Set the new baudrate (to: 541. since new GPU clock rate is 500MHZ, replaced this value in the formula)

I have done all the above. The “Hello World” is printed just as expected, but the the kernel_main gets into a loop where it reads from the uart and prints back whatever is read - but in my case it prints gibberish. Any ideas on how to fix that problem?

image

from raspberry-pi-os.

s-matyukevich avatar s-matyukevich commented on May 12, 2024

Short answer: No, we have to update the code to make it work on the RPi 4b.

Long answer:
Looks like BCM2711B0 has different peripheral Base address (0xFE000000) link this means that at least this line has to be updated. Based on what I saw in the bcm2711-rpi-4-b.dts looks like mini UART, interrupt controller and timer should work. MMU should also work fine as well. So hopefully base address should be the only change we have to make.

from raspberry-pi-os.

ZzzGin avatar ZzzGin commented on May 12, 2024

@s-matyukevich thanks for replying.
I will use a 3 gen for this tutorial. And I will try it on the new pi when I get a 4th gen, since it is out of stock on its official website.

from raspberry-pi-os.

rockytriton avatar rockytriton commented on May 12, 2024

Hey, so you were able to get the UART working? I tried the same things with my pi 4 and no luck. Can you post the contents of your config.txt? Also did you have to download the 2711 dtb file and fixup4.dat and start4.elf?

from raspberry-pi-os.

rockytriton avatar rockytriton commented on May 12, 2024

Thanks for all the details. I was pretty much doing the exact same things, except the 541 change. However I figured out what my issue really was... With the pi3 I would always use the serial cable's red cable to power the pi, so I didn't have to have its power source plugged in too. It seems that with the pi4 maybe that's not enough power to boot it. I put a usb cable into the pi4 to boot it and it's now working finally.

from raspberry-pi-os.

vikash876 avatar vikash876 commented on May 12, 2024

Glad to hear. Yes I always tried with usb c powered. A 3amp power input is must I suppose.

from raspberry-pi-os.

AlexGatz avatar AlexGatz commented on May 12, 2024

Thank you! Somehow I looked over this. I had just realized I was looking at the datasheet from the bcm2835 instead of the bcm2711.

from raspberry-pi-os.

AlexGatz avatar AlexGatz commented on May 12, 2024

Hello, wo0>���p>0 is my output lol

and an odd error from dmesg:
[drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=467527 end=467528) time 1289 us, min 1062, max 1079, scanline start 896, end 1122

from raspberry-pi-os.

bcoppens avatar bcoppens commented on May 12, 2024

I have done all the above. The “Hello World” is printed just as expected, but the the kernel_main gets into a loop where it reads from the uart and prints back whatever is read - but in my case it prints gibberish. Any ideas on how to fix that problem?

You can fix this by adding enable_uart=1 to your config.txt. I presume that otherwise the VPU dynamically scales down the core frequency after booting, so that the clock is only correct while printing the first couple of characters before it scales itself down; and that the enable_uart=1 prevents this. (This is not 100% clear from the documentation that this would be so on the Pi 4B; I've submitted an issue on the Raspberry Documentation page about this: raspberrypi/documentation#1614).

It's also not clear why some people (such as myself) need the enable_uart=1 to get things working, and others don't... (Maybe a different firmware version?)

from raspberry-pi-os.

AbramQuerashi avatar AbramQuerashi commented on May 12, 2024

Hi All,

From all the above comments it looks like I can purchase a RPi4 4GB memory board and this project is build able and can run on RPi4 ?

-abram

from raspberry-pi-os.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.