Boot failing mipi_09p: disabling with sdcard.img built from Starfive GitHub

Enter user name and password,then you can login
root
starfive

1 Like

@kira I signed in through the TTY interface and took a quick look around. Things look reasonable.

It looks like that in order to have the graphical interface that I normally expect, I need to change the run level in the file /etc/init from what is currently 3 to 5?

What I’d like to see is a normal graphical desktop that appears on the display plugged into the HDMI port of the VisionFive 2 and that I can use with a mouse and keyboard plugged into the USB ports of the VisionFive 2. This graphical desktop would present a login prompt and I could then launch programs such as Gimp and use them without using the TTY interface through a second terminal.

I’m looking at this document, Introduction to Linux → 4.2. Boot process, Init and shutdown.

The first thing that I have done is to enlarge the partition using the TTY CLI from the small size of the image, some 500 MB, to the size of the 32 GB microSD card that I’m using, 31000 MB.

I used the parted command to increase the partition size of partition 4 and then used the resize2fs command to extend the file space into the new area of partition 4.

So correct me if I’m wrong, but I should be able to change the run level in /etc/inittab from 3 to 5 and then reboot and I should have a standard graphical desktop?

Do I need to add the user user account or does it already exist?

Are there any other actions I need to do before changing the run level? Perhaps additional packages to install using apt?

Thank you and everyone else for your assistance.

1.will it show a graphical desktop, if you use the image of debian 202310?
StarFiveTech
2. i don`t konw, what image you have build? if you want some guide, this link may help you?
Building StarFive Debian image | RVspace

3 Likes

HDMI and GPU drivers are currently not mainlined…perhaps that image is built without them?

1 Like

Yes, my VisionFive 2 does boot up with a graphical desktop when I use the Debian 202310 image. The desktop appears on the HDMI display plugged into the board and the mouse and keyboard plugged into the board’s USB ports work. I can sign in with the account of user and can use the applications such as Gimp and FireFox.

I’ll take a look at the Building document you provided a link to. Thank you for that.

@Nightwulf I’m fairly sure the GPU drivers are in the image. The GPU drivers are downloaded as blobs since they are Third Party using Git Large File System and included in the build.

How can I double check for both HDMI and GPU drivers?

@kira I tried changing the run level in /etc/inittab from 3 to 5 and rebooting however there was no change and the graphical desktop still did not appear. That change is supposed to enable X11 however I suppose there is some additional thing that needs to be added to a configuration file somewhere to load in the additional software that provides the graphical desktop through the board connectors of HDMI and USB.

1 Like

HDMI is a kernel patch which is not 3rd party.
If HDMI is detected by the kernel, you could check it in the sysfs:

[totto@archvf2 ~]$ cat /sys/bus/platform/devices/29590000.hdmi/power/runtime_status 
active

1 Like

Wrestling with this build a bit, it appears that this image is little more than the Linux kernel and BusyBox.

Looking at the document that @kira provided the link to, it appears there are additional steps I need to take in order to pull all the necessary bits into the image build environment in order to create a proper image.

I will need a couple of days to read and try out things. I will post a reply into this thread as to my results.

However the immediate question as to what was happening with what appears to be the boot failing has been answered. The boot was not failing, I just needed to have TTY connection in order to sign in because the image I have generated appears to be nothing more than the Linux kernal and Busybox. All of the other components for WiFi, desktop, SSH, etc. are not in this image.

Thank you all for your help and taking the time to provide me assistance. Any new question will be as a new post.

2 Likes

@rickchambers sorry, I owe you the answer on your question for the GPU part. To verify, the driver is loaded, you can check:

[root@archvf2 totto]# cat /sys/kernel/debug/pvr/status 
Driver Status:   OK

Device ID: 0:128
Firmware Status: OK
Server Errors:   0
HWR Event Count: 0
CRR Event Count: 0
SLR Event Count: 0
WGP Error Count: 0
TRP Error Count: 0
FWF Event Count: 0
APM Event Count: 1
GPU Utilisation: 0%
                    VM0
2D    Utilisation:   0% 
GEOM  Utilisation:   0% 
3D    Utilisation:   0% 
CDM   Utilisation:   0% 
RAY   Utilisation:   0% 
GEOM2 Utilisation:   0% 

This of course only works, if kernel debug messages via sysfs are enabled.
If not, you could check that as follows:

[root@archvf2 totto]# ls /sys/devices/platform/soc/18000000.gpu/driver/18000000.gpu/drm/
card0  controlD64  renderD128

@Nightwulf it looks like kernel debug messages are not enabled however when I checked with the ls on the directory path, those files and directories were in the drm folder. So it looks like the GPU is installed.

When I did the cat on the HDMI runtime_status, it displayed active.

@kira I’m working with the two links you provided and it looks like the StarFiveTech link leads to where I pulled the 202310 Debian image I’m using with a different microSD card to use my VisionFive 2 for applications.

It looks like there is an installation script that automates adding additional packages such as chromium, libre office, etc. I was not aware of that script so it’s something for me to investigate.

Looking over the Building Debian image guide, that is kind of intimidating. Some of it looks familiar to what I have done to build the Linux kernel and generate the microSD card image. But there seems to be more to it which I suppose is adding the additional pieces that provide the full graphical desktop and WiFi drivers, etc. in order to boot and run similar to the 202310 Debian image that I have on another microSD card.

I think that somewhere in the guide is the information that tells me how to add the bits I’m missing to fully replicate the 202310 Debian image.

Thank you both.

Are you trying to make an image of the Xorg UI?
Could you provide the details of your compilation procedure?

@kira I’m following the procedure specified in the README.md document of the VisionFive2 repository from StarFive at URL GitHub - starfive-tech/VisionFive2

The procedure in that document has similarities to some of the steps in the document you referenced, Building StarFive Debian image | RVspace

I think that the README.md procedure has various automated steps that replicate some of the manual steps in the document you provided. It also appears that there are steps in the procedure you referenced that are not in the README.md file such as the Copy applications step.

Doing a bit more reading, the StarFive VisionFive2 repository contains source as well as links to source and Third Party binary blobs that as part of the image build process are pulled down, compiled, and inserted into the proper place within a file hierarchy so that it can then be combined into an image.

The repository uses the Buildroot tool “that simplifies and automates the process of building a complete Linux system for an embedded system, using cross-compilation.” See The Buildroot user manual which is the online manual for Buildroot.

The steps mentioned the README file in the buildroot directory of the VisionFive2 repository, GitHub - starfive-tech/buildroot at 22fc8eafe3c9daea42f2cc4be37731fd7b5171d9, are to:

To build and use the buildroot stuff, do the following:

  1. run ‘make menuconfig’
  2. select the target architecture and the packages you wish to compile
  3. run ‘make’
  4. wait while it compiles
  5. find the kernel, bootloader, root filesystem, etc. in output/images

I suppose the menuconfig step allows you to specify the various bits including the desktop, WiFi module, etc.

This link compiles the SDK, which does not have a UI.
but there is a simple UI,if you run the shell under /root

./run_weston.sh

Note:
Please plug a mouse or keyboard into the board.

@kira I tried the ./run_weston.sh command from the TTY interface and saw a fatal error of “fatal: failed to create compositor backend”.

Then I found this older post, [morty] weston: Add no-input-device patch to 1.11.0. - Patchwork which has this to say:

The included patch, backported from Weston master (and OE-Core
master since Weston 1.11.1, b6864b1), allows it to run without
any input device at launch. An ini option is introduced for
this purpose, so there is no behavioral change.

Related change in weston.ini:
[core]
require-input=true

Default is true; setting it false allows Weston to run
without a keyboard or mouse, which is handy for automated
environments.

At which point I remembered you writing to

Please plug a mouse or keyboard into the board

so I found another keyboard and mouse, plugged those into the board and then from the TTY interface used the ./run_weston.sh command again and a simple desktop displayed on my VisionFive 2 HDMI display.

So it appears the input devices must be connected before using the ./run_weston.sh command.

The only tool available from the desktop is a terminal window but at least I think that means that the GPU and other bits needed for the graphical desktop are in my image build.

I think that at this point, I now have a basic understanding of what is needed to build a new image to have a desktop with software similar to the 202310 Debian image from StarFive and now I just need to understand how to accomplish that.

Thank you and the others for your assistance. I’ll let you know with a followup post to this thread when I’m able to generate an image comparable to the 202310 Debian image.

You’re welcome, I also expect your success.

@kira Well after a couple of days and some serious mega-downloading, I created what appeared to be the SD minimal image from the document whose link you provided me, Building StarFive Debian image | RVspace

I burned the image to a microSD card and tried it out on my VisionFive 2. It did not finish the boot into the graphical desktop.

The HDMI display showed the following message (this is just the last part showing the error):

Begin: Running /scripts/local-block
Begin: Running /scripts/local-block… done. done.
Gave up waiting for root file system device. Common problems: Boot args (cat /proc/cmdline)
Check rootdelay= (did the system wait long enough?) - Missing modules (cat /proc/modules: ls /dev)
ALERT! /dev/mmcblk0p4 does not exist. Dropping to a shell!

However the TTY interface showed the initramfs prompt and I was able to do some looking about using the TTY interface.

So obviously somewhere in the procedure, I made an error. However I’m encouraged that the first build attempt did result in something that demonstrated progress. Lol.

Addendum

It looks like one of the steps in the procedure, step 1 in Build eMMC Image is incorrect. The step is:

  1. Modify partition for eMMC image.

    sudo chroot $VF2_WORK_DIR/riscv-chroot-snapshots
    sed -i 's/mmcblk1/mmcblk0/g' /etc/fstab
    sed -i 's/mmcblk1/mmcblk0/g' /boot/extlinux/extlinux.conf
    sed -i 's/mmcblk1/mmcblk0/g' /etc/default/u-boot
    sync
    exit

When I look in /dev at the initramfs prompt with ls /dev/m* I see mmcblk1 and each of the expected partitions mmcblk1p4, etc. but not mmcblk0.

Addendum 2 Confirmation

I took a look at the three files that were modified using the sed command to change mmcblk1 to mmcblk0. The file /etc/fstab had nothing more than a comment. The other two had directives that referenced mmcblk0 so I modified those back to mmcblk1. I then redid the SD card image build procedure, leaving out the sed command step, and created an image which I then burned to a microSD card using the Raspberry Pi Imager utility.

I placed the microSD card into the VisionFive 2 drive and booted the device by pressing the power button. After a short time, messages started scrolling on the display followed by a clearing of the screen, a pause, and then the desktop appeared with the sign in prompt.

I signed in and set up WiFi then tried out FireFox. Things looked similar to the 202310 Debian build.

I’m very happy at the moment!!! :slight_smile:

There are three image, they are used for sdcard、eMMC and nvme.
This step is used to modify partition for a eMMC image. If you start up by a sdcard, you need not do this step.

@kira Thank you for the correction. Reading over the last few weeks, I got the impression that sometimes when a reference was made to eMMC, what was meant was the SD card. Looking over the procedure documentation again, it is clear that there is the building of the SD card image which is used as the basis for the other two types of media, eMMC and NVMe card.

For both the eMMC and the NVMe card, the storage device is a different name than what is used for the SD card so it needs to be modified before doing the image creation.

Interesting that the image I created using the eMMC procedure boots from the SD card so long as I do not modify the storage device name. I’m going to do the image creation again using only the SD card steps and see what happens.

I was wondering the purpose of the third step in the eMMC image creation which uses the spl_tool utility. This spl_tool README.md document mentions that it can be used to fix the “eMMC booting issue”.

From this post, it appears there have been problems booting from the eMMC, EMMC boot though spi flash?

One thing I’m wondering is what happens if I add an additional step into the Install applications section of the build documentation to pull some of the assets mentioned in Releases · starfive-tech/Debian · GitHub as I’m interesting in seeing what Chromium does.

I was also curious about the steps that used DEBIAN_FRONTEND= and found this post explaining what that is about, apt - DEBIAN_FRONTEND environment variable - Ask Ubuntu

More information about the DEBIAN_FRONTEND= directive:

  1. What is the DEBIAN_FRONTEND Environment Variable in Ubuntu? | DeviceTests
  2. https://www.cyberciti.biz/faq/explain-debian_frontend-apt-get-variable-for-ubuntu-debian/
  3. debian - Is DEBIAN_FRONTEND=noninteractive redundant with apt-get -yqq? - Unix & Linux Stack Exchange
  4. Debian: debian_frontend=noninteractive

I also just realized that in the Copy applications section of the Building the Debian Image from Scratch document, they are not pulling the applications from the latest 202310 build. The wget command should be using Release v0.10.0-engineering-release-wayland - 202310 · starfive-tech/Debian · GitHub rather than https://github.com/starfive-tech/Debian/releases/download/v0.9.0-engineering-release-wayland

And it looks like there is now a 202311 build available with camera support.

Yes,eMMC image can be used by sdcard and in the next version (maybe 202312) there will only have two kands of images nvme and sdcard(sdcard and eMMC will use the same image)

It don’t matter,it‘s used a mechanisms for backup that was to prevent partitioning from destroying the data in the sector.

maybe you can have a try. there is a shell of install_package_and_dependencies.sh that you can install.

thank you for your sharing.

it may not be updated immediately

1 Like

You can unified all images into just one image by using LABEL=xxx in both /etc/fstab and kernel boot param in extlinux.conf (e.g. append root="LABEL=xxx") instead of using /dev/mmcblk... or /dev/nvme... directly.

2 Likes