This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

QSPI issue/questions

Hey everyone, I'm trying to use the QSPI module (again) to interface to RAM, not FLASH. I'm not really sure if this is possible, but we'll get there. Right now I can't get it to initialize.

So far I can't even get the qspi module to initilize, nrfx_qspi_init always returns 0x0000000d which I don't even see on the list of possible errors. Any ideas where this is coming from?

    //INITIALIZE THE QSPI
    nrfx_qspi_config_t config = NRFX_QSPI_DEFAULT_CONFIG;

    config.pins.sck_pin    = RAM_QSPI_SCK_PIN;
    config.pins.csn_pin    = RAM_QSPI_CS1_PIN;
    config.pins.io0_pin    = RAM_QSPI_IO0_PIN;
    config.pins.io1_pin    = RAM_QSPI_IO1_PIN;
    config.pins.io2_pin    = RAM_QSPI_IO2_PIN;
    config.pins.io3_pin    = RAM_QSPI_IO3_PIN;
    config.prot_if.readoc     = 0b00000011;
    config.prot_if.writeoc    = 0b00000010;

    nrfx_qspi_uninit();

    err_code = nrfx_qspi_init(&config, qspi_handler, NULL);
    APP_ERROR_CHECK(err_code);

I've tried it without changing any parameters, just boot up, run the nrfx_qspi_init with the defaults in the sdk_config and it still throws the same error. QSPI can use any pins on the chip, right?

Second, once I get that going, can I even use this module with a custom readoc and writeoc commands? I know the sdk is set up only to deal with flash but I should be able to write in whatever commands I want there, and it should communicate with the RAM just fine, no?

The RAM is a Microchip 23LC1024, wired up like a standard QSPI flash, I just need to use these commands when writting/reading:

sdk is 15.2.0 

Parents Reply
  • I think that's a hard one. 

    The only solution I can think of is to manipulate the CLK and I/O lines with GPIOs during the instruction/command phase. 
    That would require an external multiplexer between the QSPI and RAM device.
    The idea is to mask the first 6 clock cycles and injecting the instructions on the last 2. 

    It might require execution priority on the CPU during that time in order to bit-bang the instruction. 

Children
Related