飞凌嵌入式ElfBoard ELF1板卡-开发板适配之USB转网络
其他
793 人阅读
|
0 人回复
|
2025-03-06
|
|
本节介绍如何使ELF 1开发板增加USB转网络的支持,使用USB转百兆网模块进行测试,该模块使用ASIX的USB 2.0 to 10/100M网络控制器芯片AX88772B方案实现,在Linux内核源码drivers/net/usb/中已经存在支持该芯片的驱动,所以只需在内核配置中增加此驱动编译即可。
内核配置
使用make menuconfig打开图形配置界面,添加以下配置:
Device Drivers
->Network device support
->USB Network Adapters
通过make menuconfig修改的内容写入到了.config文件,当使用make imx6ull_elf1_defconfig配置内核源码时,.config文件会被覆盖,因此,需要替换原有的imx6ull_elf1_defconfig。
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ cp .config arch/arm/configs/imx6ull_\elf1_defconfig
编译测试
编译内核并拷贝到开发板:
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ ./build.sh
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ scp arch/arm/boot/zImage root\@172.16.0.175:/run/media/mmcblk1p1/
进行sync操作后重启开发板:
使用USB连接线连接ELF 1开发板和USB转百兆网模块:
启动打印信息显示如下信息,表示模块加载成功。
asix 1-1.3:1.0 eth2: register 'asix' at usb-ci_hdrc.1-1.3, ASIX AX88772B USB 2.0 Ethernet, 00:0e:c6:87:72:01
系统启动之后,使用如下命令查看是否生成网卡设备:
root@ELF1:~# ifconfig -a
测试结果如下:
eth1 Link encap : Ethernet HWaddr ee:bb:dd:ee:ff:bb
inet addr :192.168.58.101 Bcast :192.168.58.255Mask:255.255.255.0
UP BROADCAST MULTICASTMTU :1500Metric:1
RX packets :0 errors :0 dropped :0 overruns :0 frame :0
TX packets :0 errors :0 dropped :0 overruns :0 carrier :0
collisions :0 txqueuelen :1000
RX bytes :0(0.0 B ) TX bytes :0(0.0 B )
eth2 Link encap : Ethernet HWaddr 00:0e:c6:87:72:01
BROADCAST MULTICASTMTU :1500Metric:1
RX packets :0 errors :0 dropped :0 overruns :0 frame :0
TX packets :0 errors :0 dropped :0 overruns :0 carrier :0
collisions :0 txqueuelen :1000
RX bytes :0(0.0 B ) TX bytes :0(0.0 B )
lo Link encap : Local Loopback
inet addr :127.0.0.1Mask:255.0.0.0
inet6 addr :::1/128 Scope : Host
可看到生成网卡eth2成功,然后使用网线连接模块与PC机:
现在使用ifconfig命令设置此网卡IP:
root@ELF1:~# ifconfig eth2 up
root@ELF1:~# ifconfig eth2 192.168.3.232
使用ping命令ping PC机测试(这里设置PC机IP为192.168.3.102):
root@ELF1:~# ping 192.168.3.102
PING 192.168.3.102(192.168.3.102)56(84) bytes of data.
64 bytes from 192.168.3.102: icmp seq =1 ttl =64 time =2.08 ms
64 bytes from 192.168.3.102: icmp seq =2 ttl =64 time =0.470 ms
64 bytes from 192.168.3.102: icmp seq =3 ttl =64 time =0.850 ms
64 bytes from 192.168.3.102: icmp seq =4 ttl =64 time=0.671 ms
64 bytes from 192.168.3.102: icmp seq =5 ttl =64 time =0.418 ms
64 bytes from 192.168.3.102: icmp seq =6 ttl =64 time =0.792 ms
|
|
|
|
|
|
|
|
|