SD card not working properly

I still have problems with the newest image and a 128GB SD card: https://dl.khadas.com/products/vim4/firmware/ubuntu/generic/vim4-ubuntu-22.04-gnome-linux-5.4-fenix-1.5-230425.img.xz

I noticed that sometimes after replugging power a third time the VIM4 seems to boot?

I am using a self-made header with 12V, 2.2A to the VIN to power the khadas.

U-Boot output:

[    4.067269@3]  Btrfs loaded, crc32c=crc32c-generic
[    4.331516@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.342731@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.355340@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.356733@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.357747@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.358397@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.359123@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.956113@0]  random: crng init done
[    4.972570@4]  r: b_s = e, b_sz = 32, f: b_s = 0, b_sz = 1a
[    4.972621@4]  the final result: sel = 1, rx = 27
[    4.973806@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.974039@1]  blk_update_request: I/O error, dev mmcblk1, sector 524296 op 0x1:(WRITE) flags 0x800 phys_seg 8 prio class 0
[    4.975331@1]  Buffer I/O error on dev mmcblk1p2, logical block 1, lost async page write
[    4.976347@1]  Buffer I/O error on dev mmcblk1p2, logical block 2, lost async page write
[    4.977345@1]  Buffer I/O error on dev mmcblk1p2, logical block 3, lost async page write
[    4.978353@1]  Buffer I/O error on dev mmcblk1p2, logical block 4, lost async page write
[    4.979360@1]  Buffer I/O error on dev mmcblk1p2, logical block 5, lost async page write
[    4.980368@1]  Buffer I/O error on dev mmcblk1p2, logical block 6, lost async page write
[    4.981375@1]  Buffer I/O error on dev mmcblk1p2, logical block 7, lost async page write
[    4.982382@1]  Buffer I/O error on dev mmcblk1p2, logical block 8, lost async page write
[    5.033279@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    5.043888@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    5.054467@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    5.065037@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]

What‘’s the model of your sd card?

SanDisk Extreme Pro 128GB, A2.

I don’t quite understand - I have multiple khadas and the following happens:

  • One Khadas VIM4 bootes fine with the above mentioned 128GB SD card (this SD card had the test image you uploaded here once), the second Khadas VIM4 only boots after multiple power on-off cycles with this SD Card
  • The second khadas also has problems with a 32GB SD Card, similar behaviour. I/O Buffer error or EXT4 mount failed.
  • Just inserted the 32GB SD Card into a third khadas and it was booting up just fine.

So I am really losing my mind here… I have quite a custom setup but really confused that the behaviour is so unpredictable.

I am still seeing issues with one of my Khadas VIM4 with a SanDisk Extreme Pro 128GB, A2 @numbqq. It seem that this specific VIM4 has problems, while others don’t.

Booting for the first time (after it was off for several minutes), the U-boot log looks like this:

[    3.751899@0]  xor: measuring software checksum speed
[    3.788252@0]     8regs     :  4966.000 MB/sec
[    3.828255@0]     32regs    :  5948.000 MB/sec
[    3.868265@3]     arm64_neon:  5261.000 MB/sec
[    3.868306@0]  xor: using function: 32regs (5948.000 MB/sec)
[    3.895491@2]  Btrfs loaded, crc32c=crc32c-generic
[    4.155702@0]  meson-gx-mmc fe08a000.sd: 25 [0x80000], CRC[0x0100]
[    4.168430@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.178625@0]  meson-gx-mmc fe08a000.sd: 25 [0x80000], CRC[0x0100]
[    4.189169@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.199722@0]  meson-gx-mmc fe08a000.sd: 25 [0x80000], CRC[0x0100]
[    4.210264@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.220443@0]  meson-gx-mmc fe08a000.sd: 25 [0x80000], CRC[0x0100]
[    4.230981@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.241158@0]  meson-gx-mmc fe08a000.sd: 25 [0x80000], CRC[0x0100]
[    4.755598@0]  random: crng init done
[    4.766859@2]  r: b_s = f, b_sz = 31, f: b_s = 0, b_sz = 1a
[    4.766889@2]  the final result: sel = 1, rx = 27
[    4.768386@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.778955@0]  meson-gx-mmc fe08a000.sd: 25 [0x80000], CRC[0x0100]
[    4.789083@2]  blk_update_request: I/O error, dev mmcblk1, sector 524288 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 0
[    4.789494@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.789782@2]  Buffer I/O error on dev mmcblk1p2, logical block 0, lost async page write
[    4.800617@0]  blk_update_request: I/O error, dev mmcblk1, sector 4980736 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 0
[    4.801332@0]  Buffer I/O error on dev mmcblk1p2, logical block 557056, lost async page write
[    4.802975@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.814248@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.825212@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.836128@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.847070@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.858115@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.868303@3]  blk_update_request: I/O error, dev mmcblk1, sector 4980736 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 0
[    4.869013@3]  Buffer I/O error on dev mmcblk1p2, logical block 557056, lost async page write
[    4.875181@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.875836@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    4.895797@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.899196@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.899519@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    4.901727@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    5.388508@0]  r: b_s = f, b_sz = 31, f: b_s = 0, b_sz = 1a
[    5.388542@0]  the final result: sel = 1, rx = 27
[    5.391609@0]  meson-gx-mmc fe08a000.sd: 25 [0x80008], CRC[0x0100]
[    5.391764@0]  blk_update_request: I/O error, dev mmcblk1, sector 524296 op 0x1:(WRITE) flags 0x800 phys_seg 8 prio class 0
[    5.393091@0]  Buffer I/O error on dev mmcblk1p2, logical block 1, lost async page write
[    5.394099@0]  Buffer I/O error on dev mmcblk1p2, logical block 2, lost async page write
[    5.395093@0]  Buffer I/O error on dev mmcblk1p2, logical block 3, lost async page write
[    5.396100@0]  Buffer I/O error on dev mmcblk1p2, logical block 4, lost async page write
[    5.397116@0]  Buffer I/O error on dev mmcblk1p2, logical block 5, lost async page write
[    5.398115@0]  Buffer I/O error on dev mmcblk1p2, logical block 6, lost async page write
[    5.399122@0]  Buffer I/O error on dev mmcblk1p2, logical block 7, lost async page write
[    5.449094@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    5.459707@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    5.470300@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    5.480901@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    5.491366@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    5.501942@0]  meson-gx-mmc fe08a000.sd: 25 [0x4c0000], CRC[0x0100]
[    5.512086@0]  blk_update_request: I/O error, dev mmcblk1, sector 4980736 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 0

and sometimes his error occurs instead:

[    4.847005@4]  EXT4-fs (mmcblk1p2): I/O error while writing superblock
[    4.847810@4]  EXT4-fs (mmcblk1p2): mount failed

At the same time, the same SD-card works in a second Khadas VIM4. If I replug the power supply 1-2 times, usually the VIM4 boots with this image and the U-boot lines look like this:

[    3.775073@3]  xor: measuring software checksum speed
[    3.811445@1]     8regs     :  4965.000 MB/sec
[    3.851438@2]     32regs    :  5946.000 MB/sec
[    3.891426@2]     arm64_neon:  5252.000 MB/sec
[    3.891450@2]  xor: using function: 32regs (5946.000 MB/sec)
[    3.918806@2]  Btrfs loaded, crc32c=crc32c-generic
[   10.545897@0]  random: crng init done
[   45.549529@2]  EXT4-fs (mmcblk1p2): mounted filesystem with writeback data mode. Opts: data=writeback
[   45.889014@2]  systemd[1]: Inserted module 'autofs4'
[   45.904364@2]  cgroup2: Unknown parameter 'memory_recursiveprot'
[   45.915700@2]  systemd[1]: systemd 249.11-0ubuntu3.9 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
[   45.919818@2]  systemd[1]: Detected architecture arm64.
[   45.923819@2]  systemd[1]: Hostname set to <Khadas>.

and it continues booting normally. I am not sure the big time gap between these lines is normal, but since it boots normally I guess it’s ok:

[   10.545897@0]  random: crng init done
[   45.549529@2]  EXT4-fs (mmcblk1p2): mounted filesystem with writeback data mode. Opts: data=writeback