【触觉智能 Purple Pi开发板试用】+04.存储介质测试(zmj)
Purple Pi开发板除了J12排针提供的丰富GPIO接口,还包括J4的TF卡接口和J5的USB2.0接口。
本节主要测试Purple Pi开发板的J4/J5接口做存储介质的测试。
1. TF接口J4
开发板已经默认加载了SD卡驱动,插上TF卡后,在系统中会出现节点/dev/mmcblk1p1(如TF有多个分区,则会出现多个/dev/mmcblk1px),同时支持标准MicroSD存储卡,支持FAT,EXT等文件系统,开发板的TF卡对应接口位于J4。
插入SD卡后,系统会默认把SD卡,挂载到**/sdcard**目录下。
1.1 插拔检测
将SD卡插入卡槽中,系统会提示以下信息:
mmc1: new high speed SDHC card at address 0007
mmcblk1: mmc1:0007 SD32G 29.0 GiB
mmcblk1: p1 p2
FAT-fs (mmcblk1p2): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
FAT-fs (mmcblk1p1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
FAT-fs (mmcblk1p2): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
拔出SD卡,系统会提示以下信息:
mmc1: card 0007 removed
[Padmux]reset Pad_51(reg 0x101e08; mask0x300) to GPIO(org: SDIO_MODE_1)
1.2 读写测试
通过time计时读写文件所花时间,然后计算得出读写速率。
time dd if=/dev/zero of=/sdcard/test bs=1M count=500 conv=fsync
WR写TF卡速率:500MB/49.06s=10.19MB/s
time dd if=/sdcard/test of=/dev/null bs=1M count=500
RD读TF卡速率:500MB/27.17s=18.40MB/s
2. U盘测试
开发板已经默认加载了USB2.0驱动,插上U盘后,在系统中会出现节点/dev/sda1(如U盘有多个分区,则会出现多个/dev/sdax)。开发板的USB对应接口位于J5。
插入U盘后,系统会默认把U盘挂载到**/udisk**目录下。
2.1 插拔检测
插入U盘,系统会提示以下信息:
==20180309==> hub_port_init 1 #0
Plug in USB Port2
usb 1-1: new high-speed USB device number 2 using Sstar-ehci-2
usb 1-1: New USB device found, idVendor=05e3, idProduct=0749
usb 1-1: New USB device strings: Mfr=3, Product=4, SerialNumber=2
usb 1-1: Product: USB3.0 Card Reader
usb 1-1: Manufacturer: Generic
usb 1-1: SerialNumber: 000000001532
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access Generic STORAGE DEVICE 1532 PQ: 0 ANSI: 6
sd 0:0:0:0: [sda] 60751872 512-byte logical blocks: (31.1 GB/29.0 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sda: sda1 sda2
sd 0:0:0:0: [sda] Attached SCSI removable disk
FAT-fs (sda1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
FAT-fs (sda2): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
FAT-fs (sda2): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
拔出U盘,系统会提示以下信息:
usb 1-1: USB disconnect, device number 2
root hub reinitial [usbdis]
2.2 读写测试
通过time计时读写文件所花时间,然后计算得出读写速率。
time dd if=/dev/zero of=/udisk/test bs=1M count=500 conv=fsync
WR写U盘速率:500MB/19.76s=25.30MB/s
time dd if=/udisk/test of=/dev/null bs=1M count=500
RD读U盘速率:500MB/14.60s=34.25MB/s
//------END