Edit online

RTL8189 调试指南

3 Mar 2025
Read time: 3 minute(s)

本章节讲解如何在 Luban-Lite 系统中配置 SDIO 接口的 RTL8189 无线网络模块。

配置 SDMC 接口和 WiFi 模组

使用 SDMC 接口前,选中对应的 SDMC 接口,以 D133CBV-QFN88 开发板为例,使用 scons --meunconfig 命令,配置下列内容:

Board options
    [ * ] Using SDMC0                                    # 硬件连接哪个 SDMC 接口,选择哪个SDMC
     -*-  Enable the interrupt of SDMC
          SDMC1 Parameter  --->
             Select SDMC1 BUSWIDTH (sdmc 4-bit mode)  --->
            [ ] Using SDcard hotplug detection (NEW)
            [*] SDMC1 connect to a SDIO device
            (3) SDMC1 driver phase (NEW)
            (0) SDMC1 sample phase (NEW)
            (100000000) SDMC1 CMU clock frequency (NEW)
    [ * ] Using Wireless lan --->
        [ * ] Using Realtek wlan driver --->
            Select Realtek wlan0 modul (rtl8189)--- >    # 以 RTL8189 为例
            Realtek wlan0 paramete --->
                (PD.7) realtek wlan0 power on gpio
                (192.168.3.20) wlan0 ip addr
                (192.168.3.1) wlan0 gateway addr
                (255.255.255.0) wlan0 netmask
                [*] Enable Realtek driver debug information

配置 lwIP

使用 scons --menuconfig 命令进入配置页面,配置如下:

Local packages options --->
    Third-party packages options --->
    LwIP: light weight TCP/IP stack
        [*]   LwIP Examples  --->
        [*]   Using net tools
        [*]   Enble DNS for name resolution
        [*]   Enable alloc ip address through DHCP
        [*]   Enable ping features  --->

配置内核

Rt-Thread options --->
    RT-Thread Kernel --->
        (4)    The priority level value of timer thread
        (4096) The stack size of timer thread
    RT-Thread Components --->
        Device Drivers --->
            (4096) The stack size for sdio irq thread
            (5)   The priority level value of sdio irq thread
警告: 完成内核配置后,如出现类似 d13x_os.itb file_size: 0x216800 is over much than part_size: 0x200000 的结果,则调整 OS 分区并使用 mb 命令重新编译 BootLoader 和 RTT。

测试命令

完成所有配置后,保存退出,编译、烧录。待系统启动后,可执行如下命令进行验证:

wlan wifi_on
wlan wifi_scan

wlan wifi_connect SSID PASSWORD  // 连接wifi

dhcpc WL0 start  // 获取IP

ifconfig // 查看当前网卡IP及网关IP

ping 192.168.1.1  // 假设网关IP为192.168.1.1,ping一下试试看通路