Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP build fails when including Pico SDK XIP cache maintenance header #10141

Open
eightycc opened this issue Mar 19, 2025 · 0 comments
Open

CP build fails when including Pico SDK XIP cache maintenance header #10141

eightycc opened this issue Mar 19, 2025 · 0 comments
Assignees
Labels
bug rp235x third-party Awaiting action on a third party for a fix or an answer to a request
Milestone

Comments

@eightycc
Copy link
Collaborator

CircuitPython version and board name

Building any RP2350-based raspberrypi with current top of `main`.

This is *not* a 9.2.5 regression.

Code/REPL

n/a

Behavior

n/a

Description

Including the header sdk/src/rp2_common/hardware_xip_cache/include/hardware/xip_cache.h results in:

In file included from common-hal/picodvi/Framebuffer_RP2350.c:42:
./sdk/src/rp2_common/hardware_xip_cache/include/hardware/xip_cache.h:67:5: error: "PICO_RP2040" is not defined, evaluates to 0 [-Werror=undef]
   67 | #if PICO_RP2040
      |     ^~~~~~~~~~~
./sdk/src/rp2_common/hardware_xip_cache/include/hardware/xip_cache.h:74:5: error: "PICO_RP2040" is not defined, evaluates to 0 [-Werror=undef]
   74 | #if PICO_RP2040
      |     ^~~~~~~~~~~
./sdk/src/rp2_common/hardware_xip_cache/include/hardware/xip_cache.h:180:6: error: "PICO_RP2040" is not defined, evaluates to 0 [-Werror=undef]
  180 | #if !PICO_RP2040 || PICO_COMBINED_DOCS
      |      ^~~~~~~~~~~

Additional information

The root cause of these errors is misuse of the PICO_RP2040 and PICO_RP2350 macros in CP. The Pico SDK, currently at version 2.1.1, expects these macros to always be defined. For an RP2040 target PICO_RP2040=1 and PICO_RP2350=0. Likewise, for an RP2350 target PICO_RP2040=0 and PICO_RP2350=1.

Unfortunately, there are a few places where Pico SDK 2.1.1 overlooked updating its use of these macros, resulting in an un-bootable UF2 file when building CP with CP's usage corrected. See: raspberrypi/pico-sdk#2356 . This pull has been merged into the Pico SDK develop branch and is scheduled for inclusion in 2.1.2.

I'm holding the CP pull in my repo here: https://github.com/eightycc/circuitpython/tree/fix-defines . Once Pico SDK 2.1.2 is released I'll submit a pull to update the SDK version as well as the pull for this issue.

@eightycc eightycc self-assigned this Mar 19, 2025
@eightycc eightycc added the third-party Awaiting action on a third party for a fix or an answer to a request label Mar 19, 2025
@tannewt tannewt added this to the 10.x.x milestone Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rp235x third-party Awaiting action on a third party for a fix or an answer to a request
Projects
None yet
Development

No branches or pull requests

2 participants