多语言展示
当前在线:1752今日阅读:162今日分享:23

天嵌i.MX6UL开发平台存储设备的测试方法

天嵌i.MX6UL_B版配有4路Usb Host (2路双层USB接口,USB2/USB4与扩展接口/4PIN排针复用,可通过电阻选择,默认使用双层USB接口)和1路Usb OTG;由于系统使用的是ubi文件系统。所以在对文件系统进行写操作后,如果要断电、复位、重启等,请先执行sync,否则有可能写入的数据丢失。
工具/原料
1

天嵌i.MX6UL开发板baseB

2

个人电脑

3

TF卡和U盘

方法/步骤
1

接上tf卡,系统会类似的打印以下信息:# mmc0: host does not support reading read-only switch, assuming write-enablemmc0: new high speed SDHC card at address 0001mmcblk0: mmc0:0001 SD8GB 7.27 GiBmmcblk0: p1 p2 #生成2个节点mmcblk0p1 mmcblk0p2

2

可以通过mount 查看卡的挂载目录。可以像正常文件系统一样操作卡内的文件。另外,在修改数据过后,拔出卡时请先执行sync,否则会有低概率等造成数据修改失败。以下是笔者使用tf 启动卡进行测试的过程:## mmc0: host does not support reading read-only switch, assuming write-enablemmc0: new high speed SDHC card at address 0001mmcblk0: mmc0:0001 SD8GB 7.27 GiBmmcblk0: p1 p2EXT3-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 completeEXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)# mountubi0: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/mmcblk0p1imx6ul-14x14-evk.dtb zImage# echo 1234 > /run/media/mmcblk0p1/tmp.txt# cat /run/media/mmcblk0p1/tmp.txt1234# sync# mmc0: card 0001 removed#

3

测试U盘的方法和SD卡的方法一样,只不过命令行中的mmcblk1p1 换成sda1 。# usb 1-1.4: new high-speed USB device number 4 using ci_hdrcusb-storage 1-1.4:1.0: USB Mass Storage device detectedscsi host1: usb-storage 1-1.4:1.0scsi 1:0:0:0: Direct-Access SanDisk Ultra 1.00 PQ: 0 ANSI: 6sd 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 offsd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUAsda: sda1sd 1:0:0:0: [sda] Attached SCSI removable diskFAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.# mountubi0: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/sda11G_file SanDiskSecureAccess# usb 1-1.4: USB disconnect, device number 4

注意事项

在对文件系统进行写操作后,如果要断电、复位、重启等,请先执行sync,否则有可能写入的数据丢失

推荐信息