ricardgb opened a new pull request, #21071: URL: https://github.com/apache/nuttx/pull/21071
## Summary `raspberrypi-pico-2-w` and `pimoroni-pico-plus-2-w` carry the Infineon CYW43439 the same way, and much of their CYW43439 support was copied from one board to the other. Following @casaroli's suggestion on #19250, this moves the shared parts to `boards/arm/rp23xx/common`: - **Kconfig:** `RP23XX_INFINEON_CYW43439`, `CYW43439_FIRMWARE_BIN_PATH`, `CYW43439_FIRMWARE_LEN` and the `ARCH_LEDS` default move from both board `Kconfig` files to `common/Kconfig`, under a new hidden option, `RP23XX_HAVE_CYW43439`, that both boards select in `boards/Kconfig`. - **Firmware staging (Make):** the rules that stage the blob for `rp23xx_firmware.c` move from both boards' `src/Make.defs` into `common/src/Make.defs`, next to `rp23xx_firmware.c`. The CMake build already stages it in common, so this is a Make-only change. - **User LED:** the identical `rp23xx_userleds.c` (the LED is on the CYW43439's GPIO 0) and `rp23xx_extra_gpio.h` move to `common/src/rp23xx_cyw43439_userleds.c` and `common/include/rp23xx_extra_gpio.h`. The source gets a new name so that it does not clash with the `rp23xx_userleds.c` of the boards with a GPIO LED. It is built when `RP23XX_INFINEON_CYW43439` is enabled, which only boards that select `RP23XX_HAVE_CYW43439` can do. Not moved: `rp23xx_gpio.c`, `rp23xx_boardinitialize.c`, the LED/button/pin definitions and the defconfigs, which differ between the boards. The `rp23xx_i2cdev.h`/`i2sdev.h`/`spidev.h`/`spisd.h` copies are also left alone, because `board.h` includes them and code outside the board build reaches `board.h` as `<arch/board/board.h>`, where `common/include` is not on the path. ## Impact Build structure only, for `raspberrypi-pico-2-w` and `pimoroni-pico-plus-2-w`; no functional change. Other rp23xx boards are unaffected. - For every defconfig of the two boards (`raspberrypi-pico-2-w:composite`, `:telnet`, `pimoroni-pico-plus-2-w:nsh`, `:usbnsh`, `:wifi`), the resolved `.config` is identical to master apart from the new `CONFIG_RP23XX_HAVE_CYW43439=y`. `raspberrypi-pico-2:nsh` is identical. - A `raspberrypi-pico-2-w:composite` build with the CYW43439, WAPI and user LEDs enabled has exactly the same symbols as the same build on master, and 4 more bytes of text: the longer source path in a debug string. - Board code that includes `<arch/board/rp23xx_extra_gpio.h>` must now include `"rp23xx_extra_gpio.h"`; the only in-tree user is the LED driver moved here. The board documentation is updated. ## Testing Builds (Make, `arm-none-eabi-gcc` 13.2.1, `-Werror`, against master `da8dba1252`): `raspberrypi-pico-2-w:composite`, `raspberrypi-pico-2-w:telnet`, `pimoroni-pico-plus-2-w:nsh`, `:usbnsh`, `:wifi` and `raspberrypi-pico-2:nsh`, with no warnings. `board_userled` and the firmware blob are in the image exactly where the CYW43439 is enabled. Each commit builds on its own (`raspberrypi-pico-2-w:telnet`, `pimoroni-pico-plus-2-w:wifi`). The defconfigs are unchanged by `make savedefconfig`, except for the `CONFIG_HOST_MACOS=y` line in the `pimoroni-pico-plus-2-w` defconfigs, which master shows too. CMake: `raspberrypi-pico-2-w:composite` and `pimoroni-pico-plus-2-w:nsh` link. `raspberrypi-pico-2-w:telnet` compiles the moved LED driver and then stops at the `.incbin` in `rp23xx_firmware.c`, which happens on master too (for example `pimoroni-pico-plus-2-w:wifi`) and is not changed here. Raspberry Pi Pico 2 W, `raspberrypi-pico-2-w:composite` with the CYW43439, WAPI, user LEDs and the `leds` example enabled: ``` nsh> uname -a NuttX 13.0.0-RC0 934c52b388a Oct 28 2026 09:04:15 arm raspberrypi-pico-2-w nsh> ifconfig wlan0 wlan0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 at DOWN mtu 576 nsh> ifup wlan0 ifup wlan0...OK nsh> ifconfig wlan0 wlan0 Link encap:Ethernet HWaddr 98:fe:54:16:41:ca at UP mtu 576 nsh> wapi scan wlan0 bssid / frequency / signal level / encode / ssid ... (9 access points, omitted) nsh> leds led_daemon: Opening /dev/userleds led_daemon: Supported LEDs 0x01 led_daemon: LED set 0x01 led_daemon: LED set 0x00 led_daemon: LED set 0x01 ... ``` The firmware is staged by the moved Make rules, and the LED is driven by the moved driver. I do not have a Pimoroni Pico Plus 2 W; it is covered by the build checks above. `tools/checkpatch.sh -c -u -m -g` passes. --- *This PR was prepared with the assistance of an AI agent (Claude Code) and human-reviewed; the results above are from real hardware.* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
