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

Trouble initializing QSPI when the chip is actually busy

Hi,

I noticed that when I initiate a chip-erase on the flash-chip and reset the MCU, I'm getting NRFX_ERROR_TIMEOUT's on my nrfx_qspi_init().

I found this ticket: https://devzone.nordicsemi.com/f/nordic-q-a/28947/what-does-qspi-activate-task-do

Which confirms that the QSPI periph tries to request the status register before doing anything, could it be that it blocks any further communication until the chip reports itself as ready? I tried to transmit the 0x66 / 0x99, RESET_ENABLE / RESET_MEMORY opcodes (after the failed init) to make it reset manually:

    nrfx_err_t rc = NRFX_SUCCESS;
    nrf_qspi_cinstr_conf_t enable_reset_cfg = {
        .opcode = 0x66,
        .length = NRF_QSPI_CINSTR_LEN_1B,
        .io2_level = true,
        .io3_level = true,
        .wipwait = false,
        .wren = false
    };
    rc = nrfx_qspi_cinstr_xfer(&enable_reset_cfg, NULL, NULL);

    if(rc == NRFX_SUCCESS)
    {
        nrf_delay_us(QSPI_RESET_ENABLE_DELAY_US);
    }

    if(rc == NRFX_SUCCESS)
    {
        nrf_qspi_cinstr_conf_t memory_reset_cfg = {
            .opcode = 0x99,
            .length = NRF_QSPI_CINSTR_LEN_1B,
            .io2_level = true,
            .io3_level = true,
            .wipwait = false,
            .wren = false
        };
        rc = nrfx_qspi_cinstr_xfer(&memory_reset_cfg, NULL, NULL);
    }

    if(rc == NRFX_SUCCESS)
    {
        nrf_delay_us(QSPI_RESET_MEMORY_DELAY_US);
    }

But I am getting timeouts on these calls as well...

I their a sensible way to recover the unit without waiting for a full chip-erase. I'm a bit worried that a crash / reset / whatever mid erase may cause my unit to decide that the flash is broken on boot. (I'm supposed to do a self-check on boot, and die if that fails)

I'm using the 7.0.2 SDK with the S140 7.2.0 SD

Related