Comments (13)
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.
vikash876@b430423 was pretty much everything i needed to make it work. Thanks a lot!
from raspberry-pi-os.
Hi rockytriton,
Here is my forked version which works with rapsberry pi-4 : [email protected]:vikash876/raspberry-pi-os.git
Steps to build:
- git clone [email protected]:vikash876/raspberry-pi-os.git
- build the lesson01
- copy config.txt from lesson01/src/ and overwrite on your sd card
- 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:
- Flash the sd card with raspbian (either lite or full)
- delete the kernel7.img
- copy and replace the config.txt from my forked version lesson1/src/config.txt (as above link)
- copy the kernel8.img
- Boot the raspberry pi-4 with modified sd card and and set serial baud rate to 115200 in console.
- Observe "Hello, world!" on screen :))
Changes from s-matyukevich version
- Changed config.txt
- Changed Base address (to: 0xFE000000)
- 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.
Changes from s-matyukevich version
- Changed config.txt
- Changed Base address (to: 0xFE000000)
- 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?
from raspberry-pi-os.
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.
@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.
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.
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.
Glad to hear. Yes I always tried with usb c powered. A 3amp power input is must I suppose.
from raspberry-pi-os.
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.
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.
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.
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)
- [Lesson03] RPi 4 Interrupt not working HOT 5
- [Lesson05] RPi 4 system call not working HOT 3
- Connecting from Ubuntu to Raspberry Pi using USB to TTL, following linked guide just results in black bash windows on Ubuntu.
- [Lesson 1.4] Typo in `raspberry-pi-os/docs/lesson01/linux/kernel-startup.md` "childern" > "children" HOT 1
- Can i debug the raspberry pi os on the qemu and gdb? if it does, please tell me how to use it, thanks! HOT 2
- Has anyone gotten the MMU code to work on raspberry pi 4?
- Okay
- I connected waveshare screen to raspberry pi zero w and there’s no option to rotate screen to right or left. What to do?
- [lesson5] after sys_write syscall exe, el0_sync happen
- lesson 01 set alt5 for gpio 14/15 HOT 4
- why not used c in utils.S HOT 1
- Exercice 1.1
- [exercises lesson06] after switch to user_process , it cannot response svc call HOT 1
- [Lesson04] Raspberry Pi 4 interrupts not working after first call to timer_tick() HOT 1
- How to find FUARTCLK in BCM2837 document HOT 1
- Filesyitem and drivers
- Possible missing of GPPUD control signal removal HOT 1
- Printf Long Support - issue in uli2a
- how does memzero works?
- PMU is periodically disabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raspberry-pi-os.