eMMC with multiple partition and SD card mounting issue with i.MX6 Yocto

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eMMC with multiple partition and SD card mounting issue with i.MX6 Yocto

Jump to solution
3,605 Views
Alankar
Contributor II

We are facing one issue with SD card implementation with i.MX6 series Yocto development. Following is the summary

We are using Yocto Morty (2.2.2) Release BSP 

For i.MX6UL (Our own custom hardware), Following is the system storage structure

we have used SDHC1 for SD card and SDHC2 for eMMC.

  1. SD card is probed on mmc0 and eMMC is probed on mmc1
  2. We have 4 partitions on eMMC as follows
    1. Yocto vfat for dtb and kernel (mmcblk1p1)
    2. Yocto ext4 for rootfs (mmcblk1p2)
    3. User ext4 for user application (mmcblk1p3)
    4. User ext4 for user application recovery (mmcblk1p4)
  3. For SD card we generally use with one FAT32 partition for USER data storage, tried with ext4 also

 

Issue definition:

After programming the eMMC first time (using our customised mfgtool to create partition table and download), when we power up the device (SD card not inserted), all the eMMC partitions are getting mounted and seen in the OS properly. After this if power cycle the device with SD card inserted this time, kernel detects the SD card but somehow do not mount any of partitions of eMMC, it still manages to boot kernel and the rootfs, but I don’t see anything mounted in /run/media.

Now if I again power cycle the device with SD card removed, everything works fine again. Same thing happens when I initial power up the device (first OS power up after programming) with SD card inserted. So this time if power cycle the device with SD card removed, it again messes with the eMMC partition.

 

So I get on debugging and found that, udev actually creates cache.data file in /etc/udev at first power up and follows whatever storage structure it finds at first power up, and if udev detects any change in it, it misbehaves. So it has to do something with udev. I read somewhere that udev has some rules on ADD and REMOVE devices, but could not get clear idea.

Above same thing happens with i.MX6 Solo processor (Our own custom hardware) also, we use same Yocto build for i.MX6 Solo too... For i.MX6 Solo, we have used SDHC2 for SD card and SDHC4 for eMMC.

Can somebody please help...

Labels (5)
0 Kudos
1 Solution
2,638 Views
Alankar
Contributor II

Disabling udev cache resolved this issue

thanks

View solution in original post

0 Kudos
3 Replies
2,638 Views
b36401
NXP Employee
NXP Employee

Please note that accordingly to eMMC specifications boot partition size is fixed during production.
Its size is defined in EXT_CSD structure of the eMMC.
So please make sure that you does not touch boot partition during updating partitions.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
2,638 Views
Alankar
Contributor II

Hello Victor, yes you are correct, i have not touched to the boot partition...

One more observation i have is, after bootup in above case when the eMMC partitions are not mounted by udev, if i delete the chache.data file from /etc/udev and reboot the device, this time at bootup udev creates new cache file and able to mount all the partitions for eMMC and SD card as well. this is something related to udev rules. but still could not get what exactly i need to do to resolve  this...

Anybody's help is really appreciated... 

0 Kudos
2,639 Views
Alankar
Contributor II

Disabling udev cache resolved this issue

thanks

0 Kudos