AnsweredAssumed Answered

imx sdcard post-boot weirdism

Question asked by Edward Tyrrell on Mar 28, 2017
Latest reply on Mar 29, 2017 by Edward Tyrrell

Hello,

 

I have a very strange issue with mounting a sdcard if the board has been booted without one inserted. The board is an imx7 custom board based of the sabresd7 development board and running  4.1.32 Yocto Krogoth.

 

The sdcard regarding this issue is only used for AV media files once booting is finished. The board itself boots off NV.

 

The issue:

1) If the media sdcard is inserted before booting the board everything is fine. After the booting has completed scripts mount the sdcard onto /media/sdcard - everything works and runs fine. I can insert various cards with varying media and ls /media/sdcard will list the media accordingly per card. Whether I manually mount or fstabs mount all is fine.

 

2)This is where things misbehave. If the AV media sdcard is left out during boot then after booting any of the previous  cards "appear" to mount and umount same as before. BUT irrespective of the media file on the sdcard

 ls /media/sdcard always returns imx7.dtb and zImage. These two files clearly are not on the card. Every card has been formatted with only a single partition containing the AV media.  

 

What is interesting are the results from fdisk -l  ( before mounting the card after boot/login ) If the card is inserted before booting then fdisk -l will show the card as:  

Disk /dev/mmcblk1: 127.8 GB, 127865454592 bytes
255 heads, 63 sectors/track, 15545 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device                      Boot    Start   End          Blocks           Id     System
/dev/mmcblk1p1                  3         15546      124852224      7     HPFS/NTFS

 

However, if the sdcard is not inserted before and during the boot process, but after booting has completed then inserted,  fdisk -l returns:

 

Disk /dev/mmcblk2rpmb: 127.8 GB, 127865454592 bytes
255 heads, 63 sectors/track, 15545 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device                         Boot    Start       End          Blocks          Id      System
/dev/mmcblk1p1                     65           192           8192              c       Win95 FAT32 (LBA)
/dev/mmcblk1p2                     93            6080        376832          83      Linux

 

The two tests above are using the exact same sdcard for each scenario but clearly the results are wildly different.  

No matter how many cards or the number of times the media sdcards are mounted and umounted after booting without a card, the "ls /medial/sdcard" is always the same => imx7.dtb and zImage.

Could this be a device tree issue when booting with an empty sdcard slot? Is the driver making a few assumptions and somehow linking over to the zImage and dtb files which are obviously on the board somewhere?

 

Please help!

Outcomes