Support for Pimoroni Pico Plus 2


#1

Is there anything like a definition for the Pimoroni Pico Plus 2 (2350 + 16MB flash + 8MB PSRAM) .ino fragment available? I’m not quite sure what all is and is not supported for 2350 right now, so not quite sure how to indicate this board has PSRAM as well as a big flash, but no SDCARD.


uLisp now supports the RP2350-based Raspberry Pi Pico 2
#2

There’s no support for that board in uLisp at the moment, but it should be fairly easy to add it. Start from the Raspberry Pi Pico 2 definition in the ARM version of uLisp.


#3

That’s what I’m doing, using ulisp-esp PSRAM references as a key to where I need to add them in ulisp-arm.

If I replicate all the BOARD_HAS_PSRAM sections from ulisp-esp into ulisp-arm, that should enable it for ARM, correct? Or do I also need to dig into the memory map stuff to make sure the PSRAM window’s getting located properly, etc.? Or will I run into PSRAM-related symbols from esp BSP that just don’t exist for ARM BSP? I noted that esp seems to handle the allocation separately, am I going to encounter library/board issues trying to approach PSRAM for ARM that way?

Am I correct in thinking that if the board is pimoroni_pico_plus_2 then the define will be PIMORONI_PICO_PLUS_2?


#4

If I replicate all the BOARD_HAS_PSRAM sections from ulisp-esp into ulisp-arm, that should enable it for ARM, correct?

You will need to check the RP2350 datasheet to find out how to address the PSRAM; it may be different from the way the ESP32 handles PSRAM, with psramInit() and ps_malloc().

Initially you should just be able to get the board working with the on-chip RAM.

Am I correct in thinking that if the board is pimoroni_pico_plus_2 then the define will be PIMORONI_PICO_PLUS_2?

It’s not quite that simple. Check the boards.txt file for the section corresponding to the Pimoroni Pico Plus 2; I see it’s been added to version 4.0.3 of the Earle Philhower Core. Then find the build.board line:

pimoroni_pico_plus_2.build.board=PIMORONI_PICO_PLUS_2

Finally, append ARDUINO_ to the front, to get:

ARDUINO_PIMORONI_PICO_PLUS_2

That’s what you need to put in the #define.


#5

Much appreciate the help, thanks!

So digging into the ARM BSP implementation of it, I see they actually integrate in with the regular RAM (they have a multi-pool allocator), but also provide separate PSRAM only allocator (pmalloc() & pcalloc(), free() and realloc() “just work normally” with PSRAM allocs).

I’m thinking I’ll do a BOARD_HAS_PSRAM-gated hybrid model using largeRAM approach to object handling, but using the main allocator so both SRAM and PSRAM get used. I intend to profile after and see what further tweaks are needed (I’ve got a few decades of pro system/embedded work under my belt, so this kind of stuff is “fun” for me).

Thanks again!


#6

Have a look at how I’ve implemented support for a large amount of memory on the latest release of the RISC-V version of uLisp; that’s probably closer to what you’ll need.


#7

Will do, thanks much! Are you planning on backporting that yourself to ARM? I’m fine with contributing mine back, but am not clear on any style guidelines, etc. (just haven’t gone looking for that yet).


#8

@jwiede I now have a Pimoroni Pico Plus 2 board, and am trying to get it working with uLisp. Everything seems to be working, apart from a problem with save-image when using PSRAM. I’ve posted an issue about what I think is causing it:

Once I get this issue resolved I should be able to make a new release of ARM uLisp with support for this board.