am335x usb linux配置,AM335X Usb 配置设备 RNDIS

首先:打开linux 内核配置菜单:

$ make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm menuconfig

在主菜单选择 Device Drivers

...

...

Power management options --->

[ ] Networking support --->

Device Drivers --->

File systems --->

Kernel hacking --->

...

...

如下图选择USB support

...

...

Sound card support --->

[*] HID Devices --->

[*] USB support --->

MMC/SD/SDIO card support --->

...

...

进入USB Gadget Support菜单

...

...

< > USB YUREX driver support

USB Gadget Support --->

*** OTG and related infrastructure ***

< > GPIO based peripheral-only VBUS sensing 'transceiver'

...

...

如下所示选择Inventra HDRC USB Peripheral

...

...

(2) Maximum VBUS Power usage (2-500 mA)

(2) Number of storage pipeline buffers

USB Peripheral Controller (Inventra HDRC USB Peripheral (TI, ADI, ...)) --->

< > USB Gadget Drivers

...

...

如下所示选择Ethernet Gadget

...

...

USB Peripheral Controller (Inventra HDRC USB Peripheral (TI, ADI, ...)) --->

< > USB Gadget Drivers

...

Ethernet Gadget (with CDC Ethernet support)

[*] RNDIS support

[ ] Ethernet Emulation Model (EEM) support

...

...

注意:

一定要选择"RNDIS support"

设置完毕后需要make modules 以便生成g_ether.ko驱动

然后将生成的镜像文件下载到开发板中。

进入板子的文件系统,加载该驱动:insmod g_ether.ko

此时RNDIS驱动会生成网络设备usb0(/dev/usb0),为了能正常的通信可以设置ip地址及其掩码:

ifconfig usb0 netmask255.255.255.0 up

此时就可以正常的通信工作,测试可以使用:

ping -I  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值