rp2040-psram: Not working on RP2350

When building example with -DPICO_PLATFORM=rp2350-arm-s it stucks on first 8-bit writes.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

Aha - that’s the difference that I missed! RP2350 requires that pins must be explicitly enabled for input unlike on RP2040 where they are enabled by default. I will update the library to init the MISO pin so its input is enabled.

FYI: other initialazation code was tested (also for GPIO 16-19, async):

extern psram_spi_inst_t psram_spi;
static __always_inline bool init_psram() {
    psram_spi = psram_spi_init_clkdiv(pio0, -1, 2.0f, false);
    psram_write32(&psram_spi, 0x313373, 0xDEADBEEF);
    bool PSRAM_AVAILABLE = 0xDEADBEEF == psram_read32(&psram_spi, 0x313373);
    for (uint32_t addr32 = (1ul << 20); addr32 < (2ul << 20); addr32 += 4) {
        psram_write32(&psram_spi, addr32, 0xFF);
    }
    return PSRAM_AVAILABLE;
}

Also, it may be interresting for you - first case (from prev. post) was tested on CPU overclocked up to 366MHz, using:

    vreg_set_voltage(VREG_VOLTAGE_1_40);
    sleep_ms(10);
    set_sys_clock_khz(CPU_MHZ * KHZ, true);

and this one was tested in other application on 444MHz, overvoltaged up to 1.6v. Timings used:

    volatile uint32_t *qmi_m0_timing=(uint32_t *)0x400d000c;
    vreg_disable_voltage_limit();
    vreg_set_voltage(VREG_VOLTAGE_1_60);
    sleep_ms(33);
    *qmi_m0_timing = 0x60007204;
    set_sys_clock_hz(444000000, 0);
    *qmi_m0_timing = 0x60007303;

pio_gpio_init(pio, pin_miso); // MISSING this initialisation of the incoming PIN!

Tested on by pins - GPIO 18-21. Works ok. Thnx for your investigation!

FYI: all my attempts to launch psram_spi on RP2350 are failed. Last attempt was related to W/A documented - added resistor 4.7kOm to GND from input pin (5-th on PSRAM ESP32-64H chip). It still works as expected on RP2040, but failed on new chip. Also, attempt to try fudge/no-fudge init was failed too.