TF card not detected on VIM3_Ubuntu-server-focal_Linux-4.9_arm64_EMMC_V0.9-20200530

Hi,
I’ve just switched from VIM3_Ubuntu-server-bionic_Linux-4.9_arm64_EMMC_V20191231 to VIM3_Ubuntu-server-focal_Linux-4.9_arm64_EMMC_V0.9-20200530.
I noticed that the very same TF Card that what was working before the switch on the same board now it doesn’t get detected. And it’s still working on a different x86 pc.
The card is a Samsung SDHC MB-ME32GA EVO Plus 32 GB, UHS-I U1.
The same problem happens also with a Samsung SDXC MB-MC64GA EVO Plus 64 GB, UHS-I U3.

I’ve got the following errors on dmesg:

[  338.461859] meson-mmc: card IN
[  338.565002] meson-mmc: normal card in
[  338.685763] meson-mmc: actual_clock :400000, HHI_nand: 0x80
[  338.685769] meson-mmc: [meson_mmc_clk_set_rate_v3] after clock: 0x1000023c
[  338.858711] meson-mmc: sd: resp_timeout,vstat:0x9dff0800,virqc:3fff
[  338.859607] meson-mmc: sd: err: wait for desc write back, bus_fsm:0x7
[  338.866224] meson-mmc: meson_mmc_irq_thread_v3() 622: set 1st retry!
[  338.874172] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  338.879107] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  338.886791] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  338.891760] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  338.899072] meson-mmc: sd: resp_timeout,vstat:0x9dff0800,virqc:3fff
[  338.904410] meson-mmc: sd: err: wait for desc write back, bus_fsm:0x7
[  338.911061] meson-mmc: Command retried failed line:644, cmd:55
[  338.918332] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  338.923394] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  338.929740] meson-mmc: meson_mmc_irq_thread_v3() 622: set 1st retry!
[  338.937150] meson-mmc: sd: resp_timeout,vstat:0x9dff0800,virqc:3fff
[  338.942543] meson-mmc: sd: err: wait for desc write back, bus_fsm:0x7
[  338.950180] meson-mmc: sd: resp_timeout,vstat:0x9dff0800,virqc:3fff
[  338.955543] meson-mmc: sd: err: wait for desc write back, bus_fsm:0x7
[  338.963183] meson-mmc: sd: resp_timeout,vstat:0x9dff0800,virqc:3fff
[  338.968543] meson-mmc: sd: err: wait for desc write back, bus_fsm:0x7
[  338.975228] meson-mmc: Command retried failed line:644, cmd:55
[  338.984758] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  338.989018] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  338.995325] meson-mmc: meson_mmc_irq_thread_v3() 622: set 1st retry!
[  339.002836] meson-mmc: sd: resp_timeout,vstat:0x9dff0800,virqc:3fff
[  339.008167] meson-mmc: sd: err: wait for desc write back, bus_fsm:0x7
[  339.015810] meson-mmc: sd: resp_timeout,vstat:0x9dff0800,virqc:3fff
[  339.021167] meson-mmc: sd: err: wait for desc write back, bus_fsm:0x7
[  339.028822] meson-mmc: sd: resp_timeout,vstat:0x9dff0800,virqc:3fff
[  339.034168] meson-mmc: sd: err: wait for desc write back, bus_fsm:0x7
[  339.040824] meson-mmc: Command retried failed line:644, cmd:55
[  339.048164] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  339.053151] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  339.059461] meson-mmc: meson_mmc_irq_thread_v3() 622: set 1st retry!
[  339.066935] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  339.072303] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  339.079712] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  339.084959] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  339.092275] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  339.097612] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  339.103939] meson-mmc: Command retried failed line:644, cmd:55
[  339.110005] sd: error -110 whilst initialising SD card
[  339.116287] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  339.121531] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  339.127868] meson-mmc: meson_mmc_irq_thread_v3() 622: set 1st retry!
[  339.135342] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  339.140681] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  339.148002] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  339.153337] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  339.160713] meson-mmc: sd: resp_timeout,vstat:0xa1ff2800,virqc:3fff
[  339.165993] meson-mmc: sd: err: wait for irq service, bus_fsm:0x8
[  339.172282] meson-mmc: Command retried failed line:644, cmd:1
[  339.178383] meson-mmc: actual_clock :0, HHI_nand: 0x80
[  339.178390] meson-mmc: [meson_mmc_clk_set_rate_v3] after clock: 0x1000023c

How can I fix it?
Regards

And also the usb external HDD which was usually found at /dev/sda is not detected in latest release.

khadas@Khadas:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 14.6G 0 disk
mmcblk0boot0 179:32 0 4M 0 disk
mmcblk0boot1 179:64 0 4M 0 disk
mmcblk0rpmb 179:96 0 4M 0 disk
zram1 251:1 0 232.6M 0 disk [SWAP]
zram2 251:2 0 232.6M 0 disk [SWAP]
zram3 251:3 0 232.6M 0 disk [SWAP]
zram4 251:4 0 232.6M 0 disk [SWAP]

@fguerzoni I have test it just now . It work fine . The errors in dmesg does not affect use .
There is my test steps, my sd card format is ext4

[  866.699813@0] meson-mmc: card IN

khadas@Khadas:~$ ls /dev/mmcblk
mmcblk0       mmcblk0boot0  mmcblk0boot1  mmcblk0rpmb   mmcblk1
khadas@Khadas:~$ sudo mount /dev/mmcblk1 /mnt/
khadas@Khadas:~$ cd /mnt/
khadas@Khadas:/mnt$ ls
lost+found
1 Like

Thank you for testing the issue.

  • I restored the backup image based on VIM3_Ubuntu-server-bionic_Linux-4.9_arm64_EMMC_V20191231 and had no issue at all. Both SD cards detected
  • I reflashed VIM3_Ubuntu-server-focal_Linux-4.9_arm64_EMMC_V0.9-20200530 and I had some luck because I noticed that the issue appears only when HDMI cable is detached.

So to recap, in case the board has either HDMI cable or HDMI terminator, both SD cards are detected. In case HDMI connector on board is left empty both SD cards are not detected.
I don’t think the issue is related to the board because SD cards are always detected when VIM3_Ubuntu-server-bionic_Linux-4.9_arm64_EMMC_V20191231 is installed.

Please have a try and check the issue.

@fguerzoni

Ubuntu 20.04 LTS Khadas ttyS0

Khadas login: khadas
Password: 

Welcome to Fenix 0.9 Ubuntu 20.04 LTS Linux 4.9.224  
 _  ___               _            __     _____ __  __ _____ 
| |/ / |__   __ _  __| | __ _ ___  \ \   / /_ _|  \/  |___ / 
| ' /| '_ \ / _` |/ _` |/ _` / __|  \ \ / / | || |\/| | |_ \ 
| . \| | | | (_| | (_| | (_| \__ \   \ V /  | || |  | |___) |
|_|\_\_| |_|\__,_|\__,_|\__,_|___/    \_/  |___|_|  |_|____/ 
                                                             

 * Website:        https://www.khadas.com
 * Documentation:  https://docs.khadas.com
 * Forum:          https://forum.khadas.com

Last login: Wed Jun  3 04:17:18 UTC 2020 on ttyS0

khadas@Khadas:~$ uname -a
Linux Khadas 4.9.224 #29 SMP PREEMPT Sat May 30 14:20:51 CST 2020 aarch64 aarch64 aarch64 GNU/Linux
khadas@Khadas:~$ cat /etc/fenix-release 
# PLEASE DO NOT EDIT THIS FILE
BOARD=VIM3
VENDOR=Amlogic
VERSION=0.9
ARCH=arm64
INITRD_ARCH=arm64
INSTALL_TYPE=EMMC
IMAGE_RELEASE_VERSION=V0.9-20200530
khadas@Khadas:~$ [   79.835941@0] meson-mmc: card IN

khadas@Khadas:~$ sudo mount /dev/mmcblk1 /mnt/
[sudo] password for khadas: 
khadas@Khadas:~$ cd /mnt/ && ls
lost+found

@fguerzoni which foramt you used with your card ?

Hi,
both ext4 (preferred) and exFAT.
Have you tried without HDMI cable from boot?

khadas@Khadas:~$ cat /etc/fenix-release

PLEASE DO NOT EDIT THIS FILE

BOARD=VIM3
VENDOR=Amlogic
VERSION=0.9
ARCH=arm64
INITRD_ARCH=arm64
INSTALL_TYPE=EMMC
IMAGE_RELEASE_VERSION=V0.9-20200530

@Frank could you please try booting up the board without any cable attached to HDMI?
When you boot up the board with HDMI connector plugged in and then detach it, the SD card gets detected.
From my side I still confirm the issue.

@fguerzoni hello.

Look at the picture in my picture. I didn’t plug in HDMI

I didn’t get the system uptime so I’d better asked you to try to replicate exactly the scenario the make the issue appear with my board.
So what do you think about it?
How can I solve?

I recently bought 4 Vim3 boards (still not delivered by Amazon) and I would not like to buy HDMI terminators for them.
Regards

@fguerzoni Maybe you can follow up this steps to try again . I test it again just now … It work fine.

  1. SD card format to ext4 format
  2. Reburn the lastest images.
  3. Don’t attach any Hub or HMDI .
  4. Wait for the system to boot, then plugin the SD Card .
  5. Check what will print to you serial anout kernel

@Frank I replicated the same issue on a brand new vim3 basic board.
Done as suggested from point 1 to 4.
About point 5 I miss an usb serial adapter so I can’t get the log.
I’ll get it in a couple of days.
By the way, what TTL levels do the board expect?
5V or 3.3V?
Just to set the TTL output levels on the adapter.
I wonder if anyone could try on his board to collect more use cases.
Regards
F

Hello, When using a USB to serial adapter, only the TX, RX, and Ground(GND) lines need to be connected, you do not need to connect VCC.

Just for information, Khadas Docs indicates that VCC connection is made on pin 20 of the GPIO, that pin is 3.3vdc. To reiterate, I would not connect the VCC line. I never do.

@RDFTKV Thank you very much for the tips
@Frank I’ve created 2 pastebin with serial log:

  1. putty-NO-HDMI.log
  2. putty-HDMI.log
    In NO-HDMI log you’ll see that after boot and login the card is inserted but is not detected.
    In HDMI log, there’s an HDMI cable connected and the card is correctly detected.
    The issue happens on 2 different VIM3 basic boards with latest EMMC server release.
    Regards
    F

I think those errors affect use.
When I get them the card is not detected and I get:

khadas@Khadas:~$ sudo cat /sys/kernel/debug/sd/ios
[sudo] password for khadas:
clock: 0 Hz
vdd: 0 (invalid)
bus mode: 2 (push-pull)
chip select: 0 (don’t care)
power mode: 0 (off)
bus width: 0 (1 bits)
timing spec: 0 (legacy)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)

When I don’t have those errors I get;

khadas@Khadas:~$ sudo cat /sys/kernel/debug/sd/ios
[sudo] password for khadas:
clock: 50000000 Hz
actual clock: 50000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don’t care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 2 (sd high-speed)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)

which clearly explains why SD card is working or not.

What I cannot understand is how to solve the issue and why the issue is related to HDMI.

I tried also to boot from SD the following image:
VIM3_Ubuntu-server-focal_Linux-5.7-rc7_arm64_SD-USB_V0.9-20200530
but the board boots from SD just only when HDMI cable is connected.
Otherwise the board always boots from internal EMMC.

@fguerzoni I can’t reproduce your phenomenon . In my test , I don’t use HDMI. It works every time .

So I’m not very lucky :slight_smile:
each board shows the issue, both boxed and unboxed.

Once the board has booted you can unplug the HDMI and the sd card still remains available.

Do you know if there’s a way to force a mmc driver restart from the user space?