||
天嵌科技工業級i.MX6UL_B版配有4路Usb Host (2路雙層USB接口,USB2/USB4與擴展接口/4PIN排針復用,可通過電阻選擇,默認使用雙層USB接口)和1路Usb OTG;由于系統使用的是ubi文件系統。所以在對文件系統進行寫操作后,如果要斷電、復位、重啟等,請先執行sync,否則有可能寫入的數據丟失。
1、tf卡接上tf卡,系統會類似的打印以下信息:
# mmc0: host does not support reading read-only switch, assuming write-enable
mmc0: new high speed SDHC card at address 0001
mmcblk0: mmc0:0001 SD8GB 7.27 GiB
mmcblk0: p1 p2 #生成2個節點mmcblk0p1 mmcblk0p2
可以通過mount 查看卡的掛載目錄。可以像正常文件系統一樣操作卡內的文件。另外,在修改數據過后,拔出卡時請先執行sync,否則會有低概率等造成數據修改失敗。以下是筆者使用tf 啟動卡進行測試的過程:
#
# mmc0: host does not support reading read-only switch, assuming write-enable
mmc0: new high speed SDHC card at address 0001
mmcblk0: mmc0:0001 SD8GB 7.27 GiB
mmcblk0: p1 p2
EXT3-fs (mmcblk0p2): error: couldn't mount because of unsupported optional features (240)
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
EXT2-fs (mmcblk0p2): error: couldn't mount because of unsupported optional features (244)
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
# mount
ubi0:rootfs on / type ubifs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=89476k,nr_inodes=22369,mode=755)
proc on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
tmpfs on /tmp type tmpfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
sysfs on /sys type sysfs (rw,relatime)
/dev/mmcblk0p2 on /run/media/mmcblk0p2 type ext4 (rw,relatime,data=ordered)
/dev/mmcblk0p1 on /run/media/mmcblk0p1 type vfat
(rw,relatime,gid=6,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
#
# ls /run/media/mmcblk0p1
imx6ul-14x14-evk.dtb zImage
# echo 1234 > /run/media/mmcblk0p1/tmp.txt
# cat /run/media/mmcblk0p1/tmp.txt
1234
# sync
# mmc0: card 0001 removed
#
2、U盤測試U 盤的方法和SD 卡的方法一樣,只不過命令行中的mmcblk1p1 換成sda1 。
# usb 1-1.4: new high-speed USB device number 4 using ci_hdrc
usb-storage 1-1.4:1.0: USB Mass Storage device detected
scsi host1: usb-storage 1-1.4:1.0
scsi 1:0:0:0: Direct-Access SanDisk Ultra 1.00 PQ: 0 ANSI: 6
sd 1:0:0:0: [sda] 60062500 512-byte logical blocks: (30.7 GB/28.6 GiB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sda: sda1
sd 1:0:0:0: [sda] Attached SCSI removable disk
FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
# mount
ubi0:rootfs on / type ubifs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=89476k,nr_inodes=22369,mode=755)
proc on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
tmpfs on /tmp type tmpfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
sysfs on /sys type sysfs (rw,relatime)
/dev/sda1 on /run/media/sda1 type fuseblk
(rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
# ls /run/media/sda1
1G_file SanDiskSecureAccess
# usb 1-1.4: USB disconnect, device number 4
天嵌工控板i.MX6UL_B版,擁有豐富的Usb接口,可滿足客戶產品各種要求。上文介紹的測試方法您掌握了沒有?如有不明白之處請瀏覽:http://www.embedsky.com/index.php?g=home&m=news&a=show&id=37