Jump to content

MMC: No card present error on Allwinner boards


Recommended Posts

Symptoms:

Board does not boot Armbian from inserted SD card, but may boot other distributions (based on old/legacy u-boot).

Following or similar output can be grabbed from the serial console:

U-Boot SPL 2017.01-armbian (Feb 02 2017 - 03:04:04)
DRAM: 2048 MiB
Trying to boot from MMC1MMC: no card present
spl: mmc init failed with error: -123
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

The key message here is "MMC: no card present"

 

Most likely cause:

Malfunctioning microSD slot card detect switch.

It can be verified either visually (with a magnifying glass) or electronically (with a multimeter) - at least in the slots used on Orange Pi boards and on Pine64 the pin near the switch should be shorted to the ground (i.e. SD slot casing) when card is inserted.

 

Illustration (example) of a working switch:

card-diagram.png.1395000f904a007461ffa9b301740947.png

 

Verification (with a multimeter):

Probe 1 - slot pin near the switch (may be different for different slot types, but at least true for Oranges and Pine64)

Probe 2 - microSD slot casing or other parts connected to GND (not shown on the photo)

 

IMG_20170402_231506.png.4f8655e64dfe3ccbc36c9d1fe4a979e5.png
 

 

No card - circuit is open

Card inserted - circuit is shorted

 

Photos - card is not inseted on the left and is fully inserted on the right:

Orange Pi

 

 


IMG_20170402_215534.png.9911a0f1ee97769fd699be0634b14fe6.png
 

 

 

Pine64 (switch is more visible)

 

 


IMG_20170402_220259.thumb.png.cb67f1b8a3084fa939a37a4e3078a4db.png
 

 

 

Can it be fixed?

Yes if the switch is not broken completely, by carefully adjusting (bending) the stationary contact (left on the pictures and photos, it usually is a part of the SD slot casing) i.e using a needle so it touches the moving contact (mostly hidden inside the slot on the photos) when card is inserted and not touching it when it is not inserted.

Link to comment
Share on other sites

Just now, Slackstick said:

Could this be a batch fault of the socket manufacturer?

It could be just that the parts of the switch bend too much when you either push too hard when inserting/removing cards or just leave the card constantly inside.

But it also could be a batch fault or issues when grabbing/soldering the slot during board manufacturing.

In either case this fault can be easily and reliably checked if there are any doubts (I still need to edit the explanation about the "pin near the switch")

Link to comment
Share on other sites

Important, small bit of info. Cheers for any frustration this might save others.

 

"...at least in the slots used on Orange Pi board"... is an important detail too because I don't think this is necessarily the case with (at least) NanoPi NeoAir boards.

 

I ordered a batch a while back and two had a faulty switch upon arrival. The fault prevented one SD card from fully engaging and prevented another from even ejecting. I absolutely didn't like the idea of potentially not being able to remove 32GB Micro SD cards  (not to mention SD/NAND swapping was crucial to project) so I went ahead and removed the spring action arm, which in both cases were visibly defective and nand-sata-install still works like a charm. They just don't 'shoot' out like they used to :(

 

Link to comment
Share on other sites

Hi!

does anyone know how to disable a card detection switch check function in the u-boot 

 

My custom board  based on (nano pi m1+) contains a 8-pin SD-card connector
and does not have a PIN for card validation 

 

my sd-card connector is :

500901-0801-yUm5xGnT-YoWEJaraZ.jpg

 

 

thanx for any info's

 

Link to comment
Share on other sites

21 hours ago, zador.blood.stained said:

By adding this to the u-boot defconfig for your device (or making a patch for an existing one that you use)


CONFIG_MMC0_CD_PIN=""

Hello again

I tried to make changes in different ways
1) directly to the "cache" - it is unsuccessful, it is updated every time right on build process.
2) try to used ".gitignore" , unsuccessful .   ".gitignore" updated every time right on build process too.

3) disconnected the Internet for a virtual machine so that it does not update the cache - as a result, the build process does not go well at all

 

read several sections

https://docs.armbian.com/Developer-Guide_Build-Process/

and thought that the best way would be to use -"userpatches/u-boot" put your u-boot patches here.
maybe I'm wrong ...  
ok, but how to make it , there are I can to read about format armbian patch for special board ?

I have experience in applying patches to the linux kernel
But I do not know how the  armbian build system works in detail. 

with respect to the u-boot of a specific board.

My question is: How to make userpatches/u-boot for special board?
There are I can to read about it or see example 

 

thanks
 

 

Link to comment
Share on other sites

On 12.11.2017 at 6:55 PM, zador.blood.stained said:

Assuming you are using NanoPi M1+ build target without changes you need to create a patch to nanopi_m1_plus_defconfig and put it to userpatches/u-boot/u-boot-sunxi

You may need to adjust it if it conflicts with other build system patches that adjust default cpu or dram frequency

 

good afternoon again
and so I did everything as recommended several times (more than 10 attempts)

 

step by step 

cp cache/sources/u-boot/v2017.09/.config userpatches/u-boot/u-boot-sunxi/.config 

cp  cache/sources/u-boot/v2017.09/u-boot.cfg userpatches/u-boot/u-boot-sunxi/u-boot.cfg 

 

                                    copy to  different places too

 

nano (vi) userpatches/u-boot/u-boot-sunxi/.config and remove PF6 from next string

nano (vi)  cache/sources/u-boot/v2017.09/u-boot.cfg  and remove PF6 from next string

 

CONFIG_MMC0_CD_PIN="PF6" > CONFIG_MMC0_CD_PIN=""

 

 

then need to make patch 

 (diff -u)

actualy I'm used diff -Naur

diff -Naur cache/sources/u-boot/v2017.09/.config userpatches/u-boot/u-boot-sunxi/.config > .config.patch
diff -Naur cache/sources/u-boot/v2017.09/u-boot.cfg userpatches/u-boot/u-boot-sunxi/u-boot.cfg > u-boot-cfg.patch
 

ok 

.config.patch and u-boot-cfg.patch
--- cache/sources/u-boot/v2017.09/.config       2017-11-19 20:19:49.108251112 +0300
+++ userpatches/u-boot/u-boot-sunxi/.config     2017-11-19 20:29:33.164122999 +0300
@@ -184,7 +184,7 @@
 # CONFIG_UART0_PORT_F is not set
 CONFIG_OLD_SUNXI_KERNEL_COMPAT=y
 CONFIG_MACPWR=""
-CONFIG_MMC0_CD_PIN="PF6"
+CONFIG_MMC0_CD_PIN=""
 CONFIG_MMC1_CD_PIN=""
 CONFIG_MMC2_CD_PIN=""
 CONFIG_MMC3_CD_PIN=""

 


--- cache/sources/u-boot/v2017.09/u-boot.cfg    2017-11-19 20:19:50.268831070 +0300
+++ userpatches/u-boot/u-boot-sunxi/u-boot.cfg  2017-11-19 20:29:44.505791000 +0300
@@ -5,7 +5,7 @@
 #define CONFIG_SYS_CLK_FREQ 1008000000
 #define CONFIG_SUNXI_GEN_SUN6I 1
 #define CONFIG_CMD_ITEST 1
-#define CONFIG_MMC0_CD_PIN "PF6"
+#define CONFIG_MMC0_CD_PIN ""
 #define CONFIG_BOOTM_VXWORKS 1
 #define CONFIG_MACH_SUN8I_H3 1
 #define CONFIG_MMC_SUNXI_SLOT 0
 

 

and finaly 

./compile.sh

 

chose any board like  nano pi ... banana pi ... 

 

but  then start to compile

logs 

[ o.k. ] Started patching process for [ u-boot sunxi-nanopim1-next ]
[ o.k. ] Looking for user patches in [ userpatches/u-boot/u-boot-sunxi ]
[ warn ] * [c] .config.patch [ failed ]

...

[ o.k. ] * [l][c] sun8i-set-machid.patch 
[ o.k. ] * [l][c] sunxi-boot-splash.patch 
[ warn ] * [c] u-boot-cfg.patch [ failed ]
 

 

what am I doing wrong ???

thanx 

 

 

 

Link to comment
Share on other sites

On 12.11.2017 at 6:55 PM, zador.blood.stained said:

Assuming you are using NanoPi M1+ build target without changes you need to create a patch to nanopi_m1_plus_defconfig and put it to userpatches/u-boot/u-boot-sunxi

You may need to adjust it if it conflicts with other build system patches that adjust default cpu or dram frequency

thank U for correct but 

 

 

--- cache/sources/u-boot/v2017.09/configs/nanopi_m1_plus_defconfig      2017-11-19 21:37:45.569125867 +0300
+++ nanopi_m1_plus_defconfig    2017-11-19 22:04:59.961912277 +0300
@@ -4,7 +4,7 @@
 CONFIG_DRAM_CLK=576
 CONFIG_DRAM_ZQ=3881979
 CONFIG_DRAM_ODT_EN=y
-CONFIG_MMC0_CD_PIN="PH13"
+CONFIG_MMC0_CD_PIN=""
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-m1-plus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 

 

 

 

[ o.k. ] Started patching process for [ u-boot sunxi-nanopim1plus-next ]
[ o.k. ] Looking for user patches in [ userpatches/u-boot/u-boot-sunxi ]
[ warn ] * [c] nanopi_m1_plus_defconfig.orig.patch [ failed ]
[ warn ] * [c] nanopi_m1_plus_defconfig.patch [ failed ]
 

 

 

 

 

Link to comment
Share on other sites

3 minutes ago, ozhvankov said:

--- cache/sources/u-boot/v2017.09/configs/nanopi_m1_plus_defconfig      2017-11-19 21:37:45.569125867 +0300
+++ nanopi_m1_plus_defconfig    2017-11-19 22:04:59.961912277 +0300

You have wrong file paths in this patch, it needs to be done relative to the u-boot repository root, so file paths should be "a/configs/nanopi_m1_plus_defconfig" and "b/configs/nanopi_m1_plus_defconfig" - check existing patches in the repository for examples: https://github.com/armbian/build/tree/master/patch/u-boot/u-boot-sunxi

 

Link to comment
Share on other sites

thanx

 

all good - right patch like this 

 

--- a/configs/nanopi_m1_plus_defconfig      2017-11-19 21:37:45.569125867 +0300
+++b/configs/nanopi_m1_plus_defconfig    2017-11-19 22:04:59.961912277 +0300
@@ -4,7 +4,7 @@
 CONFIG_DRAM_CLK=576
 CONFIG_DRAM_ZQ=3881979
 CONFIG_DRAM_ODT_EN=y
-CONFIG_MMC0_CD_PIN="PH13"
+CONFIG_MMC0_CD_PIN=""
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-m1-plus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set

Link to comment
Share on other sites

On power plug on, there's no problem. But after boot up and reset, sometimes error occurred in some specific sd card.

Boot error message is like this.

 

U-Boot SPL 2018.11-armbian (Feb 08 2019 - 11:33:45 +0100)
DRAM: 512 MiB
Trying to boot from MMC1
spl: mmc init failed with error: -110
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

 

 

It looks like same problem as this.

https://github.com/RobertCNelson/armv7-multiplatform/issues/25

 

How can I increase mmc power up time for sd card? My environment is kernel 4.19.38 on Orange Pi Zero.

 

Link to comment
Share on other sites

I have getting something similar :(

 

```

U-Boot SPL 2020.04-armbian (Jun 15 2020 - 04:07:06 +0200)
DRAM: 1024 MiB
Trying to boot from MMC1
MMC: no card present
spl: mmc init failed with error: -123
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

```

Now I cannot even boot into other os. Only the one on the emmc and I was just testing. Can anyone advice what is causing this ? I think it must be hardware issue.

 

Thanks for the information above. Looks like my pin isn't working patching the uboot with the given config fixed the boot process but still it is not able to read the card further.

```

U-Boot 2020.04-2 (Jun 21 2020 - 22:22:21 +0000) Manjaro ARM

CPU:   Allwinner H5 (SUN50I)
Model: FriendlyARM NanoPi NEO Plus2
DRAM:  1 GiB
MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
Loading Environment from FAT... Unable to use mmc 1:0... In:    serial
Out:   serial
Err:   serial
Net:   phy interface7
eth0: ethernet@1c30000
starting USB...
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
Bus usb@1c1d000: USB EHCI 1.00
Bus usb@1c1d400: USB OHCI 1.0
scanning bus usb@1c1a000 for devices... 1 USB Device(s) found
scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
scanning bus usb@1c1d000 for devices... 1 USB Device(s) found
scanning bus usb@1c1d400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
MMC: no card present
switch to partitions #0, OK
mmc1(part 0) is current device
** No partition table - mmc 1 **

Device 0: unknown device
ethernet@1c30000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17

Retry time exceeded; starting again
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-02-01-45-1c-d4-60
ethernet@1c30000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
*** ERROR: `serverip' not set
missing

environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
ethernet@1c30000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
ethernet@1c30000 Waiting for PHY auto negotiation to complete.......

```

 

So mmc was not initiating :(

Then I pressed the metal casing against the pin to make it touch the base pic and not the moving pin and now It can read the sd card fine.


Hope this wont break again. This thread was so helpful without it user might have been thinking that is some hardware issue with the boards sd card slot.

 

Thanks Again.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines