DESK-RZ-L/Peripherals/WiFi-BT

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes
2025/12/16 DESK-RZ-L-1.x.x release


Peripheral Wifi[edit | edit source]

The Wi-Fi peripheral is connected via the PCIe bus. See the documentation DESK-RZ-L/Peripherals/PCIe for further details about the bus.

Configuration[edit | edit source]

These peripheral(s) can only be used with the following ConfigID(s) (see the associated BOM):

ConfigID Note
2002 Wi-Fi & BLE are available
2003 Only Wi-Fi is available; thepins for BLE are used to drive motors

Accessing the peripheral[edit | edit source]

Linux[edit | edit source]

The driver for the Wi-Fi module is available as a kernel module.

The provided kernel correctly links the modules; if the kernel has been modified for development purposes, the modules might not link properly.

The driver is automatically loaded at boot time.

...
[    7.089493] mwifiex_pcie 0001:01:00.0: assign IRQ: got 160
[    7.113616] mwifiex_pcie 0001:01:00.0: enabling device (0000 -> 0002)
[    7.176632] mwifiex_pcie 0001:01:00.0: enabling bus mastering
[    7.176717] mwifiex_pcie: PCI memory map Virt0: (____ptrval____) PCI memory map Virt2: (____ptrval____)
[    8.180697] mwifiex_pcie 0001:01:00.0: info: FW download over, size 632240 bytes
[    9.058758] mwifiex_pcie 0001:01:00.0: WLAN FW is active
[    9.122178] mwifiex_pcie 0001:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p179) 
[    9.122191] mwifiex_pcie 0001:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p179) 
[    9.268923] mwifiex_pcie 0001:01:00.0 wlP1p1s0: renamed from mlan0
...

Check for Wi-Fi module detection:

root@desk-t2h-usd-devel:~# lspci
0000:00:00.0 PCI bridge: Renesas Technology Corp. Device 1135
0000:01:00.0 USB controller: Renesas Technology Corp. uPD720202 USB 3.0 Host Controller (rev 02)
0001:00:00.0 PCI bridge: Renesas Technology Corp. Device 1135
0001:01:00.0 Ethernet controller: Marvell Technology Group Ltd. Device 2b42 (rev 11)   <----

Check for Wi-Fi kernel module:

root@desk-t2h-usd-devel:~# lsmod
Module                  Size  Used by
mwifiex_pcie           40960  0
mwifiex               253952  1 mwifiex_pcie
...
Example wifi static connection[edit | edit source]

Check that the interface is properly initialized:

root@desk-t2h-usd-devel:~# ifconfig
...
wlP1p1s0: flags=4098<BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether c0:bf:be:d8:22:d1  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Check rfkill status and in case unblock device:

root@desk-t2h-usd-devel:~# rfkill list
0: phy0: Wireless LAN
        Soft blocked: yes
        Hard blocked: no
root@desk-t2h-usd-devel:~# rfkill unblock 0 

Setup the wpa_supplicant.conf configuration file for handling the WiFi connection, for example:

root@desk-t2h-usd-devel:~# cat /etc/wpa_supplicant.conf
network={
    ssid="ZyXEL"
    key_mgmt=NONE
}

Apply the wpa_supplicant.conf configuration file manually starting the wpa_supplicant:

wpa_supplicant -i wlP1p1s0 -c /etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
...
root@desk-t2h-usd-devel:~# ifconfig wlP1p1s0  192.168.11.168

Then the network access is enabled:

root@desk-t2h-usd-devel:~# ping 192.168.11.243 -I wlP1p1s0 -c 4
PING 192.168.11.243 (192.168.11.243) from 192.168.11.168 wlP1p1s0: 56(84) bytes of data.
64 bytes from 192.168.11.243: icmp_seq=1 ttl=64 time=6.36 ms
64 bytes from 192.168.11.243: icmp_seq=2 ttl=64 time=1.21 ms
64 bytes from 192.168.11.243: icmp_seq=3 ttl=64 time=1.24 ms
64 bytes from 192.168.11.243: icmp_seq=4 ttl=64 time=1.21 ms

--- 192.168.11.243 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.206/2.504/6.360/2.226 ms
root@desk-t2h-usd-devel:~# 
Example BLE[edit | edit source]

Attention: The BLE interface is available only with ConfigID 2002.

Configure the UART to communicate with the BLE module:

root@desk-t2h-usd-devel:~# stty -F /dev/ttySC1 115200 -echo -echoe crtscts

Attach the BLE module:

root@desk-t2h-usd-devel:~# hciattach /dev/ttySC1 any 115200 flow
Device setup complete

Check if the interface is blocked using rfkill:

root@desk-t2h-usd-devel:~# rfkill list
0: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: hci0: Bluetooth
        Soft blocked: yes
        Hard blocked: no
root@desk-t2h-usd-devel:~# rfkill unblock 1

Check the available hci interfaces:

root@desk-t2h-usd-devel:~# hciconfig list
hci0:   Type: Primary  Bus: UART
        BD Address: C0:BF:BE:D8:22:D0  ACL MTU: 1021:7  SCO MTU: 120:6
        UP RUNNING 
        RX bytes:1505 acl:0 sco:0 events:91 errors:0
        TX bytes:1272 acl:0 sco:0 commands:91 errors:0

Set up the interface and scan for devices:

root@desk-t2h-usd-devel:~# hciconfig hci0 up
root@desk-t2h-usd-devel:~# hcitool dev
Devices:
        hci0    C0:BF:BE:D8:22:D0
root@desk-t2h-usd-devel:~# bluetoothctl
Agent registered
[CHG] Controller C0:BF:BE:D8:22:D0 Pairable: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller C0:BF:BE:D8:22:D0 Discovering: yes
[NEW] Device 12:27:BE:82:00:77 12-27-BE-82-00-77
[NEW] Device 62:78:A9:98:38:95 62-78-A9-98-38-95
[NEW] Device 7D:6E:DE:37:76:27 7D-6E-DE-37-76-27
[CHG] Device 62:78:A9:98:38:95 RSSI: -78
[CHG] Device 12:27:BE:82:00:77 RSSI: -69
[CHG] Device 62:78:A9:98:38:95 RSSI: -65
[CHG] Device 12:27:BE:82:00:77 RSSI: -77
[NEW] Device 73:A5:FE:43:F0:90 73-A5-FE-43-F0-90
[CHG] Device 62:78:A9:98:38:95 RSSI: -82
[bluetooth]# scan off
Discovery stopped
[CHG] Device 73:A5:FE:43:F0:90 RSSI is nil
[CHG] Device 7D:6E:DE:37:76:27 TxPower is nil
[CHG] Device 7D:6E:DE:37:76:27 RSSI is nil
[CHG] Device 62:78:A9:98:38:95 TxPower is nil
[CHG] Device 62:78:A9:98:38:95 RSSI is nil
[CHG] Device 12:27:BE:82:00:77 RSSI is nil
[CHG] Controller C0:BF:BE:D8:22:D0 Discovering: no
[bluetooth]#