1 修改兼容性和速度
lichee/brandy-2.0/u-boot-2018/common/usb_storage.c
blk = USHRT_MAX; (USHRT_MAX越小兼容性越好但速度会降低)
2 配置挂载目录
package/allwinner/mtp/src/main.c
static mtp_storage_t gStorageArray[] = {
{NULL, 65537, "/mnt/UDISK", "Tina存储设备", 0, 0},
//{NULL, 65537, "/mnt/exUDISK", "Tina存储设备", 0, 0},
//{NULL, 65539, "/boot", "boot", 0, 0},
//{NULL, 65540, "/boot-res", "boot-res", 0, 0},
//exUDISK
};
3 配置内核:
// U盘
Enable the block layer --->
Partition Types --->
[*] PC BIOS (MSDOS partition tables) support
// USB摄像头
Device Drivers --->
<*> Multimedia support --->
[*] Media USB Adapters --->
<*> USB Video Class (UVC)
[*] UVC input events device support
4 设备树:
reg_usb0_vbus: usb0-vbus {
compatible = "regulator-fixed";
// 引脚修改
gpio = <&pio PF 4 1 2 0 0>; /* 修改对应管脚号 */
regulator-name = "usb0-vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
enable-active-high;
};
reg_usb1_vbus: usb1-vbus {
compatible = "regulator-fixed";
// 引脚修改
gpio = <&pio PF 3 1 2 0 1>; /* 修改对应管脚号 */
regulator-name = "usb1-vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
enable-active-high;
};
5 相关命令
编号 | 命令 | 说明 |
---|---|---|
1 | df -h | 用df –h查看文件系统的磁盘空间占用情况 |
2 | sudo mkfs.ntfs /dev/sda1 -f | mount报错NTFS signature is missing 解决这个问题 |
3 | cat proc/partitions | 查看设备信息 |
4 | find -name "fstab" | 搜索./etc/config/fstab |
5 | cat /proc/bus/input/devices | 查看当前可输入设备 |
6 | hexdump /dev/input/event1 | 验证设备输入 |
7 | time dd if=/dev/zero of=/mnt/exUDISK/test.bin bs=1MB count=1024 time dd if=/mnt/exUDISK/test.bin of=/dev/null bs=1MB count=1024 |
测试USB读写性能(/mnt/exUDISK/ 这里是USB挂载目录) |
8 | echo 0 > sys/devices/platform/soc/5200000.ehci1‑controller/ehci_enable echo 0 > sys/devices/platform/soc/5200000.ohci1‑controller/ohci_enable |
0:卸载主机驱动<br />1:加载主机驱动 |
// USB hub驱动位置
lichee/linux-4.9/drivers/usb/core/hub.c
(1)USB其他问题 - 修改挂载信息
target/allwinner/r818-evb1/base-files/etc/config/fstab
config 'mount'
option target '/mnt/exUDISK2'
option device '/dev/sdb1'
option options 'rw,async,noatime'
option enabled '1'config 'mount'
option target '/mnt/exUDISK2'
option device '/dev/sdb'
option options 'rw,async,noatime'
option enabled '1'
(2)修改系统默认生成文件夹位置 需要同名添加
package/base-files/Makefile
mkdir -p $(1)/mnt/exUDISK2
//修改系统默认生成文件夹位置 需要同名添加
package/busybox-init-base-files/Makefile
mkdir -p $(1)/mnt/exUDISK2
// 解决两个NTFS 文件系统格式的只能挂载一个的问题
package/system/fstools/files/mount.hotplug
sdb*)
mkdir -p /mnt/exUDISK2
/usr/bin/ntfs-3g /dev/${DEVNAME} /mnt/exUDISK2 -o rw,noatime,nodiratime,nosuid,nodev
exit
;;
6 关闭 Debug 功能,否则会打印很多调试信息,影响正常使用;
#lichee/linux-4.9/drivers/net/wireless/rtl8821cs/Makefile
########################## Debug ###########################
CONFIG_RTW_DEBUG = n
# default log level is _DRV_INFO_ = 4,
# please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
CONFIG_RTW_LOG_LEVEL = 4
网友评论