-
Notifications
You must be signed in to change notification settings - Fork 176
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
I cannot boot linux. [LITEX-TERM] Got unexpected response from device 'b'E'' #354
Comments
I attempted to use the SD card containing the above files to boot sdcardboot, but it stopped as follows. Dtb file is not read.
|
I have identified that the processing is halted at the following line in ff.c within the Litex output:
|
Hi @nohahanon The short answer: It's need to create a customized project for small memory boards. TL;DRI've found that the build system generated an incorrect device tree and system configuration. The board has only 8 MB of SDRAM, as shown during self-diagnosis, but the addresses generated in the device tree and the base address for opensbi are incorrect and lie beyond the 8 MB limit. The address 0x40f00000 corresponds to 15 MB. You can try to read addresses 0x4000000 and 0x40f00000 via mem_read and got different results for a first and a second address (second is incorrect address for the device).make.pypart of device tree generated by make.py
boot.json
A tang nano 20k linux examplepart of device tree from project contains right adresses in memory below 8 MB limit
boot.json
The problem is in a litex/soc/cores/cpu/vexriscv_smp/core.py
My suggestions:
|
Hello @avkghost ! And, I found a successful example of running Linux on the Tang Primer board. It seems that reducing the size of the Linux image is essential, so I will continue my research. |
I'm currently trying to modify the BusyBox configuration to see if I can create a smaller Linux image. I've outlined the specific steps below. It seems like I can create a smaller image by removing unnecessary commands, but I'm struggling to get it below 7.7MB. If anyone has any suggestions, I would appreciate it.
|
Enabline RVC compressed instruction may help reaching it (need to be enable on both litex arguments and linux / busybody. |
Hello,bro @nohahanon , I have also encountered such a problem. Has your problem been resolved so far? |
Hello @Dolu1990 , I would like to ask if you have any good solutions for processing halted at the liftoff stage.I am looking forward to your reply .Thanks. |
Hello, bro @peiceliu ,
like thisbefore
after
|
Thanks for your advice @nohahanon,after i change y to n,i still can not boot linux successfully. Should i change other files?Such as [litex/soc/cores/cpu/vexriscv_smp/core.py]. If you could give me appropriate advice to make linux to boot successfully on my fpga board, I would be very grateful.I am looking forward to your reply,bro. |
Hello @nohahanon, I've seen the link you provided, thanks!
As I investigated the readme from TangNano-20K-example I've found that the Linux kernel, device tree, and boot loader provided by Icenowy. So, I'm going to create a debug version of a VexRiscv to debug the booting process. First of all, it would help me to understand a configuration difference between my own and @Icenowy 's. Update: |
Thanks @avkghost !! |
@avkghost The LiteX port is by me, but booting Linux is done by another person, Jisheng Zhang . |
Hi @Icenowy. Thanks for joining our discussion. litex-boards
It produces csr.csv
make.py from linux-on-litex-vexriscv
produces following csr.csv
Could you please answer a few questions? See below.
Thanks for the advice. |
I would say running it in a simulation would give full visibility on what the CPU does, that's the way in generaly always go. Else there is the possibility to use the JTAG debug, and since recently you can even use the official RISC-V debug spec, which support linux kernel debugging aswell :) |
Update: @nohahanon FYI I've successfully run linux on a Tang Nano 20k with the kernel provided in a TangNano-20K-example repository. I use the linux-on-litex-vexriscv with following parameters/flags:
There is a boot log
At the moment I'm going to experiment with a Linux kernel (reduce size and remove unneeded modules/subsystems). @Icenowy Could Jisheng Zhang help us with a kernel configuration for the board? |
Hello @avkghost , I tried the suggestions you provided but I was not able to successfully boot Linux on my sipeed_tang_primer_20k . Here is my log.Could you please provide me with more details about the issue?
|
Hello @peiceliu, Unfortunately, now I do not have the ability to test Tang Primer build. The power went out while I was flashing the board. It is currently not possible to write anything to FPGA memory or software SPI flash. |
Hello @avkghost ,After the second command,I can not boot litex console.In addition,after the first command,my serial tool displayed messy code instead of boot log . |
@peiceliu There is a step-by-step solution that I used for my own board, please take a look below.
There is my boot log
|
Thanks bro @avkghost,now i boot linux on my fpga board successfully. |
@avkghost
Booting from SDCard in SD-Mode... --============= Liftoff! ===============--` |
@nohahanon All addresses below the memory limit are included in the original example. Please pay attention to the addresses provided below. {
"Image": "0x40000000",
"sipeed_tang_nano_20k.dtb": "0x40780000",
"opensbi.bin.tangnano20k": "0x407c0000"
} So, I also booted Tang Nano 20k from SDCard. A boot log from SDCard
To reduce the memory footprint for the kernel try to use |
@nohahanon Small update
I had not used any additional scripts or ran make from buildroot. I've created a test build aiming to minimize the kernel. {
"Image": "0x40000000",
"sipeed_tang_nano_20k.dtb": "0x40780000",
"opensbi.bin.tangnano20k": "0x407c0000"
} Boot log
@Dolu1990 Could I ask you for help with kernel debugging? Maybe I removed something important from the kernel configuration or did something wrong. |
Big thanks, bro, |
@nohahanon
boot.json{
"Image": "0x40000000",
"root.cpio": "0x406ef000",
"sipeed_tang_nano_20k.dtb": "0x40780000",
"opensbi.bin.tangnano20k": "0x407c0000"
} device tree
boot log
|
Thank you for your reply. I edited
In conclusion, I failed to boot linux using the following file. It stopped in the middle of the opensbi process. Regards. linux.config
size of each file
boot.json
devise tree
boot log
|
linux.configAn
Yes, it disables SMP. Disable networking
So close, but mine is 2993104 bytes. root.cpio
I used binwalk to extrat root.cpio from the example's kernel. offtopicI had not used buildroot for some reasons:
|
@avkghost Currently, I believe the only difference between your setup and mine is the Image. Could you please share how you created that Image? By the way, I encountered the same error with the provided Buildroot recipe, but when I extracted the tar.gz available on buildroot.org and did the make process, I was able to obtain the Image without any errors. So, I am using the Image created using this method. I'm sorry for taking up your time. Thank you. report
boot.json
.dts
boot log
boot log
|
@nohahanon Boot log
|
@avkghost You mentioned that you haven't created an image with Buildroot, but how did you create it? I'd like to create an image similar to what you're using. Looking forward to your reply. Thanks. |
@nohahanon I prefer to use separate kernel configurations to minimize its footprint. I cloned the litex-linux repo and checked out 6.1.0 branch, and used the config provided above to build the kernel image. To cross-compile build the kernel I used the following command. Below, is a device tree I've used |
@nohahanon The SD card needs to be partitioned into 2 or 3 partitions.
A command line from the device tree sets mmcblk0p2 as the root partition.
The kernel provided in the Tang Nano example did not have drivers for MMC, block devices, partition schemes, and file systems. It is impossible to mount any filesystem under the example's kernel. It is built as an experiment to show the possibility of running Linux on the board. Now, I have no idea where I can use this configuration. In other words, I don't see any practical use for this configuration in my projects. In my opinion, there is the best way to use this board with bare metal OS, like FreeRTOS, etc, because in this case, Linux is an overhead for the board. If you need to build and run your own program on a device I recommend you start with litex_bare_metal_demo
Hope you find it helpful. |
Big thanks, bro, I was able to successfully boot Linux using the provided image, but it seems that I still couldn't mount the SD card. While my initial goal was to run a program on Linux, I'm glad that I was able to run programs like Donut and Helloc on VexRiscv with |
Hi there!
I'm trying to boot with a Linux image created locally on a tang nano 20k, but I'm encountering an error that says "[LITEX-TERM] Got unexpected response from device 'b'E'" and the log stops without booting. I have attached the detailed log below.
Please provide any answer. Thank you!
The text was updated successfully, but these errors were encountered: