2

Busybox Linux running on an ARM Cortex A7 processor from NXP.

The board has an SD card slot and also an eMMC chip that can be used for storage. The device is booting from nor flash.

Strangely, when the SD card is inserted, we cannot mount the eMMC drive and we get a partition missing error. After a reboot the problem goes away. Removing the SD card has the same sort of issue but this time we cannot mount the eMMC partition and get a failed to mount error.

So this got us to thinking that the eMMC device was being confused with the SD card when mounting the eMMC failed.

If you run udevadm info -a -n /dev/mmcblk2 (mmcblk2 is the eMMC device) in the failing scenario we get:

ATTRS{type}=="SD"

But when the mount works we get reported as:

ATTRS{type}=="MMC"

So we suspect that the OS is confusing the SD card device for the MMC device.

Can I force ATTRS{type}=="MMC"?

If so how would I do that?

Or is there a better alternative way to fix this?

additional notes

dmesg when we can't mount eMMC partition 1
[    1.981630] mmc2: MAN_BKOPS_EN bit is not set
[    1.996222] usb 2-1: new high-speed USB device number 3 using ci_hdrc
[    2.003347] mmc2: new DDR MMC card at address 0001
[    2.004444] mmcblk2: mmc2:0001 R1J57L 13.8 GiB 
[    2.006353] mmcblk2boot0: mmc2:0001 R1J57L partition 1 16.0 MiB
[    2.006672] mmcblk2boot1: mmc2:0001 R1J57L partition 2 16.0 MiB
[    2.006912] mmcblk2rpmb: mmc2:0001 R1J57L partition 3 128 KiB
[    2.010135]  mmcblk2: p1

dmesg when mounting of eMMC works:

[    1.852533] mmc2: new DDR MMC card at address 0001
[    1.853202] mmcblk2: mmc2:0001 R1J57L 13.8 GiB 
[    1.853364] mmcblk2boot0: mmc2:0001 R1J57L partition 1 16.0 MiB
[    1.853544] mmcblk2boot1: mmc2:0001 R1J57L partition 2 16.0 MiB
[    1.853697] mmcblk2rpmb: mmc2:0001 R1J57L partition 3 128 KiB
[    1.856437]  mmcblk2: p1

difference is that in non-working get: mmc2: MAN_BKOPS_EN bit is not set. BKOPS is background operations - an eMMC performance feature. No idea how linked with this issue.

lsblk:

NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk2rpmb  179:32   0  128K  0 disk 
mmcblk2boot0 179:16   0   16M  1 disk 
mmcblk2boot1 179:24   0   16M  1 disk 
mmcblk0      179:0    0  3.8G  0 disk 
`-mmcblk0p1  179:1    0  3.8G  0 part 
mmcblk2      179:8    0 13.8G  0 disk 
`-mmcblk2p1  179:9    0 13.8G  0 part 

mmcblk2 is the eMMC and mmcblk0 is the SD-card.

running udevadm info on mmcblk0, the SD-card.

udevadm info -a -n /dev/mmcblk0
ATTRS{type}=="SD"
2
  • Do you use the eMMC in 8-bit-mode? (Because otherwise what is the difference between MMC and SD anyhow?) How are your interfaces configured, DeviceTree? What does dmesg say on SDcard insert and eject? Commented Oct 11, 2019 at 12:03
  • @Philippos unfortunately we cannot add/remove sd-card while running. Commented Oct 11, 2019 at 12:48

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.