apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.78k stars 1.15k forks source link

[BUG] RaspberryPi-Pico-W is not getting WiFi with Pi Pico SDK 2.0 #13828

Open UAV-Pilot opened 2 weeks ago

UAV-Pilot commented 2 weeks ago

Description / Steps to reproduce the issue

Except getting the latest Pi Pico SDK 2.0, the rest is the same as https://github.com/apache/nuttx/issues/7475, which is closed now.

Similar to the errors in https://github.com/apache/nuttx/issues/7475, the following errors occurred:

I set SSID and passphrase in menuconfig, and also tried to set them in nsh.

nsh> renew wlan0 ERROR: netlib_obtain_ipv4addr() failed nsh> ifconfig wlan0 wlan0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 at DOWN mtu 5nsh> nsh> nsh> ifup wlan0 ifup wlan0...Failed

ChatGPT suggested to set mac address: ifconfig wlan0 hw ether XX:XX:XX:XX:XX:XX (e.g., 28:CD:C1:0A:38:9A) but got error: nsh: ifconfig: argument invalid

nsh> wapi show wlan0 wlan0 Configuration: IP: 0.0.0.0 NetMask: 255.255.255.0 nsh> wapi scan wlan0 nsh> wapi scan_results wlan0 nsh> ifup wlan0 ifup wlan0...Failed

Besides this firmware issue during setup, along the way I encounter other issues as shown in comments below: 1) When not set during menuconfig, SSID and passphrase entered manually in wapi commands disappeared after reboot 2) ifconfig did not output ip address, etc. 3) ifup wlan0 returned message OK which was misleading when wlan0 was not connected and not up running correctly

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Windows 11 WSL2 Ubuntu 22.04.2

NuttX Version

NuttX 12.7.0-RC0 0976258299-dirty Oct 4 2024 22:58:36 arm rasp

Issue Architecture

[Arch: arm]

Issue Area

[Area: Networking]

Verification

darwinbeing commented 2 weeks ago

Download the BINARY firmware file from this link: 43439A0-7.95.49.00.combined ~220K

Make sure the configuration file variable points to the correct firmware file: CONFIG_CYW43439_FIRMWARE_BIN_PATH="${PICO_SDK_PATH}/lib/cyw43-driver/firmware/43439A0-7.95.49.00.combined" When compiling, the cyw43439.firmware.image file is created, and it’s the same as firmware/43439A0-7.95.49.00.combined. Ensure the paths and files match during the build, especially in: boards/arm/rp2040/common/src/cyw43439.firmware.image prebuilt firmware nuttx.uf2.zip

Screenshot 2024-10-06 at 3 32 59 AM
UAV-Pilot commented 2 weeks ago

@darwinbeing Thanks a lot for your quick help! With that firmware, I got wifi working on pi pico W with SDK 2.0.

Besides this firmware issue during setup, along the way I encounter other issues as shown by the following commands: 1) When not set during menuconfig, SSID and passphrase entered manually in wapi commands disappeared after reboot 2) ifconfig did not output ip address, etc. 3) ifup wlan0 returned message OK which was misleading when wlan0 was not connected and not up running correctly

Note: for the following session, SSID and passphrase were not set from menuconfig.

NuttShell (NSH) NuttX-12.7.0-RC0 nsh> ifconfig wlan0 wlan0 Link encap:Ethernet HWaddr 28:cd:c1:0a:38:9a at UP mtu 576nsh> nsh> ifup wlan0 ifup wlan0...OK nsh> nsh> wapi show wlan0 wlan0 Configuration: IP: 0.0.0.0 NetMask: 255.255.255.0 Frequency: 2412 Flag: WAPI_FREQ_AUTO Channel: 1 Frequency: 2412 ESSID: Flag: WAPI_ESSID_ON Mode: WAPI_MODE_MANAGED BitRate: 72000 Flag: WAPI_BITRATE_FIXED Sense: 0 Country: XX nsh> nsh> wapi psk wlan0 XXXXXXX WPA_ALG_CCMP nsh> wapi essid wlan0 MySSID WAPI_ESSID_ON nsh> renew wlan0 nsh> wapi show wlan0 wlan0 Configuration: IP: 192.168.1.160 NetMask: 255.255.255.0 Frequency: 2462 Flag: WAPI_FREQ_AUTO Channel: 11 Frequency: 2462 ESSID: MySSID Flag: WAPI_ESSID_ON Mode: WAPI_MODE_MANAGED AP: f8:9b:6e:e7:9e:44 BitRate: 65000 Flag: WAPI_BITRATE_FIXED TxPower: 31 Flag: WAPI_TXPOWER_DBM Sense: -76 Country: XX

nsh> ifconfig wlan0 wlan0 Link encap:Ethernet HWaddr 28:cd:c1:0a:38:9a at RUNNING mt5.255.0

nsh> ping 192.168.1.254 PING 192.168.1.254 56 bytes of data 56 bytes from 192.168.1.254: icmp_seq=0 time=0.0 ms 56 bytes from 192.168.1.254: icmp_seq=1 time=0.0 ms 56 bytes from 192.168.1.254: icmp_seq=2 time=0.0 ms 56 bytes from 192.168.1.254: icmp_seq=3 time=0.0 ms rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms, time 3730 ms nsh>
linguini1 commented 2 weeks ago

I see if there is no firmware file present, then the firmware file is initialized with the text "dummy" at boards/arm/rp2040/raspberrypi-pico-w/src/Make.defs line 53.

Did the firmware file used to be generated? Maybe we can incorporate that generation back into the build system, or instruct users on how to build the firmware? This should at least be documented somewhere versus the current documentation which just instructs the firmware repo to be cloned.

linguini1 commented 2 weeks ago

It appears the new firmware file actually allows the blob binary to be included as a C variable instead of requiring the assembly instruction to include the binary.

Maybe we could update the boards/arm/rp2040/common/src/rp2040_firmware.c file to do that? I'll look into it. It would also be good to add a warning for the missing firmware file instead of silently making a dummy file.