Jump to content
wahaha

unable to boot into rootfs after building uboot and kernel from source

Recommended Posts

i was referring to rockchip's boot guide on how to boot into RK3399 here. They mentioned to follow this flow (i am using miniloader approach to SD Card):

bootflow.jpg

 

As such, I went to Asus github page to pull `rkbin`, `u-boot`, and `kernel` to build.

 

I have successfully build the uboot with:
```
./make.sh tinker_board_2 CROSS_COMPILE=aarch64-linux-gnu-
```   -> which generates uboot.img, trust.img and rk3399_loader_v1.30.128.bin.

I then created the IDBLoader image with:

```
tools/mkimage -n rk3399 -T rksd -d /home/rkbin/bin/rk33/rk3399_ddr_800MHz_v1.30.bin idbloader.img
cat /home/rkbin/bin/rk33/rk3399_miniloader_v1.30.bin >> idbloader.img
```

Kernel is straightforward as per the other posts:
```
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- tinker_board_2_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- rk3399-tinker_board_2.img -j16
```

After that I created rootfs with this guide.

So I have all the required images: idbloader.img, uboot.img, trust.img, boot.img, rootfs.img.

 

However, when I put them all together based on rockchip's docs, I am still not able to boot into screen. Any ideas what is wrong?

I don't think it's even getting into the boot section because there is no green light once I put power in.

 

Share this post


Link to post
Share on other sites

hello @wahaha

from what you've decribed it's likely that the board isn't booting to either first loader or uboot. please be sure that the idbloader is located in 0x64 instead of 0x40

dd if=$IMAGES/idbloader.bin of=$DEVICE seek=64 conv=nocreat

 

Share this post


Link to post
Share on other sites

Hey @tooz,

Am I correct that the partition should be like this?

# Create a new partition table and partitions
sudo parted -s /dev/sdb mklabel gpt
# Primary GPT and MBR partitions are implicit in GPT and need not be created separately
sudo parted /dev/sdb unit s mkpart idbloader 64 7167            # loader1 (PartNum in GPT: 1)
sudo parted /dev/sdb unit s mkpart uboot 16384 24575            # loader2 (PartNum in GPT: 2)
sudo parted /dev/sdb unit s mkpart trust 24576 32767            # trust (PartNum in GPT: 3)
sudo parted /dev/sdb unit s mkpart boot 32768 262143            # boot (PartNum in GPT: 4)
sudo parted /dev/sdb set 4 boot on
sudo parted /dev/sdb unit s mkpart rootfs ext4 262144 16777182  # rootfs (PartNum in GPT: 5)
sudo parted /dev/sdb print 

followed by:

sudo dd if=idbloader.img of=/dev/sdb1 status=progress
sudo dd if=uboot.img of=/dev/sdb2  status=progress
sudo dd if=trust.img of=/dev/sdb3 status=progress
sudo dd if=boot.img of=/dev/sdb4 status=progress
sudo dd if=rootfs.img of=/dev/sdb5 status=progress
sync

 

Share this post


Link to post
Share on other sites

@tooz, can you confirm if i actually need `idbloader.img`? correct me if i'm wrong, but it seems like `idbloader.img` has been packed together with `uboot.img` when i run `make tinker_board_2_defconfig` -> which generates uboot.img and trust.img

If that's the case, which partition / sector should be be `dd` into?

Share this post


Link to post
Share on other sites

hello @wahaha

in short: yes. idbloader is different from uboot, and you will need to dd dbloader in order to boot into uboot

idbloader will need to be located in seek 0x64 in emmc whether the individual partition exists or not

Share this post


Link to post
Share on other sites
Posted (edited)

@tooz,

okay, last question for this topic - is the below method correct in creating the idbloader.img?

```
tools/mkimage -n rk3399 -T rksd -d /home/rkbin/bin/rk33/rk3399_ddr_800MHz_v1.30.bin idbloader.img
cat /home/rkbin/bin/rk33/rk3399_miniloader_v1.30.bin >> idbloader.img
```

This was from the rockchip site i linked at the start of the thread. If i'm wrong, how is idbloader.img created please?

Edited by wahaha

Share this post


Link to post
Share on other sites

hello @wahaha

On 8/17/2024 at 6:29 PM, wahaha said:

tools/mkimage -n rk3399 -T rksd -d /home/rkbin/bin/rk33/rk3399_ddr_800MHz_v1.30.bin idbloader.img
cat /home/rkbin/bin/rk33/rk3399_miniloader_v1.30.bin >> idbloader.img

the commands are correct, 

for the actual ddr bin and miniloader bin used for the project, please refer to rkboot/rk3399miniall.ini 

https://github.com/TinkerBoard/rockchip-linux-rkbin/blob/linux4.19-rk3399-debian10/RKBOOT/RK3399MINIALL.ini

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...