radxa / meta-rockchip

Yocto BSP layer for the Rockchip SOC boards
MIT License
24 stars 14 forks source link

Yocto Image doesn't start on Radxa Rock 5B #3

Open DarwinHexley opened 1 year ago

DarwinHexley commented 1 year ago

I built a Yocto Image with the following setup:

conf/local.conf

MACHINE = "rockchip-rk3588-rock-5b"
DL_DIR ?= "${TOPDIR}/downloads"
DISTRO ?= "poky"
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"

when running bitbake core-image-minimal:

Build Configuration:
BB_VERSION           = "2.0.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-22.04"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = "rockchip-rk3588-rock-5b"
DISTRO               = "poky"
DISTRO_VERSION       = "4.0.9"
TUNE_FEATURES        = "aarch64 armv8a crc"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "kirkstone:09def309f91929f47c6cce386016ccb777bd2cfc"
meta-oe              = "kirkstone:571e36e20e9d1f27af0eb4545291beeb64f280e2"
meta-rockchip        = "kirkstone-radxa:5ae7e085d494bab9c4764bb38f712e8633b3fcb1"
meta-wolpertinger    = "kirkstone:09def309f91929f47c6cce386016ccb777bd2cfc"

"meta-wolpertinger" is my own layer. I made a bbappend-Recipe to exclude Broadcom-Chip (how it was showed in this Ticket: #1) The build was successful, but when I flashed the image to micro-sdcard and wanted to boot it from my Rock 5B I saw the following on the serial console:

DDR Version V1.02 20211202
LPDDR4X, 2112MHz
channel[0] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=4096MB
channel[1] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=4096MB
channel[2] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=4096MB
channel[3] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=4096MB
out

After the out it stopped.

I tried out a different Image from Radxa-Build, and it worked. The output from this image was:

DDR Version V1.08 20220617
LPDDR4X, 2112MHz
channel[0] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=4096MB
channel[1] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=4096MB
channel[2] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=4096MB
channel[3] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=4096MB
Manufacturer ID:0xff

Any ideas what's wrong?

RadxaStephen commented 1 year ago

So far ROCK 5B yocto image, build/tmp/deploy/images/rockchip-rk3588-rock-5b/core-image-minimal-rockchip-rk3588-rock-5b.wic, only supports booting from eMMC.

Can you try eMMC?

By the way, the latest commit is https://github.com/radxa/meta-rockchip/commit/ad1d46ccda227e91b224a23833422f3112560ccf

DarwinHexley commented 1 year ago

Thanks for your reply. I don't have a eMMC module here, only micro-sdcards. Is there a chance booting from micro-sd will be supported in future?

RadxaStephen commented 1 year ago

Yes. I will try to add booting from Micro SD card.

LiuFeiChen commented 1 year ago

I am using emmc mode, but still can't boot, can you provide a usable yocto image of rocke-5b。

RadxaStephen commented 1 year ago

Try this. https://mega.nz/file/JBtm2LQD#asFWNOSs5_XBwtBBvlIsWsbxtvKx_C7YCZenU0rh00c

yrik commented 1 year ago

Yes. I will try to add booting from Micro SD card.

Would be awesome, I need this feature as well. Going to try yocto on Rock 5B

yrik commented 1 year ago

Hi @RadxaStephen, thank you for the awesome work on the project.

I have a question about the boot from Micro SD. How complicated is it to add it? Would you please provide any hints where to look or what to change?

yrik commented 1 year ago

I've got a reply from a person from Rock-Chip (original creator of the repo)

i don't know much about rock 5b, but meta-rockchip doesn't limit the firmware on emmc or sdcard.

for booting from sdcard, normally need: 1/ clear the firmwares on emmc(for example, flash an empty image to the 0-1 mb area to clear partition table)

2/ make sure that the sdcard is accessable in u-boot and kernel stage(need to ask your board's maintainer)

3/ dd the whole .wic image to sdcard on PC

I've tried sudo dd if=core-image-minimal-rockchip-rk3588-rock-5b.wic of=/dev/rdisk4 bs=1m and checking with a display connected via HDMI, but it does not work.

Aparently I need to make sure that the image is accessible during u-boot and kernel stage. How do I do that?

yrik commented 1 year ago

btw, eventually it did work for me

  1. Press button MASKROM & connect via usb c to computer
  2. sudo rkdeveloptool db loader.bin
    sudo rkdeveloptool wl 0 ./core-image-minimal-rockchip-rk3588-rock-5b.wic
    sudo rkdeveloptool rd

    Note: sudo rkdeveloptool wl 0 ... is often unreliable, instead you can flash the sdcard directly with sudo bmaptool copy --nobmap core-image-minimal-rockchip-rk3588-rock-5b.wic /dev/sda

yrik commented 1 year ago

But I still have a problem. Rock 5b has no ethernet connection, ifconfig shows only loopback device, the same for ip link show. What can be the issue?

I've tried also wifi dongle, but that thing does not work on rock 5b as well, not visible in the devices list.

RadxaStephen commented 1 year ago

But I still have a problem. Rock 5b has no ethernet connection, ifconfig shows only loopback device, the same for ip link show. What can be the issue?

I've tried also wifi dongle, but that thing does not work on rock 5b as well, not visible in the devices list.

For Ethernet issue, I think it is solved, please see https://github.com/radxa/meta-rockchip/issues/7

clementlgl commented 10 months ago

I have the same problem on the ROCK 5A, I can't boot from the SD card by flashing the image on it.

@RadxaStephen have you added the Micro SD card boot feature ?

Build

Flash Using balena etcher to flash core-image-minimal-rockchip-rk3588s-rock-5a.wic image

Thank you 🙂