u/Zeekiosk

Image 1 — Help with PSRAM on custom rp2350a board
Image 2 — Help with PSRAM on custom rp2350a board

Help with PSRAM on custom rp2350a board

Hi everyone, I'm having issues with PSRAM on my new board. I'd really appreciate help with this since I'm at my wits end, and I need the extra PSRAM for my application (Digital Audio Player). Here's all the details:

Setup

What works

  • PSRAM device verification (KGD/EID read) passes — reports correct 8MB size
  • QMI register config reads back correct (timing, rfmt, rcmd, wfmt, wcmd all as expected)
  • Write via uncached alias (0x1500_0000) then read back via cached alias (0x1100_0000): full 8MB, passes every time
  • Writes via uncached alias work

What fails

  • Pretty much anything not mentioned above
  • Sequential write only via cached alias (0x1100_0000) appears to hang. I can see it running the write loop with gdb, but it never completes (or takes a really long time)
  • HEAP.init writing bookkeeping into PSRAM base: hard faults (PC=0x0, branch through null)
  • Failures are nondeterministic. Same build will sometimes hang, sometimes fault, sometimes get further before dying

Failures Seen

  • HardFault with PC=0x00000000, LR=0x00000012 (branch through null/garbage pointer)
  • HardFault with PC in valid flash, faulting code touching PSRAM (r2=0x11000000)
  • Sometimes pure indefinite hang, no fault. Could mean QMI stalled with CS1 asserted
  • Sometimes things will panic that don't panic on the pimoroni board
  • Just all the classic signs of memory corruption all over the place

Key characteristics

  • Read path through cache works completely. Write path through cache is what breaks
  • nondeterministic rather than a hard logic error
  • cooldown 0 made no difference
  • Pretty sure it's not a software difference since identical firmware works on Pimoroni Pico Plus 2 (only difference is pads are set to 3.3v on pimoroni)

Things already tried with no effect

  • 0x38 vs 0x02 write command
  • QSPI pads explicitly set to 1.8V, drive strength reduced to 4mA
  • CS pad (PIN_0) drive strength reduced to 4mA, slewfast off
  • cooldown 0 vs 1

Board notes / suspected differences vs working Pimoroni board

  • 10k pull-up on CS instead of Pimoroni's 100k
  • QSPI traces shorter than Pimoroni, 50 ohm impedance;,data line length mismatch: shortest is 7.3mm, longest is 13.7mm
  • Schematic otherwise matches reference

I'm really at my wits end with this! I get the feeling I messed up the layout somehow, but I can't really test it since I don't have access to an oscilloscope at the moment. Thanks for taking a look!

u/Zeekiosk — 8 days ago