Skip to main content

U盘挂载

一 功能简介

本开发板支持U盘挂载, USB通过IO/USB_SW(PB05) , 控制主从切换 , 见原理图:

1

二 软件配置

2.1 设备文件系统配置

打开iconfigtool配置页面

以RD_AD100_EVB_V1.0开发板为例 , 使用ad100_nor_defconfig配置 , 实际根据硬件需要配置

2

3

2.2 USB驱动配置

4

5

三 编译和烧录

 bhu@bhu-PC:~/rtos$ cd freertos                      
bhu@bhu-PC:~/rtos/freertos$  source build/envsetup.sh        //第一次编译需要初始化编译环境
bhu@bhu-PC:~/rtos/freertos$ make ad100_nor_defconfig
bhu@bhu-PC:~/rtos/freertos$ make
bhu@bhu-PC:~/rtos/freertos$ ls rtos-with-spl.bin 
rtos-with-spl.bin //编译出来的文件

请使用最新版烧录工具

ubuntu版本烧录工具请下载

windows版本烧录工具请下载

烧录配置

6

7

8

四 测试验证

$ [22.753105] ++OTG Interrupt gotgint=80000 [a_host]
[22.753277] ++OTG Interrupt: Debounce Done++
[22.901086] new high speed USB device using and address 2 //插入u盘,新增设备打印
[23.062734] New USB device devnum 2, busnum 1
[23.062891] New USB device found, idVendor=ffff, idProduct=5678
[23.063108] New USB device strings: Mfr=1, Product=2, SerialNumber=3
[23.063341] Product: Disk 2.0
[23.063444] Manufacturer: USB
[23.063548] SerialNumber: 4526971256615384643
[23.063705] configuration #1 chosen from 1 choice
[23.063908] devnum 2: adding (config #1, interface 0)
[23.064101] Transport: Bulk
[23.064203] Protocol: Transparent SCSI
[23.064398] USB Mass Storage Max LUN 0
[23.064872] Vendor: VendorCo
[23.064977] Product: ProductCode
[23.065114] Version: 2.00
[23.065211] Type: Direct-Access ANSI SCSI revision: 04
[23.065431] Removable: 1
[23.065914] Block Size 512, Block Count 122880000
[23.067938] MBR partition
$ ls
Type/Size Name
<DIR> sys
<DIR> udisk0p0 //u盘设备名
$ [126.775396] USB disconnect, address 2 //u盘拔出
[127.775361] ++OTG Interrupt gotgint=40000 [a_host]
[127.775537] ++OTG Interrupt: A-Device Timeout Change++