3 3
zador.blood.stained

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.

Share this post


Link to post
Share on other sites

Thanks for the information. My recently received WLAN router also does not detect its µSD card. Could this be a batch fault of the socket manufacturer?

Share this post


Link to post
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")

Share this post


Link to post
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 :(

 

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites
3 minutes ago, ozhvankov said:

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

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=""

 

Share this post


Link to post
Share on other sites
30 minutes 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=""

 

thanx

Share this post


Link to post
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
 

 

Share this post


Link to post
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 

 

 

 

Share this post


Link to post
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 ]
 

 

 

 

 

Share this post


Link to post
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

 

Share this post


Link to post
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

Share this post


Link to post
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...
3 3