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

PlatformIO PSRam Pimoroni Pico 2 (2350) Demo #2790

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

webzep
Copy link

@webzep webzep commented Feb 3, 2025

Being a bit of a noob in this area, I had a lot of trouble getting PSRAM working on PIO with the pimoroni pico plus 2.

So here is a demo for future noobs like myself that need a bit of hand holding.

Thanks for your work and relentlessly patient attitude Earle, its refreshing to deal with a friendly maintainer.

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Feb 4, 2025

The way I see it, this is a documentation issue better solved with updating the docs. The PlatformIO specific part is just about configuring

build_flags = -fexceptions
              -DRP2350_PSRAM_CS=47
board_build.pico_boot2_name = boot2_psram8.S
board_build.pico_psram_size = 8
board_upload.psram_length = 8388608

in regards to that:

  1. Enabling exceptions is also documented in https://arduino-pico.readthedocs.io/en/latest/platformio.html#c-exceptions
  2. Configuring the PSRAM CS will be documented through Document PSRAM and Boot2 better #2792
  3. Setting the Boot2 source file will be documented through Document PSRAM and Boot2 better #2792. Also the board_build.pico_psram_size config name is wrong / unused? It should have no effect because board_build.arduino.earlephilhower.boot2_source is used
  4. PSRAM length was already documented at https://arduino-pico.readthedocs.io/en/latest/platformio.html#psram-size. Also board_build.pico_psram_size should have no effect because, the next line is actually correctly configuring it for 8MB.

The C/C++ code specific stuff, like having to use pmalloc(), we already have documented at https://arduino-pico.readthedocs.io/en/latest/psram.html#using-psram-for-dynamic-allocations

@earlephilhower
Copy link
Owner

While this probably isn't necessary as a P.IO example, the idea of implementing anstd::allocator which uses PSRAM seems like a neat trick that might save some grief. One of those things you don't need until you really need it.

If the P.IO bit isn't quite right in the configuration here, maybe we can drop that bit and leave just the actual INO as an example of a PSRAM allocator? (BTW, CI is failing due to formatting. You need to run tools/restyle.sh or copy the existing INO example(Arduino) style w/2 space indents to get that to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants