2024年1月21日 星期日

STM32MP157 buildroot Wifi/wlan0

Board: STM32MP157f-DK2
OS: buildroot (branch: remotes/origin/st/2022.02)
patch: buildroot-external-st (branch: st/2022.02.7)

從可以用的卡把/lib/firware備份到新的卡

/lib/firmware/
drwxr-xr-x    4 root     root        1.0K Jan  1 00:02 .
drwxr-xr-x    5 root     root        2.0K Jan  1 00:02 ..
-rw-r--r--    1 root     root        8.8K Sep 20  2022 LICENCE.cypress_bcm4343
drwxr-xr-x    2 root     root        1.0K Jan  1 00:02 brcm
drwxr-xr-x    2 root     root        1.0K Jan  1 00:02 cypress
-rw-r--r--    1 root     root        4.5K Sep 20  2022 regulatory.db
-rw-r--r--    1 root     root        1.2K Sep 20  2022 regulatory.db.p7s
-rw-r--r--    1 root     root       56.6K Sep 20  2022 stm32g0-ucsi.mp135f-dk.fw

/lib/firmware/brcm
BCM43430A1.hcd
brcmfmac43430-sdio.AP6212.txt
brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt
brcmfmac43430-sdio.MUR1DX.txt
brcmfmac43430-sdio.beagle,beaglev-starlight-jh7100-a1.txt
brcmfmac43430-sdio.beagle,beaglev-starlight-jh7100-r0.txt
brcmfmac43430-sdio.bin
brcmfmac43430-sdio.clm_blob
brcmfmac43430-sdio.friendlyarm,nanopi-r1.txt
brcmfmac43430-sdio.raspberrypi,3-model-b.txt
brcmfmac43430-sdio.raspberrypi,model-zero-w.txt
brcmfmac43430-sdio.sinovoip,bpi-m2-plus.txt
brcmfmac43430-sdio.sinovoip,bpi-m2-ultra.txt
brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt
brcmfmac43430-sdio.sinovoip,bpi-m3.txt
brcmfmac43430-sdio.st,stm32mp135f-dk.txt
brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
brcmfmac43430-sdio.st,stm32mp157f-dk2.txt
brcmfmac43430-sdio.starfive,visionfive-v1.txt
brcmfmac43430-sdio.txt

/lib/firmware/cypress
cyfmac43430-sdio.bin
cyfmac43430-sdio.clm_blob

直接啟動
# ifconfig wlan0 up
ifconfig: SIOCSIFFLAGS: Operation not possible due to RF-kill

soft block開啟,關掉它
# ls /sys/class/rfkill/
rfkill0  rfkill1

# cd  /sys/class/rfkill/rfkill1

# cat name
phy0

# echo 0 > soft

# ifconfig wlan0 up
wlan0     Link encap:Ethernet  HWaddr 48:EB:62:D3:41:2D
          UP BROADCAST MULTICAST  MTU:1500  Metric: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)

但需手動重啟wpa_supplicant,不然會有問題
nl80211: kernel reports: Match already configured
[   40.411946] ieee80211 phy0: brcmf_cfg80211_add_iface: iface validation failed: err=-16
Failed to create interface p2p-dev-wlan0: -16 (Device or resource busy)
nl80211: Failed to create a P2P Device interface p2p-dev-wlan0
P2P: Failed to enable P2P Device interface
[   41.773256] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready


# killall wpa_supplicant
// wpa_cli -i wlan0 
// wpa_cli -i wlan0 scan_result 這些指令應該可以用了
# wpa_passphrase "your_ssid_name" "your_ssid_key" >> /etc/wpa_supplicant.conf
# wpa_supplicant -B -iwlan0 -c /etc/wpa_supplicant.conf
# udhcpc -i wlan0
udhcpc: started, v1.35.0
udhcpc: broadcasting discover
udhcpc: broadcasting select for 192.168.43.79, server 192.168.43.1
udhcpc: lease of 192.168.43.79 obtained from 192.168.43.1, lease time 3600
deleting routers
adding dns 192.168.43.1

# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 11:22:33:44:55:66
          inet addr:192.168.43.79  Bcast:192.168.43.255  Mask:255.255.255.0
          inet6 addr: 1111::2222:3333:4444:5555/64 Scope:Link
          inet6 addr: 1111:2222:3333:4444:5555:6666:7777:8888/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1070 (1.0 KiB)  TX bytes:1714 (1.6 KiB)

沒有留言:

張貼留言