nuttx/Documentation
Marco Casaroli 8770fbea0f rp23xx: Add external QSPI PSRAM (APS6404) support for the Pimoroni Pico Plus 2.
Adds a driver for the external QSPI PSRAM hanging off QMI chip select 1,
such as the 8 MiB APS6404 fitted on the Pimoroni Pico Plus 2.

rp23xx_psramconfig() assigns the CS1 pin, reads the device ID over the QMI
direct interface to confirm an APS6404-family part (KGD 0x5D), resets it
into quad mode and programs the QMI M1 timing/read/write formats so the
region at 0x11000000 becomes directly addressable and writable.  Because
driving the QMI in direct mode stalls execute-in-place from the flash, the
detection and (re)configuration code runs from RAM (.time_critical) with
interrupts disabled; the command bytes are selected with immediates rather
than a .rodata table for the same reason.  The register values follow the
Raspberry Pi Pico SDK setup_psram().

The detection routine only keeps the QMI DIRECT_CSR synchronization that is
strictly necessary.  Each candidate busy-wait was removed one at a time and
re-verified on hardware: the post-enable "cooldown" waits, the READ_ID
TXEMPTY wait (redundant with the BUSY wait after it), and a fixed nop delay
proved unnecessary and are omitted.  The three BUSY waits that remain -- after
the quad-mode nudge, after each READ_ID byte, and after each reset/quad-enable
command -- are required and carry a comment explaining that the frame must
finish shifting before the chip select is deasserted, and what breaks
otherwise (garbage ID reads, or the shared QMI bus wedging).

rp23xx_psram_restore() re-applies the M1 configuration and is meant to be
called from the flash write path, which goes through the bootrom and
reconfigures the shared QMI for chip select 0.

rp23xx_heaps.c is wired into the build and now uses the detected size, so
the PSRAM is exposed to the memory manager (added to the main heap, used as
a separate heap, or as the user heap) and is skipped cleanly when no PSRAM
is present.

Enabled by default on the pimoroni-pico-2-plus:nsh configuration, where it
adds the 8 MiB to the main heap.  A documentation page for the Pimoroni Pico
Plus 2 is added alongside the other rp23xx boards, covering its serial
console, LED, the external PSRAM and how it is exposed to the heap, the
supported capabilities and the available configurations, with a photo of the
board.

Tested on Pimoroni Pico Plus 2 hardware: detection reports the 8 MiB
APS6404, the region is read/write across its whole range (ramtest word,
half-word and byte passes, marching/pattern/address-in-address), and the
heap reports the extra 8 MiB.

Assisted-by: Claude Code:claude-opus-4-8
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-07-25 13:49:05 -03:00
..
_extensions Documentation: port warnings_filter Sphinx extension from Zephyr 2023-11-28 09:18:29 -08:00
_static docs: reduce main content max width from 1200px to 1000px 2021-03-26 23:41:45 -05:00
_templates Documentation: support versioned docs 2020-11-26 10:58:44 -08:00
applications docs/applications/txmorse: Document the txmorse application 2026-07-24 12:03:37 +08:00
components drivers/sensors: add LIS3DSH accelerometer uORB driver 2026-07-25 14:45:40 +02:00
contributing !arch/stm32: move stm32l1 and finalize the directory split 2026-06-24 14:54:44 -03:00
debugging Documentation: Add documentation of SCHED_DUMP_TASKS and SCHED_DUMP_STACK 2026-06-09 08:04:54 -04:00
faq !boards: Remove NSH_ARCHINIT and board_app_initialize 2026-05-02 18:36:46 +08:00
guides arch/arm/src/stm32: unify pulse count driver into common/stm32 2026-07-12 09:35:51 +08:00
implementation Documentation: Fix kernel module wording. 2026-07-05 19:43:23 +02:00
introduction WIP: Documentation: replace first person perspectives 2025-05-19 20:21:33 +08:00
logos style: fix typos 2025-04-30 13:45:46 +08:00
platforms rp23xx: Add external QSPI PSRAM (APS6404) support for the Pimoroni Pico Plus 2. 2026-07-25 13:49:05 -03:00
quickstart Documentation: fill in pass1 directory description in organization.rst 2026-07-06 10:18:42 -03:00
reference arch/avr/src/avrdx/avrdx_delay: add custom up_udelay function 2026-06-12 09:55:11 -04:00
ReleaseNotes Documentation: add NuttX 13.0.0 release notes 2026-06-25 19:50:07 +08:00
standards libc/unistd: add getgroups() 2026-06-24 14:55:11 -03:00
testing Documentation/testing: Document MemBrowse integration 2026-06-19 12:21:54 -03:00
.gitignore docs/tags: Introduce tagging feature to the documentation. 2025-04-29 09:18:25 +02:00
conf.py Documentation: conf: Ignore .venv 2026-05-29 01:26:21 +08:00
glossary.rst rename doc/ -> Documentation/ 2020-08-24 10:29:55 -07:00
index.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
known-warnings.txt fs: Add VFS docs 2024-02-20 18:28:09 -08:00
legacy_README.md style: Fix "the the" typo across the codebase. 2026-03-23 11:07:49 +01:00
make.bat Documentation: Remove all tail spaces from *.rst and *.html 2020-10-18 10:51:22 -07:00
Makefile doc: Improve sphinx build time + add autobuild help info. 2026-01-27 09:50:55 +08:00
Pipfile docs/plantuml: Add PlantUML support to Documentation build 2026-02-15 08:47:23 +01:00
Pipfile.lock build(deps): bump starlette from 1.0.1 to 1.3.1 in /Documentation 2026-06-18 12:49:49 -04:00
security.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
substitutions.rst Remove the double blank line from source files 2022-02-20 20:10:14 +01:00