Skip to content

boards/arm/rp23xx: add Raspberry Pi Pico 2 W board (CYW43439 Wi-Fi)#19250

Open
ricardgb wants to merge 4 commits into
apache:masterfrom
ricardgb:rp23xx-raspberrypi-pico-2-w
Open

boards/arm/rp23xx: add Raspberry Pi Pico 2 W board (CYW43439 Wi-Fi)#19250
ricardgb wants to merge 4 commits into
apache:masterfrom
ricardgb:rp23xx-raspberrypi-pico-2-w

Conversation

@ricardgb

@ricardgb ricardgb commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ Disclosure: this board port and the RP2350 PIO-gSPI CYW43439 driver were developed with Claude Code (an AI coding agent) and validated on real Pico 2 W hardware. Please review accordingly.

Summary

Adds a board port for the Raspberry Pi Pico 2 W (RP2350 + Infineon CYW43439), the Wi-Fi variant of the Pico 2. It reuses the existing raspberrypi-pico-2 port and adds support for the onboard CYW43439 Wi-Fi device.

The CYW43439 is driven through a new RP2350 PIO-based gSPI transport (arch/arm/src/rp23xx/rp23xx_cyw43439.c) that plugs into NuttX's existing bcm43xxx/bcmf FullMAC driver — the same driver the RP2040 raspberrypi-pico-w uses. The WL pins (WL_REG_ON=GPIO23, WL_DATA=GPIO24, WL_CS=GPIO25, WL_CLK=GPIO29) match the official pico-sdk pico2_w.h.

A telnet defconfig associates to an AP over WPA2 (NETINIT_WAPI), obtains a DHCP lease, and exposes an NSH shell over TCP/telnet.

The CYW43439 firmware blob is not included — it is proprietary and fetched from pico-sdk / the cyw43-driver exactly as the RP2040 Pico W port does; CONFIG_CYW43439_FIRMWARE_BIN_PATH points at it and it is embedded at build time.

Impact

  • New: boards/arm/rp23xx/raspberrypi-pico-2-w/ and arch/arm/src/rp23xx/rp23xx_cyw43439.{c,h}.
  • No existing board/arch behaviour changes: the arch/arm/src/rp23xx/{Make.defs,CMakeLists.txt} additions compile the new driver only under CONFIG_IEEE80211_INFINEON_CYW43439; boards/Kconfig gains the new board registration.

Testing

  • Build: ./tools/configure.sh raspberrypi-pico-2-w:telnet && make (arm-none-eabi-gcc); the board + driver compile cleanly on master and nxstyle is clean on all new files.
  • Hardware: flashed to a real Pico 2 W. The CYW43439 came up over PIO-gSPI (no clock tuning needed), associated to a WPA2 AP, obtained a DHCP lease, and served an NSH shell over telnet:
    NuttX ... arm raspberrypi-pico-2-w
    wlan0  Link encap:Ethernet HWaddr 88:a2:9e:..  RUNNING
           inet addr:192.168.0.43  Mask:255.255.255.0
    

🤖 Generated with Claude Code

@github-actions github-actions Bot added Area: Build system Arch: arm Issues related to ARM (32-bit) architecture Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm labels Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@linguini1 linguini1 closed this Jul 1, 2026
@xiaoxiang781216

xiaoxiang781216 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@linguini1 why close this pr? All developers will do the development with AI assistant sooner or later; it isn't good to close the AI assistant pr directly without any justification.

@linguini1

Copy link
Copy Markdown
Contributor

@linguini1 why close this pr?

This PR, its text, and the users comments are entirely generated by Claude Code.

@xiaoxiang781216

Copy link
Copy Markdown
Contributor

@linguini1 why close this pr?

This PR, its text, and the users comments are entirely generated by Claude Code.

ALL my pr done in this year do by AI, does this mean I can't contribute to NuttX?

@linguini1

linguini1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@linguini1 why close this pr?

This PR, its text, and the users comments are entirely generated by Claude Code.

ALL my pr done in this year do by AI, does this mean I can't contribute to NuttX?

Every one? I assume you are reviewing the output, but this PR is highly suspicious of someone who did not properly review the output. It is an account with almost no activity and no prior contributions to NuttX.

I personally don't think anything entirely AI generated should be in the NuttX kernel; it should be an assistance tool. But, that is not up to me. In this case, I closed the PR because it looks like it was generated by someone with no understanding of what they're doing.

Also, there continues to be legal issues with licensing of AI-generated code.

@linguini1 linguini1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include the full test logs of what you tested on the Pico.

@xiaoxiang781216

xiaoxiang781216 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@linguini1 why close this pr?

This PR, its text, and the users comments are entirely generated by Claude Code.

ALL my pr done in this year do by AI, does this mean I can't contribute to NuttX?

Every one? I assume you are reviewing the output,

Yes, ALL my patch include pr is generated by Claude Code, but of course I review each line change carefully and do the test before I request AI create the pr.

but this PR is highly suspicious of someone who did not properly review the output. It is an account with almost no activity and no prior contributions to NuttX.

@ricardgb please answer @linguini1's concern.

I personally don't think anything entirely AI generated should be in the NuttX kernel; it should be an assistance tool. But, that is not up to me. In this case, I closed the PR because it looks like it was generated by someone with no understanding of what they're doing.

We need accept the trend: all developers will utilize AI to generate material (code, commit, documentation, pr) sooner or later.

Also, there continues to be legal issues with licensing of AI-generated code.

it's new topic, we should consult Apache legal team.

@ricardgb

ricardgb commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Hi, I'm the developer who submitted the PR. First of all, thanks for all the work being done in this great OS. I have a degree in electonics engineering and have been developing with nuttx for several years now (as a hobby). Although I tried to run nuttx on a pi pico before, I was unable to make the wifi work. I tried with Claude Code and I managed to have a running telnet over wifi, so I thought the work may save days of work to someone else.

Regards,
PICO2W_PR_TESTLOG.md

@linguini1

Copy link
Copy Markdown
Contributor

There is actually some guidance from the Apache team here: https://www.apache.org/legal/generative-tooling.html#include-in-contributions

The TLDR: It notes that a) no generated output is copyrightable at all and b) all generated output must be verified to be compatible with open source licensing, not containing any third party materials.

This is quite impossible to do, and it's been shown in multiple studies that AI generated output can verbatim contain text that was in its training corpus (i.e. incompatible licensed code like GPLv2 ripped from somewhere on the internet). See this for example. The only way for us to really verify that code is compatible is if it comes from a human brain. AI assistance should be used for assistance only, not entirely generating board ports with Claude. There is no way we can ensure it's safe to release that under an Apache 2.0 license, and it's also a major time sink to review PRs where the author puts "Please review accordingly.". It is the contributor's responsibility to properly review and test their own patch before submission, not for us to review their AI output.

@linguini1

Copy link
Copy Markdown
Contributor

Hi, I'm the developer who submitted the PR. First of all, thanks for all the work being done in this great OS. I have a degree in electonics engineering and have been developing with nuttx for several years now (as a hobby). Although I tried to run nuttx on a pi pico before, I was unable to make the wifi work. I tried with Claude Code and I managed to have a running telnet over wifi, so I thought the work may save days of work to someone else.

Regards, PICO2W_PR_TESTLOG.md

Thank you for the additional information! Can you attach this in your PR description?

Did you generate the entire board port using Claude?

@ricardgb

ricardgb commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Hi, I'm the developer who submitted the PR. First of all, thanks for all the work being done in this great OS. I have a degree in electonics engineering and have been developing with nuttx for several years now (as a hobby). Although I tried to run nuttx on a pi pico before, I was unable to make the wifi work. I tried with Claude Code and I managed to have a running telnet over wifi, so I thought the work may save days of work to someone else.
Regards, PICO2W_PR_TESTLOG.md

Thank you for the additional information! Can you attach this in your PR description?

Did you generate the entire board port using Claude?

Hi, basically I did the entire board port using Claude, although I have some failed attempts sitting on my computer. I understand that it may be against the policy to not publish AI code, but at least the PR itself can be of use to someone.

Best regards,

@linguini1

Copy link
Copy Markdown
Contributor

Hi, basically I did the entire board port using Claude, although I have some failed attempts sitting on my computer. I understand that it may be against the policy to not publish AI code, but at least the PR itself can be of use to someone.

Understood. NuttX currently doesn't have an official policy stance on AI (we desperately need one), so this may be up for debate, but for the aforementioned legality issues of releasing an entirely generated port under Apache 2.0 I think this needs to wait for comment.

@acassis

acassis commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@ricardgb @xiaoxiang781216 @linguini1 I'm not against the AI usage, but I think we should have some way to let people know that the code was:

  1. created entirely by a human developer without AI help;
  2. created by a human with help from AI, mostly used to help fixing small issues;
  3. totally generated by AI under a human request, without know exactly the generated code.

I think this case here is the item 3. And thank you @ricardgb for been honest about it.

Please let me know what you guys think about it.

@linguini1

Copy link
Copy Markdown
Contributor

Please let me know what you guys think about it.

That's fine, but I do not think we can accept entirely AI-generated PRs. We have no way to assuredly license it under Apache 2.0. It's more of a gray area when there is AI assistance (hence why we need a policy), but I am strongly against merging entirely AI coded or majority AI coded PRs if only for the reason that we cannot copyright it under Apache 2.0.

@ricardgb ricardgb requested a review from linguini1 July 1, 2026 17:55
@acassis

acassis commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Please let me know what you guys think about it.

That's fine, but I do not think we can accept entirely AI-generated PRs. We have no way to assuredly license it under Apache 2.0. It's more of a gray area when there is AI assistance (hence why we need a policy), but I am strongly against merging entirely AI coded or majority AI coded PRs if only for the reason that we cannot copyright it under Apache 2.0.

Agree, it needs to be a human generated code with AI help, not the opposite! So, direct usage of AI agent to opening and submitting PR should be avoided.

@acassis

acassis commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@ricardgb please fix this error:

Configuration/Tool: raspberrypi-pico-2-w/telnet,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2026-07-01 18:18:30
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Building NuttX...
arm-none-eabi-ld: /github/workspace/sources/nuttx/staging/libsched.a(nx_bringup.o): in function `nx_start_application':
/github/workspace/sources/nuttx/sched/init/nx_bringup.c:322:(.text.nx_start_task+0x8): undefined reference to `board_late_initialize'
make[1]: *** [Makefile:230: nuttx] Error 1
make: *** [tools/Unix.mk:569: nuttx] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 397: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory

@ricardgb ricardgb force-pushed the rp23xx-raspberrypi-pico-2-w branch from 48b72b8 to 0d6a421 Compare July 1, 2026 18:51
Comment thread boards/arm/rp23xx/raspberrypi-pico-2-w/src/etc/init.d/rc.sysinit Outdated
Comment thread boards/arm/rp23xx/raspberrypi-pico-2-w/src/etc/init.d/rcS Outdated

@cederom cederom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ricardgb :-)

@cederom

cederom commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@xiaoxiang781216: @linguini1 why close this pr?

@linguini1: This PR, its text, and the users comments are entirely generated by Claude Code.

@xiaoxiang781216: ALL my pr done in this year do by AI, does this mean I can't contribute to NuttX?

@linguini1: Every one? I assume you are reviewing the output,

@xiaoxiang781216: Yes, ALL my patch include pr is generated by Claude Code, but of course I review each line change carefully and do the test before I request AI create the pr.

@linguini1: but this PR is highly suspicious of someone who did not properly review the output. It is an account with almost no activity and no prior contributions to NuttX.

@xiaoxiang781216: @ricardgb please answer @linguini1's concern.

@linguini1: I personally don't think anything entirely AI generated should be in the NuttX kernel; it should be an assistance tool. But, that is not up to me. In this case, I closed the PR because it looks like it was generated by someone with no understanding of what they're doing.

@xiaoxiang781216: We need accept the trend: all developers will utilize AI to generate material (code, commit, documentation, pr) sooner or later.

@linguini1: Also, there continues to be legal issues with licensing of AI-generated code.

@xiaoxiang781216: it's new topic, we should consult Apache legal team.

@xiaoxiang781216 I agree with @linguini1 here, and looking at the mailing list, most of the community - we want to keep NuttX a project developed by a community of passionates, professionals, and enthusiasts.

"all developers will utilize AI to generate material (code, commit, documentation, pr) sooner or later" - yes we cannot avoid that, but we do NOT need to "accept the trend", we may just acknowledge the problem but not become part of the problem :-)

This is similar to "rewrite everything in Rust" "trend" - we may acknowledge the problem and still not become part of the problem :-)

Let people rewrite everything in Rust, but from scratch, away from here. The same with AI :-)

@ricardgb

ricardgb commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Hi all, I can continue asking Claude to fix those issues; I don't mind. But given the concerns around the licensing, would you rather prefer that I start writing the changes myself? Or leave this PR here waiting for the licensing concerns to be resolved?

@acassis

acassis commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hi all, I can continue asking Claude to fix those issues; I don't mind. But given the concerns around the licensing, would you rather prefer that I start writing the changes myself? Or leave this PR here waiting for the licensing concerns to be resolved?

@ricardgb I suggest you to try fixing the issues yourself. AI is like a crutch, it will help you, but sometimes you don't need it, but you keep mentally dependent on it. So, please believe you are capable and try do it.

@cederom

cederom commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@ricardgb: Hi all, I can continue asking Claude to fix those issues; I don't mind. But given the concerns around the licensing, would you rather prefer that I start writing the changes myself? Or leave this PR here waiting for the licensing concerns to be resolved?

We would love you to write the code yourself and have fun from learning and sharing the fun with us, rather than copy-paste the results from AI.

Although there is no formal policy yet here, we do not welcome pure AI slop, but we welcome individuals that want to learn and join our community even if this seems hard at first or you are about to make mistakes no worries.

Try to use AI as your helper but try to do the work on your own to get the insight and understanding how things work yourself :-)

Comment thread boards/arm/rp23xx/raspberrypi-pico-2-w/src/rp23xx_firmware.c
Comment thread arch/arm/src/rp23xx/rp23xx_cyw43439.c Outdated
@ricardgb ricardgb force-pushed the rp23xx-raspberrypi-pico-2-w branch 3 times, most recently from 2a1e7fd to c6033b7 Compare July 6, 2026 07:17
Comment thread boards/arm/rp23xx/raspberrypi-pico-2-w/src/rp23xx_firmware.c Outdated
Comment thread boards/arm/rp23xx/raspberrypi-pico-2-w/Kconfig
ricardgb and others added 4 commits July 11, 2026 18:39
Add a board port for the Raspberry Pi Pico 2 W (RP2350 + Infineon
CYW43439).  The board reuses the existing raspberrypi-pico-2 port and
adds support for the onboard CYW43439 Wi-Fi device, driven through a new
RP2350 PIO-based gSPI transport (arch/arm/src/rp23xx/rp23xx_cyw43439.c)
that plugs into NuttX's existing bcm43xxx (bcmf) FullMAC driver.

A telnet defconfig is provided that associates to an AP (NETINIT WAPI),
obtains a DHCP lease, and exposes an NSH shell over TCP/telnet.

This board port and the RP2350 PIO-gSPI CYW43439 driver were developed
with Claude Code (Anthropic's agentic coding tool) and validated on real
Pico 2 W hardware: Wi-Fi association, DHCP, and a TCP/telnet session over
the CYW43439.

Signed-off-by: Ricard Rosson <ricard@groundbits.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Port the three RP2040 USB device fixes (PR apache#19378) to the RP2350
controller, without which CDC-NCM RX returns zero-length reads and the
data-PID toggle desynchronises under load:

  - Clamp the bulk-OUT read length to the endpoint maxpacket size before
    arming the hardware buffer.  The buffer-control LEN field is 10 bits;
    a larger request overflows it and the host sees zero-byte reads.
  - Track whether a request already armed the hardware buffer (new
    rp23xx_req_s.armed) so a request resubmitted from its own completion
    callback is not armed a second time.  A double arm toggles the data
    PID and the host drops the packet.
  - Set the AVAILABLE bit in a separate write after the LEN/PID word, per
    RP2040 datasheet section 4.1.2.5.1, instead of in the same store.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ricard Rosson <ricard@groundbits.com>
Add a composite USB device that presents a CDC-ACM serial console and a
CDC-NCM network interface (eth0) at once, for the Pico 2 W access
device: the host gets a console and a USB NIC over a single connection.

The two classes must use disjoint endpoint numbers or they collide, so
board_composite_connect() assigns CDC-ACM 1/2/3 and CDC-NCM 4/5/6.
Build the new rp23xx_composite.c under CONFIG_USBDEV_COMPOSITE (CMake
and Make.defs).

The common bringup optionally autostarts the "portalup" helper
(CONFIG_EXAMPLES_PORTALUP) which connects the composite, brings up the
interfaces and starts the mDNS responder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ricard Rosson <ricard@groundbits.com>
Add an "access" board configuration for the Pico 2 W access device: a
WiFi station plus a composite USB device (CDC-ACM console + CDC-NCM NIC)
with a DHCP server, and an mDNS responder pinned to the USB NIC (eth0)
via CONFIG_NETUTILS_MDNS_BIND_IFNAME so a host plugged into USB resolves
the board by name without advertising onto the WiFi network.  The
portalup boot helper brings the interfaces up and starts the responder.

Requires an apps tree providing EXAMPLES_PORTALUP and the mDNS
single-interface bind option, e.g.:

  ./tools/configure.sh -a ../apps-integration raspberrypi-pico-2-w:access

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ricard Rosson <ricard@groundbits.com>
@ricardgb ricardgb force-pushed the rp23xx-raspberrypi-pico-2-w branch from fe294eb to 380a2e7 Compare July 13, 2026 07:51
@ricardgb

Copy link
Copy Markdown
Contributor Author

Pushed an update addressing the review:

  • @xiaoxiang781216 — both inline comments addressed: STRINGIFY() from nuttx/macro.h now used in rp23xx_firmware.c (replies in-thread), and I answered the CYW43439_FIRMWARE_LEN question above.
  • DCO — the three Missing Signed-off-by failures in the check job were commits 2–4 of this PR; all four commits now carry a Signed-off-by. tools/checkpatch.sh -c -u -m -g passes locally on the series.
  • nxstyle — fixed the brace-alignment errors in rp23xx_common_bringup.c (the boot-helper spawn block no longer uses a bare {} scope; declarations are hoisted under the same #ifdef).
  • @acassis — I could not reproduce the earlier undefined reference to \board_late_initialize'link error on the current head:CONFIG_BOARD_LATE_INITIALIZEnow defaultsyand the board defines it, soraspberrypi-pico-2-w:telnet` links cleanly here (arm-none-eabi-gcc 13.2). Hopefully the CI build agrees now — please let me know if it still fails on your side.
  • @cederom — board documentation is included at Documentation/platforms/arm/rp23xx/boards/raspberrypi-pico-2-w/index.rst, and I'll expand the PR description with the build + on-hardware runtime testing details.

Disclosure: these changes were prepared with the help of an AI agent and human-reviewed before pushing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: Build system Board: arm Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants