inindev / nanopc-t6

debian arm64 linux for the nanopc-t6
GNU General Public License v3.0
19 stars 3 forks source link

Unable to boot from eMMC #5

Closed mihaibuba closed 7 months ago

mihaibuba commented 8 months ago

Hello,

First of all I would like to start by saying that I really appreciate what you have done, having a clean install on my NanoPC-T6 is awesome, and is exactly what I wanted. Now, for the issue I am having: I am currently able to boot it from a microSD, I was even able to clone it from one microSD to another, but I can not get it to boot from the eMMC. Could you please post the steps I could use to get it to boot?

I have tried multiple ways, as follows:

  1. Boot from MicroSD (mmcblk1), write image to eMMC (mmcblk0) using:
    # remove partions
    fdisk /dev/mmcblk0
    n # new partion
    w # write

    then:

    blkid
    /dev/mmcblk0: PTUUID="ca28012d-a597-a943-9299-7d268bd41448" PTTYPE="gpt"
    /dev/mmcblk1p1: LABEL="rootfs" UUID="7ba07c73-0352-4794-9a99-7e69e3e51a58" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="rootfs" PARTUUID="a739e1f6-23b7-4867-aa4b-54c5b95fe348"
sudo xzcat nanopc-t6_bookworm-v12-6.7-rc7.img.xz > /dev/mmcblk0

which gave me:

lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk1      179:0    0 119.4G  0 disk 
└─mmcblk1p1  179:1    0  29.8G  0 part /
mmcblk0      179:256  0  28.9G  0 disk 
└─mmcblk0p1  179:257  0     2G  0 part 
mmcblk0boot0 179:512  0     4M  1 disk 
mmcblk0boot1 179:768  0     4M  1 disk 

blkid
/dev/mmcblk0p1: LABEL="rootfs" UUID="9bb96386-bb3f-45c8-982b-01e398964371" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="rootfs" PARTUUID="d06b6f5e-ffb4-422e-a80e-482136552386"
/dev/mmcblk1p1: LABEL="rootfs" UUID="7ba07c73-0352-4794-9a99-7e69e3e51a58" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="rootfs" PARTUUID="a739e1f6-23b7-4867-aa4b-54c5b95fe348"
  1. USB debug, started in MASKROM:
    • Wrote the entire extracted image from inside nanopc-t6_bookworm-v12-6.7-rc7.img.xz
    • Wrote the files individually, with the partions set up like https://opensource.rock-chips.com/wiki_Partitions:
      FIRMWARE_VER: 12.0
      MACHINE_MODEL: RK3588
      MACHINE_ID: 007
      MANUFACTURER: RK3588
      MAGIC: 0x5041524B
      ATAG: 0x00200800
      MACHINE: NanoPi6
      CHECK_MASK: 0x80
      PWR_HLD: 0,0,A,0,1
      TYPE: GPT
      CMDLINE: mtdparts=rk29xxnand:0x00001f40@0x00000040(loader),0x00002000@0x00004000(uboot),0x00120000@0x00046000(rootfs:grow)
./rkdeveloptool db ../rk3588-usb-friendlywrt-23.05-20231201/MiniLoaderAll.bin
../rkdeveloptool gpt ./parameter.txt
../rkdeveloptool ul ../rk3588-usb-friendlywrt-23.05-20231201/MiniLoaderAll.bin
../rkdeveloptool wl 0x40 ./idbloader.img
../rkdeveloptool wl 0x4000 ./u-boot.itb
../rkdeveloptool wl 0x40000 ./images/debian2Gfs.img
../rkdeveloptool rd
  1. Install to mmcblk0bootX partitions as https://www.kernel.org/doc/Documentation/mmc/mmc-dev-parts.txt:
    echo 0 > /sys/block/mmcblk0boot0/force_ro
    echo 0 > /sys/block/mmcblk0boot1/force_ro
    dd if=idbloader.img of=/dev/mmcblk0boot0
    dd if=u-boot.itb of=/dev/mmcblk0boot1
    echo 1 > /sys/block/mmcblk0boot0/force_ro
    echo 1 > /sys/block/mmcblk0boot1/force_ro

    Checked that the partition is bootable: https://manpages.debian.org/unstable/mmc-utils/mmc.1.en.html https://community.nxp.com/t5/i-MX-Processors/make-imx8-bootable-from-mmcblk2boot0/m-p/1241544

    mmc extcsd read /dev/mmcblk0 | grep -i Boot
    Boot Information [BOOT_INFO: 0x07]
    Device supports alternative boot method
    Device supports dual data rate during boot
    Device supports high speed timing during boot
    Boot partition size [BOOT_SIZE_MULTI: 0x20]
    Boot configuration bytes [PARTITION_CONFIG: 0x48]
    Boot Partition 1 enabled
    No access to boot partition
    Boot config protection [BOOT_CONFIG_PROT: 0x00]
    Boot bus Conditions [BOOT_BUS_CONDITIONS: 0x00]
    Boot write protection status registers [BOOT_WP_STATUS]: 0x00
    Boot Area Write protection [BOOT_WP]: 0x00
inindev commented 8 months ago

Do you have spi flash on your model?

What is the output of: uname -a What is the output of: ls /dev/mtd*

mihaibuba commented 8 months ago

Thank you for answering so fast :) No, I do not have SPI flash. However it was able to boot from eMMC without a MicroSD using:

ls /dev/mtd ls: cannot access '/dev/mtd': No such file or directory


and here is a screenshot from mc:
![image](https://github.com/inindev/nanopc-t6/assets/18402330/ef36d669-0565-48dc-a5fa-de5f87e58d52)
inindev commented 8 months ago

When booted from removable mmc, do these steps:

wget https://github.com/inindev/nanopc-t6/releases/download/v12-6.7-rc7/nanopc-t6_bookworm-v12-6.7-rc7.img.xz
sudo su
xzcat nanopc-t6_bookworm-v12-6.7-rc7.img.xz > /dev/mmcblk0
shutdown -h now

power off and remove mmc card, then power back on:

U-Boot 2024.01-rc5-00007-g467d56a974 (Dec 24 2023 - 09:48:33 +0000)

Model: FriendlyElec NanoPC-T6
DRAM:  4 GiB (effective 3.7 GiB)
Core:  337 devices, 28 uclasses, devicetree: separate
MMC:   mmc@fe2c0000: 1, mmc@fe2e0000: 0
Loading Environment from nowhere... OK
In:    serial@feb50000
Out:   serial@feb50000
Err:   serial@feb50000
Model: FriendlyElec NanoPC-T6
Net:   No ethernet found.
Hit any key to stop autoboot:  0
Card did not respond to voltage select! : -110
** Booting bootflow 'mmc@fe2e0000.bootdev.part_1' with extlinux
1:  Debian GNU/Linux 12 (bookworm) 6.7.0-rc7-7-arm64


after booting, df shows we are booted from emmc (/dev/mmcblk0p1)

debian@nanopc-t6:~$ df
Filesystem     1K-blocks   Used Available Use% Mounted on
udev             1871644      0   1871644   0% /dev
tmpfs             381308    952    380356   1% /run
/dev/mmcblk0p1  29776728 677792  27850724   3% /
tmpfs            1906536      0   1906536   0% /dev/shm
tmpfs               5120      0      5120   0% /run/lock
tmpfs             381304      0    381304   0% /run/user/1000
mihaibuba commented 8 months ago

I tried it, and this time I got the led to blink a few times after about 20 seconds, then it stopped. I hadn't noticed this before. I waited a few minutes, and tried to ssh into it using it's external IP, I got no answer. By the way, how did you get the U-Boot logs? Connecting trough HDMI doesn't work, right? I tried to write to the eMMC again while booted from microSD with the previously downloaded image, and now I got no blinking lights. At least now I have the hope of a little blinking light I can play with later :) image

inindev commented 8 months ago

You pretty much need a 3.3v serial cable if you are going to work on one of these raspberry-pi like devices. It is way too difficult to know what is going on without one. Note: Be sure you remove the mmc card before disassembling the case as it is easy to damage the socket if you forget.

The nanopc-t6 has a raspberry-pi compatible header on it: https://wiki.friendlyelec.com/wiki/index.php/File:NanoPC-T6-A01.jpg

serial2 is located on pins 6, 8, 10: https://www.raspberrypi.com/documentation/computers/images/GPIO-Pinout-Diagram-2.png

This is the serial module I prefer, but it does require soldering and extra leads: https://www.amazon.com/gp/product/B09W2B61HW

This FTDI 3.3v cable is also a good choice: https://www.amazon.com/Serial-Adapter-Signal-FT232RL-Windows/dp/B08BLHGWHS

If you have not put a serial console on a rockchip device, they default to 1.5M baud. I use this serial terminal: https://github.com/inindev/goterm

mihaibuba commented 7 months ago

Hello, I finally managed to get some time to work on this again. I am getting I/O errors from the eMMC. I have no idea if this is an issue with the hardware error or software error

Here is what I have after connecting via serial:

nanopc-t6_bookworm-v12-6.7-rc7.img.xz 100%[================================================================================================================>] 148.77M 30.7MB/s in 5.1s

2024-01-20 12:30:33 (29.1 MB/s) - ‘nanopc-t6_bookworm-v12-6.7-rc7.img.xz’ saved [155992408/155992408]


root@nanopc-t6:/home/debian/image# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS mmcblk1 179:0 0 119.4G 0 disk └─mmcblk1p1 179:1 0 29.8G 0 part / mmcblk0 179:256 0 28.9G 0 disk mmcblk0boot0 179:512 0 4M 1 disk mmcblk0boot1 179:768 0 4M 1 disk


root@nanopc-t6:/home/debian/image# xzcat nanopc-t6_bookworm-v12-6.7-rc7.img.xz > /dev/mmcblk0 root@nanopc-t6:/home/debian/image# sync root@nanopc-t6:/home/debian/image# shutdown -h now

Broadcast message from root@nanopc-t6 on pts/2 (Sat 2024-01-20 12:35:03 EST):

The system will power off now!

Broadcast message from root@nanopc-t6 on pts/2 (Sat 2024-01-20 12:35:03 EST):

The system will power off now!


Ejected the MicroSD
Logged in using serial (this is when the sys led is blinking) and I am getting the following errors:

nanopc-t6 login: [ 35.809563] vdd_gpu_s0: disabling [ 37.744245] systemd-journald[246]: Oldest entry in /var/log/journal/f14307c1f0e040d2a1a377d918432c01/system.journal is older than the configured file retention duration (1month), suggesting rotation. [ 37.745900] systemd-journald[246]: /var/log/journal/f14307c1f0e040d2a1a377d918432c01/system.journal: Journal header limits reached or header out-of-date, rotating. [ 37.863204] blk_print_req_error: 3 callbacks suppressed [ 37.863218] I/O error, dev mmcblk0, sector 4083759 op 0x0:(READ) flags 0x80700 phys_seg 10 prio class 2 [ 38.434476] I/O error, dev mmcblk0, sector 3731874 op 0x0:(READ) flags 0x80700 phys_seg 16 prio class 2 [ 38.451850] I/O error, dev mmcblk0, sector 3731960 op 0x0:(READ) flags 0x80700 phys_seg 5 prio class 2 [ 38.457259] I/O error, dev mmcblk0, sector 3731988 op 0x0:(READ) flags 0x80700 phys_seg 2 prio class 2 [ 38.574740] I/O error, dev mmcblk0, sector 3732145 op 0x0:(READ) flags 0x80700 phys_seg 6 prio class 2 [ 38.576555] I/O error, dev mmcblk0, sector 3732154 op 0x0:(READ) flags 0x80700 phys_seg 5 prio class 2 [ 38.577515] I/O error, dev mmcblk0, sector 3732155 op 0x0:(READ) flags 0x80700 phys_seg 5 prio class 2 [ 38.651202] I/O error, dev mmcblk0, sector 3731960 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 [ 38.723837] I/O error, dev mmcblk0, sector 3731790 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 [ 38.795178] I/O error, dev mmcblk0, sector 3731874 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2

root@nanopc-t6:/home/debian# ping 8.8.8.8 [ 157.190022] I/O error, dev mmcblk0, sector 3890710 op 0x0:(READ) flags 0x80700 phys_seg 2 prio class 2 [ 157.368187] I/O error, dev mmcblk0, sector 433839 op 0x0:(READ) flags 0x80700 phys_seg 3 prio class 2 [ 157.369127] I/O error, dev mmcblk0, sector 433840 op 0x0:(READ) flags 0x80700 phys_seg 3 prio class 2 [ 157.396852] I/O error, dev mmcblk0, sector 553314 op 0x0:(READ) flags 0x80700 phys_seg 15 prio class 2 [ 157.402497] I/O error, dev mmcblk0, sector 553342 op 0x0:(READ) flags 0x80700 phys_seg 13 prio class 2 [ 157.405319] I/O error, dev mmcblk0, sector 553358 op 0x0:(READ) flags 0x80700 phys_seg 11 prio class 2 [ 157.406385] I/O error, dev mmcblk0, sector 553360 op 0x0:(READ) flags 0x80700 phys_seg 10 prio class 2 [ 157.411566] I/O error, dev mmcblk0, sector 553376 op 0x0:(READ) flags 0x80700 phys_seg 9 prio class 2 [ 157.418490] I/O error, dev mmcblk0, sector 553422 op 0x0:(READ) flags 0x80700 phys_seg 7 prio class 2 [ 157.419520] I/O error, dev mmcblk0, sector 553424 op 0x0:(READ) flags 0x80700 phys_seg 6 prio class 2 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=115 time=3.06 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=115 time=2.73 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=115 time=3.17 ms ^C --- 8.8.8.8 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 2.730/2.985/3.165/0.185 ms root@nanopc-t6:/home/debian# apt update [ 169.516133] blk_print_req_error: 14 callbacks suppressed [ 169.516146] I/O error, dev mmcblk0, sector 4181527 op 0x0:(READ) flags 0x80700 phys_seg 15 prio class 2 [ 169.517684] I/O error, dev mmcblk0, sector 4181528 op 0x0:(READ) flags 0x80700 phys_seg 14 prio class 2 [ 169.609488] I/O error, dev mmcblk0, sector 392735 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2 [ 169.677551] I/O error, dev mmcblk0, sector 392736 op 0x0:(READ) flags 0x80700 phys_seg 6 prio class 2 [ 169.679402] I/O error, dev mmcblk0, sector 392743 op 0x0:(READ) flags 0x80700 phys_seg 6 prio class 2 [ 169.686138] I/O error, dev mmcblk0, sector 392793 op 0x0:(READ) flags 0x80700 phys_seg 3 prio class 2 [ 169.687332] I/O error, dev mmcblk0, sector 392796 op 0x0:(READ) flags 0x80700 phys_seg 3 prio class 2 [ 169.688940] I/O error, dev mmcblk0, sector 392802 op 0x0:(READ) flags 0x80700 phys_seg 2 prio class 2 [ 169.705605] I/O error, dev mmcblk0, sector 4181811 op 0x0:(READ) flags 0x80700 phys_seg 6 prio class 2 [ 169.782642] I/O error, dev mmcblk0, sector 501776 op 0x0:(READ) flags 0x80700 phys_seg 2 prio class 2 Reading package lists... Done E: Method http has died unexpectedly! E: Sub-process http received signal 7. root@nanopc-t6:/home/debian# apt update 0% [Working][ 178.058527] blk_print_req_error: 49 callbacks suppressed [ 178.058542] I/O error, dev mmcblk0, sector 428972 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 [ 178.061894] I/O error, dev mmcblk0, sector 428972 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 [ 178.064368] I/O error, dev mmcblk0, sector 428972 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Reading package lists... Done E: Method http has died unexpectedly! E: Sub-process http received signal 7.

Then I attempted to reboot, it starts of fine

DDR Version V1.08 20220617 LPDDR4X, 2112MHz channel[0] BW=16 Col=10 Bk=8 CS0 Row=16 CS=1 Die BW=16 Size=1024MB channel[1] BW=16 Col=10 Bk=8 CS0 Row=16 CS=1 Die BW=16 Size=1024MB channel[2] BW=16 Col=10 Bk=8 CS0 Row=16 CS=1 Die BW=16 Size=1024MB channel[3] BW=16 Col=10 Bk=8 CS0 Row=16 CS=1 Die BW=16 Size=1024MB Manufacturer ID:0x1 Samsung CH0 RX Vref:32.7%, TX Vref:18.8%,0.0% CH1 RX Vref:30.7%, TX Vref:20.8%,0.0% CH2 RX Vref:31.7%, TX Vref:19.8%,0.0% CH3 RX Vref:30.7%, TX Vref:20.8%,0.0% change to F1: 528MHz change to F2: 1068MHz change to F3: 1560MHz change to F0: 2112MHz out

U-Boot SPL 2024.01-rc5-00007-g467d56a974 (Dec 24 2023 - 09:48:33 +0000) Trying to boot from MMC1

Checking hash(es) for config config-1 ... OK

Checking hash(es) for Image atf-1 ... sha256+ OK

Checking hash(es) for Image u-boot ... sha256+ OK

Checking hash(es) for Image fdt-1 ... sha256+ OK

Checking hash(es) for Image atf-2 ... sha256+ OK

Checking hash(es) for Image atf-3 ... sha256+ OK

INFO: Preloader serial: 2 NOTICE: BL31: v2.3():v2.3-499-ge63a16361:derrick.huang NOTICE: BL31: Built : 10:58:38, Jan 10 2023 INFO: spec: 0x1 INFO: ext 32k is not valid INFO: ddr: stride-en 4CH INFO: GICv3 without legacy support detected. INFO: ARM GICv3 driver initialized in EL3 INFO: valid_cpu_msk=0xff bcore0_rst = 0x0, bcore1_rst = 0x0 INFO: system boots from cpu-hwid-0 INFO: idle_st=0x21fff, pd_st=0x11fff9, repair_st=0xfff70001 INFO: dfs DDR fsp_params[0].freq_mhz= 2112MHz INFO: dfs DDR fsp_params[1].freq_mhz= 528MHz INFO: dfs DDR fsp_params[2].freq_mhz= 1068MHz INFO: dfs DDR fsp_params[3].freq_mhz= 1560MHz INFO: BL31: Initialising Exception Handling Framework INFO: BL31: Initializing runtime services WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK ERROR: Error initializing runtime service opteed_fast INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0xa00000 INFO: SPSR = 0x3c9

U-Boot 2024.01-rc5-00007-g467d56a974 (Dec 24 2023 - 09:48:33 +0000)

Model: FriendlyElec NanoPC-T6 DRAM: 4 GiB (effective 3.7 GiB) Core: 337 devices, 28 uclasses, devicetree: separate MMC: mmc@fe2c0000: 1, mmc@fe2e0000: 0 Loading Environment from nowhere... OK In: serial@feb50000 Out: serial@feb50000 Err: serial@feb50000 Model: FriendlyElec NanoPC-T6 Net: No ethernet found. Hit any key to stop autoboot: 0 Card did not respond to voltage select! : -110 ** Booting bootflow 'mmc@fe2e0000.bootdev.part_1' with extlinux 1: Debian GNU/Linux 12 (bookworm) 6.7.0-rc7-7-arm64 Retrieving file: /boot/vmlinuz-6.7.0-rc7-7-arm64 Retrieving file: /boot/initrd.img-6.7.0-rc7-7-arm64 append: root=UUID=9bb96386-bb3f-45c8-982b-01e398964371 rootwait Retrieving file: /boot/rk3588-nanopc-t6.dtb-6.7.0-rc7-7-arm64 Moving Image from 0x2080000 to 0x2200000, end=5160000

Flattened Device Tree blob at 0a100000

Booting using the fdt blob at 0xa100000 Working FDT set to a100000 Loading Ramdisk to eb405000, end ecbdc4f1 ... OK Loading Device Tree to 00000000eb3ec000, end 00000000eb4041d7 ... OK Working FDT set to eb3ec000

Starting kernel ...

But then panic ensued and no more blinking light :) 

[ 5.065637] r8169 0002:21:00.0 enP2p33s0: renamed from eth1 [ 5.102297] I/O error, dev mmcblk0, sector 70 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2 [ 5.170046] I/O error, dev mmcblk0, sector 120 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2 [ 5.257142] I/O error, dev mmcblk0, sector 164 op 0x0:(READ) flags 0x80700 phys_seg 9 prio class 2 [ 5.258075] I/O error, dev mmcblk0, sector 165 op 0x0:(READ) flags 0x80700 phys_seg 9 prio class 2 [ 5.258984] I/O error, dev mmcblk0, sector 166 op 0x0:(READ) flags 0x80700 phys_seg 9 prio class 2 [ 5.259890] I/O error, dev mmcblk0, sector 167 op 0x0:(READ) flags 0x80700 phys_seg 9 prio class 2 [ 5.264626] I/O error, dev mmcblk0, sector 190 op 0x0:(READ) flags 0x80700 phys_seg 7 prio class 2 [ 5.293228] I/O error, dev mmcblk0, sector 370 op 0x0:(READ) flags 0x80700 phys_seg 5 prio class 2 [ 5.382135] I/O error, dev mmcblk0, sector 164 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 [ 5.383053] I/O error, dev mmcblk0, sector 165 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 [ 5.384093] Buffer I/O error on dev mmcblk0, logical block 20, async page read [ 5.387556] Buffer I/O error on dev mmcblk0, logical block 20, async page read [ 5.389919] Buffer I/O error on dev mmcblk0, logical block 20, async page read [ 5.592649] Buffer I/O error on dev mmcblk0p1, logical block 519878, async page read Begin: Loading essential drivers ... done. Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done. Begin: Running /scripts/local-premount ... done. Begin: Will now check root file system ... fsck from util-linux 2.38.1 [/sbin/fsck.ext4 (1) -- /dev/mmcblk0p1] fsck.ext4 -a -C0 /dev/mmcblk0p1 rootfs: clean, 17816/130048 files, 188492/519936 blocks done. [ 5.802651] EXT4-fs (mmcblk0p1): mounted filesystem 9bb96386-bb3f-45c8-982b-01e398964371 ro with ordered data mode. Quota mode: none. done. Begin: Running /scripts/local-bottom ... done. Begin: Running /scripts/init-bottom ... done. [ 6.002368] Buffer I/O error on dev mmcblk0p1, logical block 519878, async page read [ 6.106327] Not activating Mandatory Access Control as /sbin/tomoyo-init does not exist. [ 7.961324] random: crng init done [ 8.366193] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000007 [ 8.366877] CPU: 4 PID: 1 Comm: init Not tainted 6.7.0-rc7-7-arm64 #7 [ 8.367446] Hardware name: FriendlyElec NanoPC-T6 (DT) [ 8.367897] Call trace: [ 8.368115] dump_backtrace+0x9c/0x128 [ 8.368454] show_stack+0x20/0x38 [ 8.368749] dump_stack_lvl+0x48/0x60 [ 8.369080] dump_stack+0x18/0x28 [ 8.369377] panic+0x398/0x3d8 [ 8.369653] do_exit+0x8c8/0x9e0 [ 8.369941] do_group_exit+0x3c/0xa0 [ 8.370259] get_signal+0x958/0x960 [ 8.370571] do_notify_resume+0x254/0x1328 [ 8.370934] el0_da+0xdc/0xe0 [ 8.371204] el0t_64_sync_handler+0xb4/0x130 [ 8.371587] el0t_64_sync+0x190/0x198 [ 8.371913] SMP: stopping secondary CPUs [ 8.372368] Kernel Offset: disabled [ 8.372675] CPU features: 0x1,80000000,70028146,2100720b [ 8.373142] Memory Limit: none [ 8.373417] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000007 ]---

mihaibuba commented 7 months ago

On a separate note, thank you so much for the tip on the hardware to use and the software to serial debug that was very useful for all of this! For everyone else reading this: It took a few tries to get this working, trying both pins 6,8,10 and the dedicated pins on the T6 but eventually I got it working. The layout for the dedicated pins was actually printed on the back of the board. I had connected the GND to GND and TX (board) to RX (USB) and RX (board) to TX (USB) Also the led on the USB I got doesn't blink for connections at 1.5M so that tripped me when trying to figure out why I wasn't seeing anything. So I ended up to trying various pins with the console open at 1.5M

inindev commented 7 months ago

After writing the image to /dev/mmcblk0 using xzcat and shutting down, then removing the MMC and powering back on, do you see it reboot once? When the /dev/mmcblk0 partition is new, it will reboot once after resizing the filesystem.

The bad sector errors are concerning as it makes it look like there is a problem with the emmc. I believe you said that you are able to boot the FriendlyElec image from /dev/mmcblk0 without issue?

mihaibuba commented 7 months ago

Yes, I was able to boot the FriendlyElec image from /dev/mmcblk0 without issue. I was also able to boot the newly written image once from /dev/mmcblk0. That is where the errors first showed up. On that first boot, I tried to login with the default user and password trough the serial. The logs for this attempt are in the second block of logs in my previous post. What I did was to try to run an apk update, at which point I got more errors. Then I rebooted. After the reboot I got the kernel panic. Also, here is what I found which might or might not explain the error, the memory frequency might need adjusting. https://forum.radxa.com/t/rock4-se-emmc-input-output-errors-read-only-fs/14406/14

inindev commented 7 months ago

We have recently reduced ROCK 4’s eMMC controller to HS200 24 as a workaround of some eMMC related issues. The updated kernel 21 should be available in production channel soon.

This is interesting. I wondered about this but saw the vendor device tree was highspeed:

&sdhci {
    bus-width = <8>;
    no-sdio;
    no-sd;
    non-removable;
    max-frequency = <200000000>;
    mmc-hs400-1_8v;
    mmc-hs400-enhanced-strobe;
    full-pwr-cycle-in-suspend;
    status = "okay";
};

https://github.com/friendlyarm/kernel-rockchip/blob/nanopi6-v6.1.y/arch/arm64/boot/dts/rockchip/rk3588-nanopi6-common.dtsi

I will make a new device tree in a few hours with hs200 mode enabled for the emmc for you to try.

inindev commented 7 months ago

I compiled a device tree for the nanopc-t6 which puts the emmc into hs200 mode rather than hs400: https://drive.google.com/file/d/1Hr7eQJnIbCSi5pq6ccBlVv4OdF_2o2p2/view?usp=sharing

After you xzcat the image to /dev/mmc0, mount the drive and replace rk3588-nanopc-t6.dtb-6.7.0-rc7-7-arm64 with the one linked above:

sudo su
mount /dev/mmcblk0p1 /mnt
cp rk3588-nanopc-t6.dtb /mnt/boot/rk3588-nanopc-t6.dtb-6.7.0-rc7-7-arm64
umnount /mnt
mihaibuba commented 7 months ago

I just got to try this and I would like to report that the fix worked! I no longer get errors in the serial console, and I am able to boot without any issue from the eMMC Thank you so much for taking care of this issue so fast!

lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
mmcblk0      179:0    0 28.9G  0 disk 
└─mmcblk0p1  179:1    0 28.9G  0 part /
mmcblk0boot0 179:256  0    4M  1 disk 
mmcblk0boot1 179:512  0    4M  1 disk 
root@nanopc-t6:/home# blkid
/dev/mmcblk0p1: LABEL="rootfs" UUID="bd160d11-4c9a-437e-9623-aa78e81579d4" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="rootfs" PARTUUID="04586ad3-048c-486f-92d1-dd0d59af7641"
inindev commented 3 months ago

The latest kernel has hdmi, usb3, usb-c, and sound working on the nanopc-t6. Everything should now work the best it can at the moment (as far as I know).

debian bookworm v12.5 arm64 - rc4 https://github.com/inindev/debian-image/releases

linux kernel v6.9.3-2 arm64 inindev https://github.com/inindev/linux-rockchip/releases

u-boot arm64 inindev v2024.07-rc4 https://github.com/inindev/uboot-rockchip/releases